mixer / beam-client-python Goto Github PK
View Code? Open in Web Editor NEWSuper basic chat bot framework for Beam
License: MIT License
Super basic chat bot framework for Beam
License: MIT License
Where do you find the Channel ID that is asked for in the config.py/config.example.py?
the Beam.pro site is still listed in files. the api call is https://mixer.com/api/v1/ not https://beam.pro/api/v1/
Traceback (most recent call last):
File "example.py", line 16, in
chat.authenticate(config.CHANNEL)
File "/beam-client-python/chatty/connection.py", line 80, in authenticate
self._log_into_beam()
File "/beam-client-python/chatty/connection.py", line 54, in _log_into_beam
raise UnknownError(login_response)
chatty.errors.UnknownError: <Response [200]>
I was going to attempt to create my own Beam bot, just as a side project for my own amusement.
So, I git clone
-d the repository and then run python3 setup.py build && sudo python3 setup.py install
. That all went off without a hitch.
However, when I went to run the example code (after updating my config.py
) I got this:
$ python3 example.py
Connecting to wss://chat2-dal07.beam.pro:443/ws
ERROR:tornado.general:Uncaught exception, closing connection.
Traceback (most recent call last):
File "/usr/local/lib/python3.4/dist-packages/tornado-4.2-py3.4-linux-i686.egg/tornado/iostream.py", line 504, in _handle_events
self._handle_connect()
File "/usr/local/lib/python3.4/dist-packages/tornado-4.2-py3.4-linux-i686.egg/tornado/iostream.py", line 1359, in _handle_connect
do_handshake_on_connect=False)
File "/usr/local/lib/python3.4/dist-packages/tornado-4.2-py3.4-linux-i686.egg/tornado/netutil.py", line 510, in ssl_wrap_socket
return context.wrap_socket(socket, **kwargs)
File "/usr/lib/python3.4/ssl.py", line 365, in wrap_socket
_context=self)
File "/usr/lib/python3.4/ssl.py", line 542, in __init__
raise ValueError("check_hostname requires server_hostname")
ValueError: check_hostname requires server_hostname
ERROR:tornado.application:Exception in callback None
Traceback (most recent call last):
File "/usr/local/lib/python3.4/dist-packages/tornado-4.2-py3.4-linux-i686.egg/tornado/ioloop.py", line 866, in start
handler_func(fd_obj, events)
File "/usr/local/lib/python3.4/dist-packages/tornado-4.2-py3.4-linux-i686.egg/tornado/stack_context.py", line 275, in null_wrapper
return fn(*args, **kwargs)
File "/usr/local/lib/python3.4/dist-packages/tornado-4.2-py3.4-linux-i686.egg/tornado/iostream.py", line 504, in _handle_events
self._handle_connect()
File "/usr/local/lib/python3.4/dist-packages/tornado-4.2-py3.4-linux-i686.egg/tornado/iostream.py", line 1359, in _handle_connect
do_handshake_on_connect=False)
File "/usr/local/lib/python3.4/dist-packages/tornado-4.2-py3.4-linux-i686.egg/tornado/netutil.py", line 510, in ssl_wrap_socket
return context.wrap_socket(socket, **kwargs)
File "/usr/lib/python3.4/ssl.py", line 365, in wrap_socket
_context=self)
File "/usr/lib/python3.4/ssl.py", line 542, in __init__
raise ValueError("check_hostname requires server_hostname")
ValueError: check_hostname requires server_hostname
Socket closed [Code 1005] Connection refused
Reestablishing the socket in 1 second.
^CTraceback (most recent call last):
File "example.py", line 30, in <module>
ioloop.IOLoop.instance().start()
File "/usr/local/lib/python3.4/dist-packages/tornado-4.2-py3.4-linux-i686.egg/tornado/ioloop.py", line 841, in start
event_pairs = self._impl.poll(poll_timeout)
KeyboardInterrupt
What's causing this? I'm on Ubuntu MATE 15.04, running Python 3.4.3. All of the required packages are fully up to date.
There I was, running the example.py and nothing worked :D
PS C:\Users\DayDreamer-i7\Desktop\beam-client-python-master> C:\Python34\python.exe .\example.py`
Traceback (most recent call last):
File ".\example.py", line 20, in
chat.authenticate()
File "C:\Users\DayDreamer-i7\Desktop\beam-client-python-master\chatty\connection.py", line 54, in authenticate
self._get_chat_details()
File "C:\Users\DayDreamer-i7\Desktop\beam-client-python-master\chatty\connection.py", line 33, in _get_chat_details
self.userid = requests.get(url=url, headers=header).json()['id']
KeyError: 'id'
ERROR:tornado.application:Uncaught exception, closing connection.
Traceback (most recent call last):
File "C:\Users\dtoth\Anaconda3\lib\site-packages\tornado\websocket.py", line 412, in _run_callback
callback(*args, **kwargs)
File "C:\Users\dtoth\Anaconda3\lib\site-packages\tornado\websocket.py", line 995, in on_message
self._on_message_callback(message)
File "C:\Users\dtoth\Dropbox\beambot\python\beam-client-python\chatty\socket.py", line 45, in parse_packet
self.emit("message", packet)
File "C:\Users\dtoth\Dropbox\beambot\python\beam-client-python\chatty\evented.py", line 15, in emit
handler[1](*args)
File "C:\Users\dtoth\Dropbox\beambot\python\beam-client-python\chatty\connection.py", line 55, in <lambda>
self.websocket.on("message", lambda msg: self.emit("message", msg))
File "C:\Users\dtoth\Dropbox\beambot\python\beam-client-python\chatty\evented.py", line 15, in emit
handler[1](*args)
File "example.py", line 11, in _handle_chat
chatevents.formatting(data)
File "C:\Users\dtoth\Dropbox\beambot\python\beam-client-python\ChatEventHandler.py", line 21, in formatting
func(data)
File "C:\Users\dtoth\Dropbox\beambot\python\beam-client-python\ChatEventHandler.py", line 78, in type_event
msg=msg))
File "C:\Users\dtoth\Anaconda3\lib\encodings\cp1252.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\u2192' in position 11: character maps to <undefined>
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\dtoth\Anaconda3\lib\site-packages\tornado\iostream.py", line 554, in wrapper
return callback(*args)
File "C:\Users\dtoth\Anaconda3\lib\site-packages\tornado\stack_context.py", line 343, in wrapped
raise_exc_info(exc)
File "<string>", line 3, in raise_exc_info
File "C:\Users\dtoth\Anaconda3\lib\site-packages\tornado\stack_context.py", line 314, in wrapped
ret = fn(*args, **kwargs)
File "C:\Users\dtoth\Anaconda3\lib\site-packages\tornado\websocket.py", line 804, in _on_frame_data
self._handle_message(opcode, data)
File "C:\Users\dtoth\Anaconda3\lib\site-packages\tornado\websocket.py", line 824, in _handle_message
self._run_callback(self.handler.on_message, decoded)
File "C:\Users\dtoth\Anaconda3\lib\site-packages\tornado\websocket.py", line 415, in _run_callback
self.request.path, exc_info=True)
File "C:\Users\dtoth\Anaconda3\lib\site-packages\tornado\httpclient.py", line 634, in __getattr__
request_attr = getattr(self.request, name)
AttributeError: 'HTTPRequest' object has no attribute 'path'
ERROR:tornado.application:Exception in callback functools.partial(<function wrap.<locals>.null_wrapper at 0x000001ECFD2A9E18>)
Traceback (most recent call last):
File "C:\Users\dtoth\Anaconda3\lib\site-packages\tornado\websocket.py", line 412, in _run_callback
callback(*args, **kwargs)
File "C:\Users\dtoth\Anaconda3\lib\site-packages\tornado\websocket.py", line 995, in on_message
self._on_message_callback(message)
File "C:\Users\dtoth\Dropbox\beambot\python\beam-client-python\chatty\socket.py", line 45, in parse_packet
self.emit("message", packet)
File "C:\Users\dtoth\Dropbox\beambot\python\beam-client-python\chatty\evented.py", line 15, in emit
handler[1](*args)
File "C:\Users\dtoth\Dropbox\beambot\python\beam-client-python\chatty\connection.py", line 55, in <lambda>
self.websocket.on("message", lambda msg: self.emit("message", msg))
File "C:\Users\dtoth\Dropbox\beambot\python\beam-client-python\chatty\evented.py", line 15, in emit
handler[1](*args)
File "example.py", line 11, in _handle_chat
chatevents.formatting(data)
File "C:\Users\dtoth\Dropbox\beambot\python\beam-client-python\ChatEventHandler.py", line 21, in formatting
func(data)
File "C:\Users\dtoth\Dropbox\beambot\python\beam-client-python\ChatEventHandler.py", line 78, in type_event
msg=msg))
File "C:\Users\dtoth\Anaconda3\lib\encodings\cp1252.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\u2192' in position 11: character maps to <undefined>
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\dtoth\Anaconda3\lib\site-packages\tornado\ioloop.py", line 604, in _run_callback
ret = callback()
File "C:\Users\dtoth\Anaconda3\lib\site-packages\tornado\stack_context.py", line 275, in null_wrapper
return fn(*args, **kwargs)
File "C:\Users\dtoth\Anaconda3\lib\site-packages\tornado\iostream.py", line 554, in wrapper
return callback(*args)
File "C:\Users\dtoth\Anaconda3\lib\site-packages\tornado\stack_context.py", line 343, in wrapped
raise_exc_info(exc)
File "<string>", line 3, in raise_exc_info
File "C:\Users\dtoth\Anaconda3\lib\site-packages\tornado\stack_context.py", line 314, in wrapped
ret = fn(*args, **kwargs)
File "C:\Users\dtoth\Anaconda3\lib\site-packages\tornado\websocket.py", line 804, in _on_frame_data
self._handle_message(opcode, data)
File "C:\Users\dtoth\Anaconda3\lib\site-packages\tornado\websocket.py", line 824, in _handle_message
self._run_callback(self.handler.on_message, decoded)
File "C:\Users\dtoth\Anaconda3\lib\site-packages\tornado\websocket.py", line 415, in _run_callback
self.request.path, exc_info=True)
File "C:\Users\dtoth\Anaconda3\lib\site-packages\tornado\httpclient.py", line 634, in __getattr__
request_attr = getattr(self.request, name)
AttributeError: 'HTTPRequest' object has no attribute 'path'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.