errbotio / err-backend-gitter Goto Github PK
View Code? Open in Web Editor NEWgitter.im backend for err
License: GNU General Public License v3.0
gitter.im backend for err
License: GNU General Public License v3.0
Line 211 in e655788
It should be json_users = self._backend.readAPIRequest('rooms/%s/users' % self._idd)
instead.
!room list
shows that the bot is joined to all the rooms, but it isn't, I have to manually make it join rooms with !room join ...
Due to change in filenames the import statement previously from errbot.errBot import ErrBot
now should be changed to from errbot.core import ErrBot
in gitter.py file.
Instead, they currently die silently (apart from a bunch of exceptions in the log) which causes the bot to stop processing messages for the room.
Real-life example:
2016-03-01 16:20:54,770 DEBUG errbot.backends.gitter keep alive
2016-03-01 16:20:56,833 DEBUG errbot.backends.gitter keep alive
2016-03-01 16:20:56,871 DEBUG errbot.backends.gitter keep alive
2016-03-01 16:20:56,873 DEBUG errbot.backends.gitter keep alive
2016-03-01 16:20:56,977 DEBUG errbot.backends.gitter keep alive
Exception in thread Thread-28:
Traceback (most recent call last):
File "/srv/errbot/virtualenv/lib/python3.4/site-packages/requests/packages/urllib3/response.py", line 435, in _update_chunk_length
self.chunk_left = int(line, 16)
ValueError: invalid literal for int() with base 16: b''
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/srv/errbot/virtualenv/lib/python3.4/site-packages/requests/packages/urllib3/response.py", line 226, in _error_catcher
yield
File "/srv/errbot/virtualenv/lib/python3.4/site-packages/requests/packages/urllib3/response.py", line 486, in read_chunked
self._update_chunk_length()
File "/srv/errbot/virtualenv/lib/python3.4/site-packages/requests/packages/urllib3/response.py", line 439, in _update_chunk_length
raise httplib.IncompleteRead(line)
http.client.IncompleteRead: IncompleteRead(0 bytes read)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/srv/errbot/virtualenv/lib/python3.4/site-packages/requests/models.py", line 660, in generate
for chunk in self.raw.stream(chunk_size, decode_content=True):
File "/srv/errbot/virtualenv/lib/python3.4/site-packages/requests/packages/urllib3/response.py", line 340, in stream
for line in self.read_chunked(amt, decode_content=decode_content):
File "/srv/errbot/virtualenv/lib/python3.4/site-packages/requests/packages/urllib3/response.py", line 514, in read_chunked
self._original_response.close()
File "/usr/lib/python3.4/contextlib.py", line 77, in __exit__
self.gen.throw(type, value, traceback)
File "/srv/errbot/virtualenv/lib/python3.4/site-packages/requests/packages/urllib3/response.py", line 244, in _error_catcher
raise ProtocolError('Connection broken: %r' % e, e)
requests.packages.urllib3.exceptions.ProtocolError: ('Connection broken: IncompleteRead(0 bytes read)', IncompleteRead(0 bytes read))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.4/threading.py", line 920, in _bootstrap_inner
self.run()
File "/usr/lib/python3.4/threading.py", line 868, in run
self._target(*self._args, **self._kwargs)
File "/srv/errbot/extra_backends/err-backend-gitter/gitter.py", line 256, in background
for line in r.iter_lines(chunk_size=1): # it fails with anything else than 1.
File "/srv/errbot/virtualenv/lib/python3.4/site-packages/requests/models.py", line 702, in iter_lines
for chunk in self.iter_content(chunk_size=chunk_size, decode_unicode=decode_unicode):
File "/srv/errbot/virtualenv/lib/python3.4/site-packages/requests/models.py", line 663, in generate
raise ChunkedEncodingError(e)
requests.exceptions.ChunkedEncodingError: ('Connection broken: IncompleteRead(0 bytes read)', IncompleteRead(0 bytes read))
Exception in thread Thread-20:
Traceback (most recent call last):
File "/srv/errbot/virtualenv/lib/python3.4/site-packages/requests/packages/urllib3/response.py", line 435, in _update_chunk_length
self.chunk_left = int(line, 16)
ValueError: invalid literal for int() with base 16: b''
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/srv/errbot/virtualenv/lib/python3.4/site-packages/requests/packages/urllib3/response.py", line 226, in _error_catcher
yield
File "/srv/errbot/virtualenv/lib/python3.4/site-packages/requests/packages/urllib3/response.py", line 486, in read_chunked
self._update_chunk_length()
File "/srv/errbot/virtualenv/lib/python3.4/site-packages/requests/packages/urllib3/response.py", line 439, in _update_chunk_length
raise httplib.IncompleteRead(line)
http.client.IncompleteRead: IncompleteRead(0 bytes read)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/srv/errbot/virtualenv/lib/python3.4/site-packages/requests/models.py", line 660, in generate
for chunk in self.raw.stream(chunk_size, decode_content=True):
File "/srv/errbot/virtualenv/lib/python3.4/site-packages/requests/packages/urllib3/response.py", line 340, in stream
for line in self.read_chunked(amt, decode_content=decode_content):
File "/srv/errbot/virtualenv/lib/python3.4/site-packages/requests/packages/urllib3/response.py", line 514, in read_chunked
self._original_response.close()
File "/usr/lib/python3.4/contextlib.py", line 77, in __exit__
self.gen.throw(type, value, traceback)
File "/srv/errbot/virtualenv/lib/python3.4/site-packages/requests/packages/urllib3/response.py", line 244, in _error_catcher
raise ProtocolError('Connection broken: %r' % e, e)
requests.packages.urllib3.exceptions.ProtocolError: ('Connection broken: IncompleteRead(0 bytes read)', IncompleteRead(0 bytes read))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.4/threading.py", line 920, in _bootstrap_inner
self.run()
File "/usr/lib/python3.4/threading.py", line 868, in run
self._target(*self._args, **self._kwargs)
File "/srv/errbot/extra_backends/err-backend-gitter/gitter.py", line 256, in background
for line in r.iter_lines(chunk_size=1): # it fails with anything else than 1.
File "/srv/errbot/virtualenv/lib/python3.4/site-packages/requests/models.py", line 702, in iter_lines
for chunk in self.iter_content(chunk_size=chunk_size, decode_unicode=decode_unicode):
File "/srv/errbot/virtualenv/lib/python3.4/site-packages/requests/models.py", line 663, in generate
raise ChunkedEncodingError(e)
requests.exceptions.ChunkedEncodingError: ('Connection broken: IncompleteRead(0 bytes read)', IncompleteRead(0 bytes read))
Exception in thread Thread-22:
Traceback (most recent call last):
File "/srv/errbot/virtualenv/lib/python3.4/site-packages/requests/packages/urllib3/response.py", line 435, in _update_chunk_length
self.chunk_left = int(line, 16)
ValueError: invalid literal for int() with base 16: b''
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/srv/errbot/virtualenv/lib/python3.4/site-packages/requests/packages/urllib3/response.py", line 226, in _error_catcher
yield
File "/srv/errbot/virtualenv/lib/python3.4/site-packages/requests/packages/urllib3/response.py", line 486, in read_chunked
self._update_chunk_length()
File "/srv/errbot/virtualenv/lib/python3.4/site-packages/requests/packages/urllib3/response.py", line 439, in _update_chunk_length
raise httplib.IncompleteRead(line)
http.client.IncompleteRead: IncompleteRead(0 bytes read)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/srv/errbot/virtualenv/lib/python3.4/site-packages/requests/models.py", line 660, in generate
for chunk in self.raw.stream(chunk_size, decode_content=True):
File "/srv/errbot/virtualenv/lib/python3.4/site-packages/requests/packages/urllib3/response.py", line 340, in stream
for line in self.read_chunked(amt, decode_content=decode_content):
File "/srv/errbot/virtualenv/lib/python3.4/site-packages/requests/packages/urllib3/response.py", line 514, in read_chunked
self._original_response.close()
File "/usr/lib/python3.4/contextlib.py", line 77, in __exit__
self.gen.throw(type, value, traceback)
File "/srv/errbot/virtualenv/lib/python3.4/site-packages/requests/packages/urllib3/response.py", line 244, in _error_catcher
raise ProtocolError('Connection broken: %r' % e, e)
requests.packages.urllib3.exceptions.ProtocolError: ('Connection broken: IncompleteRead(0 bytes read)', IncompleteRead(0 bytes read))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.4/threading.py", line 920, in _bootstrap_inner
self.run()
File "/usr/lib/python3.4/threading.py", line 868, in run
self._target(*self._args, **self._kwargs)
File "/srv/errbot/extra_backends/err-backend-gitter/gitter.py", line 256, in background
for line in r.iter_lines(chunk_size=1): # it fails with anything else than 1.
File "/srv/errbot/virtualenv/lib/python3.4/site-packages/requests/models.py", line 702, in iter_lines
for chunk in self.iter_content(chunk_size=chunk_size, decode_unicode=decode_unicode):
File "/srv/errbot/virtualenv/lib/python3.4/site-packages/requests/models.py", line 663, in generate
raise ChunkedEncodingError(e)
requests.exceptions.ChunkedEncodingError: ('Connection broken: IncompleteRead(0 bytes read)', IncompleteRead(0 bytes read))
Exception in thread Thread-24:
Traceback (most recent call last):
File "/srv/errbot/virtualenv/lib/python3.4/site-packages/requests/packages/urllib3/response.py", line 435, in _update_chunk_length
self.chunk_left = int(line, 16)
ValueError: invalid literal for int() with base 16: b''
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/srv/errbot/virtualenv/lib/python3.4/site-packages/requests/packages/urllib3/response.py", line 226, in _error_catcher
yield
File "/srv/errbot/virtualenv/lib/python3.4/site-packages/requests/packages/urllib3/response.py", line 486, in read_chunked
self._update_chunk_length()
File "/srv/errbot/virtualenv/lib/python3.4/site-packages/requests/packages/urllib3/response.py", line 439, in _update_chunk_length
raise httplib.IncompleteRead(line)
http.client.IncompleteRead: IncompleteRead(0 bytes read)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/srv/errbot/virtualenv/lib/python3.4/site-packages/requests/models.py", line 660, in generate
for chunk in self.raw.stream(chunk_size, decode_content=True):
File "/srv/errbot/virtualenv/lib/python3.4/site-packages/requests/packages/urllib3/response.py", line 340, in stream
for line in self.read_chunked(amt, decode_content=decode_content):
File "/srv/errbot/virtualenv/lib/python3.4/site-packages/requests/packages/urllib3/response.py", line 514, in read_chunked
self._original_response.close()
File "/usr/lib/python3.4/contextlib.py", line 77, in __exit__
self.gen.throw(type, value, traceback)
File "/srv/errbot/virtualenv/lib/python3.4/site-packages/requests/packages/urllib3/response.py", line 244, in _error_catcher
raise ProtocolError('Connection broken: %r' % e, e)
requests.packages.urllib3.exceptions.ProtocolError: ('Connection broken: IncompleteRead(0 bytes read)', IncompleteRead(0 bytes read))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.4/threading.py", line 920, in _bootstrap_inner
self.run()
File "/usr/lib/python3.4/threading.py", line 868, in run
self._target(*self._args, **self._kwargs)
File "/srv/errbot/extra_backends/err-backend-gitter/gitter.py", line 256, in background
for line in r.iter_lines(chunk_size=1): # it fails with anything else than 1.
File "/srv/errbot/virtualenv/lib/python3.4/site-packages/requests/models.py", line 702, in iter_lines
for chunk in self.iter_content(chunk_size=chunk_size, decode_unicode=decode_unicode):
File "/srv/errbot/virtualenv/lib/python3.4/site-packages/requests/models.py", line 663, in generate
raise ChunkedEncodingError(e)
requests.exceptions.ChunkedEncodingError: ('Connection broken: IncompleteRead(0 bytes read)', IncompleteRead(0 bytes read))
Exception in thread Thread-26:
Traceback (most recent call last):
File "/srv/errbot/virtualenv/lib/python3.4/site-packages/requests/packages/urllib3/response.py", line 435, in _update_chunk_length
self.chunk_left = int(line, 16)
ValueError: invalid literal for int() with base 16: b''
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/srv/errbot/virtualenv/lib/python3.4/site-packages/requests/packages/urllib3/response.py", line 226, in _error_catcher
yield
File "/srv/errbot/virtualenv/lib/python3.4/site-packages/requests/packages/urllib3/response.py", line 486, in read_chunked
self._update_chunk_length()
File "/srv/errbot/virtualenv/lib/python3.4/site-packages/requests/packages/urllib3/response.py", line 439, in _update_chunk_length
raise httplib.IncompleteRead(line)
http.client.IncompleteRead: IncompleteRead(0 bytes read)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/srv/errbot/virtualenv/lib/python3.4/site-packages/requests/models.py", line 660, in generate
for chunk in self.raw.stream(chunk_size, decode_content=True):
File "/srv/errbot/virtualenv/lib/python3.4/site-packages/requests/packages/urllib3/response.py", line 340, in stream
for line in self.read_chunked(amt, decode_content=decode_content):
File "/srv/errbot/virtualenv/lib/python3.4/site-packages/requests/packages/urllib3/response.py", line 514, in read_chunked
self._original_response.close()
File "/usr/lib/python3.4/contextlib.py", line 77, in __exit__
self.gen.throw(type, value, traceback)
File "/srv/errbot/virtualenv/lib/python3.4/site-packages/requests/packages/urllib3/response.py", line 244, in _error_catcher
raise ProtocolError('Connection broken: %r' % e, e)
requests.packages.urllib3.exceptions.ProtocolError: ('Connection broken: IncompleteRead(0 bytes read)', IncompleteRead(0 bytes read))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.4/threading.py", line 920, in _bootstrap_inner
self.run()
File "/usr/lib/python3.4/threading.py", line 868, in run
self._target(*self._args, **self._kwargs)
File "/srv/errbot/extra_backends/err-backend-gitter/gitter.py", line 256, in background
for line in r.iter_lines(chunk_size=1): # it fails with anything else than 1.
File "/srv/errbot/virtualenv/lib/python3.4/site-packages/requests/models.py", line 702, in iter_lines
for chunk in self.iter_content(chunk_size=chunk_size, decode_unicode=decode_unicode):
File "/srv/errbot/virtualenv/lib/python3.4/site-packages/requests/models.py", line 663, in generate
raise ChunkedEncodingError(e)
requests.exceptions.ChunkedEncodingError: ('Connection broken: IncompleteRead(0 bytes read)', IncompleteRead(0 bytes read))
Exception in thread Thread-18:
Traceback (most recent call last):
File "/srv/errbot/virtualenv/lib/python3.4/site-packages/requests/packages/urllib3/response.py", line 435, in _update_chunk_length
self.chunk_left = int(line, 16)
ValueError: invalid literal for int() with base 16: b''
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/srv/errbot/virtualenv/lib/python3.4/site-packages/requests/packages/urllib3/response.py", line 226, in _error_catcher
yield
File "/srv/errbot/virtualenv/lib/python3.4/site-packages/requests/packages/urllib3/response.py", line 486, in read_chunked
self._update_chunk_length()
File "/srv/errbot/virtualenv/lib/python3.4/site-packages/requests/packages/urllib3/response.py", line 439, in _update_chunk_length
raise httplib.IncompleteRead(line)
http.client.IncompleteRead: IncompleteRead(0 bytes read)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/srv/errbot/virtualenv/lib/python3.4/site-packages/requests/models.py", line 660, in generate
for chunk in self.raw.stream(chunk_size, decode_content=True):
File "/srv/errbot/virtualenv/lib/python3.4/site-packages/requests/packages/urllib3/response.py", line 340, in stream
for line in self.read_chunked(amt, decode_content=decode_content):
File "/srv/errbot/virtualenv/lib/python3.4/site-packages/requests/packages/urllib3/response.py", line 514, in read_chunked
self._original_response.close()
File "/usr/lib/python3.4/contextlib.py", line 77, in __exit__
self.gen.throw(type, value, traceback)
File "/srv/errbot/virtualenv/lib/python3.4/site-packages/requests/packages/urllib3/response.py", line 244, in _error_catcher
raise ProtocolError('Connection broken: %r' % e, e)
requests.packages.urllib3.exceptions.ProtocolError: ('Connection broken: IncompleteRead(0 bytes read)', IncompleteRead(0 bytes read))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.4/threading.py", line 920, in _bootstrap_inner
self.run()
File "/usr/lib/python3.4/threading.py", line 868, in run
self._target(*self._args, **self._kwargs)
File "/srv/errbot/extra_backends/err-backend-gitter/gitter.py", line 256, in background
for line in r.iter_lines(chunk_size=1): # it fails with anything else than 1.
File "/srv/errbot/virtualenv/lib/python3.4/site-packages/requests/models.py", line 702, in iter_lines
for chunk in self.iter_content(chunk_size=chunk_size, decode_unicode=decode_unicode):
File "/srv/errbot/virtualenv/lib/python3.4/site-packages/requests/models.py", line 663, in generate
raise ChunkedEncodingError(e)
requests.exceptions.ChunkedEncodingError: ('Connection broken: IncompleteRead(0 bytes read)', IncompleteRead(0 bytes read))
2016-03-01 16:21:22,951 DEBUG errbot.backends.gitter keep alive
2016-03-01 16:21:24,771 DEBUG errbot.backends.gitter keep alive
2016-03-01 16:21:26,834 DEBUG errbot.backends.gitter keep alive
2016-03-01 16:21:26,872 DEBUG errbot.backends.gitter keep alive
2016-03-01 16:21:26,873 DEBUG errbot.backends.gitter keep alive
2016-03-01 16:21:26,977 DEBUG errbot.backends.gitter keep alive
2016-03-01 16:21:52,952 DEBUG errbot.backends.gitter keep alive
In the following code:
json_users = self._backend.readAPIRequest('rooms/%s/users' % self._idd)
The limit parameter is not passed which defaults to 30. Hence every time it will only return a list of 30 users but since we need a list of all users a suitable value of limit must be passed to the request.
oauth.py went fine. App creation at Gitter, too.
However, I end up with a strange account at Github (with the name of the app) "Signed in as nicolas33", my usual nick.
When playing with the bot with my user account at Gitter, the bot won't respond and refuses to respond to self.
Errbot thinks that private chats are groupchats, which makes plugin configuration impossible.
This is errbotio/errbot#446
It seems like errbot.backends.base.Message
doesn't have a setter for extras
property. The backend is completely broken now. I am writing a hot fix asap. We will then create the setter
after some discussion with the community 👍
Commands listed in DIVERT_TO_PRIVATE
throw an exception when being issued to the bot:
2016-02-28 17:43:19,153 DEBUG yapsy_loaded_plugin_Gitter_0 POST url= https://api.gitter.im/v1/rooms/529c6c56ed5ab0b3bf04d8ae/chatMessage, data = {"text": "## Yes I am alive...\n\n\n\n### Plugins\n\nStatus | Name \n------- | ----------------------- \n**A** | ACLs\n**A** | Backup\n**A** | ChatRoom\n**A** | Health\n**A** | Help\n**A** | Plugins\n**A** | Utils\n**A** | VersionChecker\n**A** | Webserver\n\n\n**A** = Activated, **D** = Deactivated, **B** = Blacklisted, **C** = Needs to be configured\n\nLoad 0.0, 0.01, 0.05\nGC 0->386 1->5 2->2"}
2016-02-28 17:43:19,155 INFO requests.packages.urllib3.connectionpool Starting new HTTPS connection (1): api.gitter.im
2016-02-28 17:43:19,559 DEBUG requests.packages.urllib3.connectionpool "POST /v1/rooms/529c6c56ed5ab0b3bf04d8ae/chatMessage HTTP/1.1" 404 85
2016-02-28 17:43:19,562 ERROR errbot.errBot An error happened while processing a message ("!status"): Traceback (most recent call last):
File "/srv/errbot/virtualenv/lib/python3.4/site-packages/errbot/errBot.py", line 462, in _execute_and_send
self.send_simple_reply(mess, self.process_template(template_name, reply), private)
File "/srv/errbot/virtualenv/lib/python3.4/site-packages/errbot/errBot.py", line 214, in send_simple_reply
self.split_and_send_message(self.build_reply(mess, text, private))
File "/srv/errbot/virtualenv/lib/python3.4/site-packages/errbot/errBot.py", line 193, in split_and_send_message
self.send_message(partial_message)
File "/srv/errbot/extra_backends/err-backend-gitter/gitter.py", line 306, in send_message
self.writeAPIRequest('rooms/%s/chatMessage' % mess.to.idd, content)
File "/srv/errbot/extra_backends/err-backend-gitter/gitter.py", line 231, in writeAPIRequest
raise Exception("Server returned an error %d:%s" % (r.status_code, r.text))
Exception: Server returned an error 404:Cannot POST /v1/rooms/529c6c56ed5ab0b3bf04d8ae/chatMessage
"
Traceback (most recent call last):
File "/srv/errbot/virtualenv/lib/python3.4/site-packages/errbot/errBot.py", line 462, in _execute_and_send
self.send_simple_reply(mess, self.process_template(template_name, reply), private)
File "/srv/errbot/virtualenv/lib/python3.4/site-packages/errbot/errBot.py", line 214, in send_simple_reply
self.split_and_send_message(self.build_reply(mess, text, private))
File "/srv/errbot/virtualenv/lib/python3.4/site-packages/errbot/errBot.py", line 193, in split_and_send_message
self.send_message(partial_message)
File "/srv/errbot/extra_backends/err-backend-gitter/gitter.py", line 306, in send_message
self.writeAPIRequest('rooms/%s/chatMessage' % mess.to.idd, content)
File "/srv/errbot/extra_backends/err-backend-gitter/gitter.py", line 231, in writeAPIRequest
raise Exception("Server returned an error %d:%s" % (r.status_code, r.text))
Exception: Server returned an error 404:Cannot POST /v1/rooms/529c6c56ed5ab0b3bf04d8ae/chatMessage
2016-02-28 17:43:19,563 DEBUG yapsy_loaded_plugin_Gitter_0 bf body = Computer says nooo. See logs for details:
Server returned an error 404:Cannot POST /v1/rooms/529c6c56ed5ab0b3bf04d8ae/chatMessage
2016-02-28 17:43:19,567 DEBUG yapsy_loaded_plugin_Gitter_0 af body = Computer says nooo. See logs for details:
Server returned an error 404:Cannot POST /v1/rooms/529c6c56ed5ab0b3bf04d8ae/chatMessage
2016-02-28 17:43:19,568 DEBUG yapsy_loaded_plugin_Gitter_0 POST url= https://api.gitter.im/v1/rooms/529c6c56ed5ab0b3bf04d8ae/chatMessage, data = {"text": "Computer says nooo. See logs for details:\n Server returned an error 404:Cannot POST /v1/rooms/529c6c56ed5ab0b3bf04d8ae/chatMessage\n"}
2016-02-28 17:43:19,569 INFO requests.packages.urllib3.connectionpool Starting new HTTPS connection (1): api.gitter.im
Gitter API seems to have changed to matrix:
From:
https://blog.gitter.im/2023/01/16/gitter-is-going-fully-native-matrix-in-feb-2023/
"Because we will be invalidating all access tokens on Gitter, this means that any bots/scripts that use the Gitter API will stop working. You can prepare for the new Matrix world by adapting your code to use https://spec.matrix.org/latest/client-server-api/. You won’t have access to all of your Gitter data to test against before the cutover but testing against your own Matrix sandbox room should be sufficient for any use case."
Here in
@property
def occupants(self):
occupants = []
json_users = self._backend.readAPIRequest('rooms/%s/users' % self._idd)
print(json_users)
for json_user in json_users:
occupants.append(GitterRoomOccupant.build_from_json(self, json_user['id']))
return occupants
The build_from_json
is passed json_user['id']
while it should have been json_user
itself.
This causes messages to be processed and commands to be executed twice (or more, if it was joined more than twice).
Recently support for threaded messages was added, which broke gitter backend:
File "/home/sub/ghubby/coala/corobo/.env/lib/python3.6/site-packages/errbot/core.py", line 461, in _execute_and_send
self.send_simple_reply(msg, self.process_template(template_name, reply), private, threaded)
File "/home/sub/ghubby/coala/corobo/.env/lib/python3.6/site-packages/errbot/core.py", line 198, in send_simple_reply
reply = self.build_reply(msg, text, private=private, threaded=threaded)
TypeError: build_reply() got an unexpected keyword argument 'threaded'
threaded=False
has to be added build_reply
Currently rooms
function queries the endpoint without any params, which returns the rooms that the bot has already joined. This is not particularly useful when !room join
command is used to join a new room that the bot hasn't joined already.
The endpoint can be passed a query_parameter q
, then it can return rooms that the bot hasn't joined as well
Similar in scope to #6, the bot isn't able to pick up on the fact that is has lost network connectivity to Gitter and silently stops receiving any messages.
Users have reported that errbot does not properly detect messages coming from the bot itself with this backend.
(Specifically, !echo !echo foo
would loop indefinitely - it's supposed to print one time but otherwise ignore it).
The exception is as follows:
3:06:47 ERROR errbot.main Unable to configure the backend, please check if your config.py is correct.
err/errbot/backend_manager.py", line 87, in get_backend_by_name
raise Exception("Could not find the backend '%s'." % name)
Exception: Could not find the backend 'Gitter'.
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.