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.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/warmachine/connections/slack.py b/warmachine/connections/slack.py
index 613b15c..2cb230c 100644
--- a/warmachine/connections/slack.py
+++ b/warmachine/connections/slack.py
@@ -44,7 +44,6 @@ class SlackWS(Connection):
44 async def read(self): 44 async def read(self):
45 if self.ws: 45 if self.ws:
46 message = json.loads(await self.ws.recv()) 46 message = json.loads(await self.ws.recv())
47 self.log.debug('new message parsed: {}'.format(message))
48 # Slack is acknowledging a message was sent. Do nothing 47 # Slack is acknowledging a message was sent. Do nothing
49 if 'type' not in message and 'reply_to' in message: 48 if 'type' not in message and 'reply_to' in message:
50 # {'ok': True, 49 # {'ok': True,
@@ -53,8 +52,9 @@ class SlackWS(Connection):
53 # 'ts': '1469743355.000150'} 52 # 'ts': '1469743355.000150'}
54 return 53 return
55 54
55 self.log.debug('new message parsed: {}'.format(message))
56 # Handle actual messages 56 # Handle actual messages
57 elif message['type'] == 'message' and 'subtype' not in message: 57 if message['type'] == 'message' and 'subtype' not in message:
58 return await self.process_message(message) 58 return await self.process_message(message)
59 else: 59 else:
60 if 'subtype' in message: 60 if 'subtype' in message:
@@ -163,6 +163,8 @@ class SlackWS(Connection):
163 await self.say(pformat(self.user_map[self.user_nick_to_id[n]]), 163 await self.say(pformat(self.user_map[self.user_nick_to_id[n]]),
164 msg['channel']) 164 msg['channel'])
165 return 165 return
166 elif msg['text'].startswith('!looptime'):
167 await self.say(self._loop.time(), msg['channel'])
166 168
167 retval = { 169 retval = {
168 'sender': msg['user'], 170 'sender': msg['user'],