aboutsummaryrefslogtreecommitdiffstats
path: root/warmachine/connections/slack.py
diff options
context:
space:
mode:
Diffstat (limited to 'warmachine/connections/slack.py')
-rw-r--r--warmachine/connections/slack.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/warmachine/connections/slack.py b/warmachine/connections/slack.py
index 10b6354..938c541 100644
--- a/warmachine/connections/slack.py
+++ b/warmachine/connections/slack.py
@@ -107,8 +107,12 @@ class SlackWS(Connection):
107 else: 107 else:
108 _user = self.user_nick_to_id[destination] 108 _user = self.user_nick_to_id[destination]
109 109
110 if 'is_bot' not in self.user_map[_user]:
111 self.error('is_bot property not found for user {}'.format(
112 message['destination']))
113
110 # slack doesn't allow bots to message other bots 114 # slack doesn't allow bots to message other bots
111 if self.user_map[_user]['is_bot']: 115 if '#' not in destination and self.user_map[_user]['is_bot']:
112 return 116 return
113 117
114 destination = self.get_dm_id_by_user(_user) 118 destination = self.get_dm_id_by_user(_user)
@@ -191,7 +195,7 @@ class SlackWS(Connection):
191 195
192 async def process_message(self, msg): 196 async def process_message(self, msg):
193 if 'text' not in msg: 197 if 'text' not in msg:
194 raise Exception(msg) 198 self.log.error('key "text" not found in message: {}'.format(msg))
195 199
196 # Built-in !whois command. Return information about a particular user. 200 # Built-in !whois command. Return information about a particular user.
197 if msg['text'].startswith('!whois'): 201 if msg['text'].startswith('!whois'):