Commit 3e6e01bf authored by Guillaume Binet's avatar Guillaume Binet Committed by GitHub

callback all unknown commands filters. (#1005)

* fixes #1004 and #1000

The bot wwas quitting if a command filter was not implemented correctly
and was stopping at the first unknown_command, this makes Errbot
continue through all the callbacks.

* comment
parent e1ac52a7
......@@ -328,10 +328,13 @@ class ErrBot(Backend, StoreMixin):
log.debug("Command not found")
for cmd_filter in self.command_filters:
if getattr(cmd_filter, 'catch_unprocessed', False):
reply = cmd_filter(mess, cmd, args, False, emptycmd=True)
if reply:
self.send_simple_reply(mess, reply)
return True
try:
reply = cmd_filter(mess, cmd, args, False, emptycmd=True)
if reply:
self.send_simple_reply(mess, reply)
# continue processing the other unprocessed cmd filters.
except Exception:
log.exception("Exception in a command filter command.")
return True
def _process_command_filters(self, msg, cmd, args, dry_run=False):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment