Skip to content

Commit

Permalink
iftttで反応できるようにする
Browse files Browse the repository at this point in the history
  • Loading branch information
amane3 committed Aug 24, 2019
1 parent 7195d46 commit 028bd00
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 'attachments' in msg and len(msg.get('attachments')) > 0:
text = msg['attachments'][0].get('pretext', None)
elif 'text' in msg:
text = msg.get('text', None)

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

0 comments on commit 028bd00

Please sign in to comment.