Skip to content

Commit

Permalink
feat: compatible with IFTTT format
Browse files Browse the repository at this point in the history
  • Loading branch information
yakan10 committed Jan 19, 2019
1 parent c677b4c commit 013d20a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion slackbot/dispatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,13 @@ def dispatch_msg(self, msg):

def _dispatch_msg_handler(self, category, msg):
responded = False
for func, args in self._plugins.get_plugins(category, msg.get('text', None)):
text = None
if 'text' in msg:
text = msg.get('text', None)
elif 'attachments' in msg and len(msg.get('attachments')) > 0:
text = msg['attachments'][0].get('pretext', None)

for func, args in self._plugins.get_plugins(category, text):
if func:
responded = True
try:
Expand Down

0 comments on commit 013d20a

Please sign in to comment.