Remove triage_message() function from all the contrib-bots.
To make all bots consistent add shared function in bot_lib.py to check if this bot is called. All bots respond to at-mention of the bot instead of their specific names.
This commit is contained in:
parent
a87ae4b1c4
commit
9a8dc7c622
18 changed files with 134 additions and 281 deletions
|
@ -7,19 +7,8 @@ class VirtualFsHandler(object):
|
|||
def usage(self):
|
||||
return get_help()
|
||||
|
||||
def triage_message(self, message, client):
|
||||
if message['type'] != 'stream':
|
||||
return False
|
||||
|
||||
original_content = message['content']
|
||||
return (original_content.startswith('fs ') or
|
||||
original_content.startswith('@fs '))
|
||||
|
||||
def handle_message(self, message, client, state_handler):
|
||||
assert self.triage_message(message, client)
|
||||
|
||||
original_content = message['content']
|
||||
command = original_content[len('fs '):]
|
||||
command = message['content']
|
||||
stream = message['display_recipient']
|
||||
topic = message['subject']
|
||||
sender = message['sender_email']
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue