Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

archived messages are posted from user who installed destalinator #166

Open
ahalasz opened this issue Dec 13, 2017 · 3 comments
Open

archived messages are posted from user who installed destalinator #166

ahalasz opened this issue Dec 13, 2017 · 3 comments

Comments

@ahalasz
Copy link

ahalasz commented Dec 13, 2017

Hi,

I installed destalinator using the docker image and I noticed that, when a channel is archived, the corresponding message does not come from destalinator but from my user.
The warning messages come, as desired, from destalinator and the messages for the new channels created come from slackbot.

I tried to make the archiving messages come from destalinator as well by adding this bot to my Slack app and using the bot's API TOKEN. However, when I do so, running warner.py will give the following error:

# ./warner.py 2017-12-13 09:59:34,277 [DEBUG]: activated is TRUE 2017-12-13 09:59:34,285 [INFO]: Starting new HTTPS connection (1): slacktest.slack.com 2017-12-13 09:59:34,418 [DEBUG]: "GET /api/users.list?token=xoxb-285445889489-DnuE3IcKoJ0Y7qaANRkNtak9 HTTP/1.1" 200 1466 2017-12-13 09:59:34,420 [DEBUG]: All restricted user names: 2017-12-13 09:59:34,488 [DEBUG]: "GET /api/channels.list?exclude_archived=1&token=xoxb-285445889489-DnuE3IcKoJ0Y7qaANRkNtak9 HTTP/1.1" 200 711 2017-12-13 09:59:34,490 [DEBUG]: activated is TRUE 2017-12-13 09:59:34,492 [INFO]: Warning 2017-12-13 09:59:34,492 [INFO]: *ACTION: Warning all channels stale for more than 30 days* 2017-12-13 09:59:34,492 [DEBUG]: Not warning #destalinator-log because it's in ignore_channels 2017-12-13 09:59:34,562 [DEBUG]: "GET /api/channels.info?token=xoxb-285445889489-DnuE3IcKoJ0Y7qaANRkNtak9&channel=C1EA01JR1 HTTP/1.1" 200 335 2017-12-13 09:59:34,637 [DEBUG]: "GET /api/channels.info?token=xoxb-285445889489-DnuE3IcKoJ0Y7qaANRkNtak9&channel=C1EA01JR1 HTTP/1.1" 200 335 2017-12-13 09:59:34,638 [DEBUG]: Current members in general are set([u'U5FFN9XPA', u'U1EA01HH9']) 2017-12-13 09:59:34,696 [DEBUG]: "GET /api/channels.history?oldest=1510567174&token=xoxb-285445889489-DnuE3IcKoJ0Y7qaANRkNtak9&channel=C1EA01JR1&latest=1513159174 HTTP/1.1" 200 99 Traceback (most recent call last): File "./warner.py", line 18, in <module> Warner().warn(force_warn=force_warn) File "./warner.py", line 11, in warn self.ds.warn_all(self.config.warn_threshold, force_warn) File "/destalinator/destalinator.py", line 234, in warn_all if self.stale(channel, days): File "/destalinator/destalinator.py", line 121, in stale messages = self.get_messages(channel_name, days) File "/destalinator/destalinator.py", line 83, in get_messages messages = self.slacker.get_messages_in_time_range(oldest, cid) File "/destalinator/slacker.py", line 91, in get_messages_in_time_range messages += payload['messages'] KeyError: 'messages'

@kmarekspartz
Copy link
Contributor

kmarekspartz commented Dec 13, 2017 via email

@ahalasz
Copy link
Author

ahalasz commented Dec 13, 2017

Thanks, so if I understand correctly I cannot do anything about this for the moment right?

Andrei

@kmarekspartz
Copy link
Contributor

Not with the current code, no, but looking into the Slack APIs and the code may lead to a way to fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants