diff options
| author | jason | 2016-08-10 17:27:56 -0600 |
|---|---|---|
| committer | jason | 2016-08-10 17:27:56 -0600 |
| commit | 1c4f034b5d66f422f6891d318ebf95abd82a5c53 (patch) | |
| tree | 8031c5677a90df61703966f91ad42d53c2e360b9 /warmachine/connections/slack.py | |
| parent | 4c618df245d179d97da440520b94ae4d11a1e681 (diff) | |
| download | warmachine-ng-1c4f034b5d66f422f6891d318ebf95abd82a5c53.tar.gz warmachine-ng-1c4f034b5d66f422f6891d318ebf95abd82a5c53.zip | |
add debug commands, schedule for the closest weekday at the provided time
Diffstat (limited to 'warmachine/connections/slack.py')
| -rw-r--r-- | warmachine/connections/slack.py | 6 |
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'], |