diff options
| author | jason | 2016-12-15 16:42:57 -0700 |
|---|---|---|
| committer | jason | 2016-12-15 16:42:57 -0700 |
| commit | 2d87bd8b4e455b1f50e54820952928d766079463 (patch) | |
| tree | 3ab4dca637a259756061e8232bf17f03e14fc331 | |
| parent | 04d0c39881dbdd6e9a53435a0ee9aa831716427c (diff) | |
| download | warmachine-ng-2d87bd8b4e455b1f50e54820952928d766079463.tar.gz warmachine-ng-2d87bd8b4e455b1f50e54820952928d766079463.zip | |
Make sure the next standup is scheduled
| -rwxr-xr-x[-rw-r--r--] | warmachine/addons/standup.py | 8 | ||||
| -rwxr-xr-x[-rw-r--r--] | warmachine/connections/slack.py | 5 |
2 files changed, 10 insertions, 3 deletions
diff --git a/warmachine/addons/standup.py b/warmachine/addons/standup.py index adb7694..21d05e2 100644..100755 --- a/warmachine/addons/standup.py +++ b/warmachine/addons/standup.py | |||
| @@ -330,9 +330,9 @@ class StandUpPlugin(WarMachinePlugin): | |||
| 330 | else: | 330 | else: |
| 331 | await self.standup_priv_msg(connection, u, channel) | 331 | await self.standup_priv_msg(connection, u, channel) |
| 332 | 332 | ||
| 333 | # schedule a function to run in 12 hours to clear out this channel from | 333 | # schedule a function to run in 8 hours to clear out this channel from |
| 334 | # self.users_awaiting_reply for all `users`. | 334 | # self.users_awaiting_reply for all `users`. |
| 335 | # This is assuming that after 12 hours, nobody cares about the report | 335 | # This is assuming that after the hours, nobody cares about the report |
| 336 | # from people who never reported earlier. It will prevent flooding | 336 | # from people who never reported earlier. It will prevent flooding |
| 337 | # "tomorrow's" response to channels whose standup is scheduled for | 337 | # "tomorrow's" response to channels whose standup is scheduled for |
| 338 | # later. | 338 | # later. |
| @@ -340,6 +340,10 @@ class StandUpPlugin(WarMachinePlugin): | |||
| 340 | self.clean_channel_from_waiting_replies, channel, | 340 | self.clean_channel_from_waiting_replies, channel, |
| 341 | users) | 341 | users) |
| 342 | 342 | ||
| 343 | # Schedule the next standup | ||
| 344 | self.schedule_standup( | ||
| 345 | connection, channel, self.standup_schedules[channel]['time24h']) | ||
| 346 | |||
| 343 | 347 | ||
| 344 | async def standup_priv_msg(self, connection, user, channel, pester=600, | 348 | async def standup_priv_msg(self, connection, user, channel, pester=600, |
| 345 | pester_count=0): | 349 | pester_count=0): |
diff --git a/warmachine/connections/slack.py b/warmachine/connections/slack.py index 684aea3..7585c74 100644..100755 --- a/warmachine/connections/slack.py +++ b/warmachine/connections/slack.py | |||
| @@ -32,6 +32,9 @@ class SlackWS(Connection): | |||
| 32 | self.user_map = {} # user info keyed by their slack id | 32 | self.user_map = {} # user info keyed by their slack id |
| 33 | self.user_nick_to_id = {} # slack user id mapped to the (nick)name | 33 | self.user_nick_to_id = {} # slack user id mapped to the (nick)name |
| 34 | 34 | ||
| 35 | #: The nickname of the bot | ||
| 36 | self.nick = '' | ||
| 37 | #: The slack id for the bot | ||
| 35 | self.my_id = '000' | 38 | self.my_id = '000' |
| 36 | 39 | ||
| 37 | self.ws = None | 40 | self.ws = None |
| @@ -64,7 +67,7 @@ class SlackWS(Connection): | |||
| 64 | return True | 67 | return True |
| 65 | 68 | ||
| 66 | def on_hello(self, msg): | 69 | def on_hello(self, msg): |
| 67 | self.log.info('Connected to Slack') | 70 | self.log.info('Connected to Slack as {}'.format(self.nick)) |
| 68 | self.STATUS = CONNECTED | 71 | self.STATUS = CONNECTED |
| 69 | self.start_ping() | 72 | self.start_ping() |
| 70 | 73 | ||