GregHilston / Simple-Slack-Bot

Simple Python library for creating Slack bots.
https://greghilston.github.io/Simple-Slack-Bot/
MIT License
24 stars 9 forks source link

Seems there are cases where text is not passed as part of the dictionary #19

Closed ramast closed 6 years ago

ramast commented 7 years ago

2017-01-31 07:08:17,646 - INFO - private_channels {u'ok': True, u'groups': []} 2017-01-31 07:08:17,646 - WARNING - got no private channel ids Traceback (most recent call last): File "app.py", line 21, in main() File "app.py", line 17, in main simple_slack_bot.start() File "/home/user/simple_slack_bot/simple_slack_bot.py", line 112, in start self.listen() File "/home/user/simple_slack_bot/simple_slack_bot.py", line 168, in listen self.route_dictionary_to_notify(dictionary) File "/home/user/simple_slack_bot/simple_slack_bot.py", line 133, in route_dictionary_to_notify self._logger.debug("printing user_name_mentions {} printing dictionary[\"text\"] {}".format(self._user_name_mentions, dictionary["text"])) KeyError: 'text'

GregHilston commented 7 years ago

Interesting! I'll take a look at this tonight and see if I can get this resolved!

ramast commented 7 years ago

The bug is very easy to reproduce. Just run the server, send the bot a private message then delete it

GregHilston commented 7 years ago

Thank you for that info, that makes this so much easier to fix. I'm about to sit down and see if I can add in guards to all my code to ensure this doesn't happen

GregHilston commented 6 years ago

I will recheck if this bug is still persistent with the newest rewrite.

GregHilston commented 6 years ago

@ramast Confirmed this is still an issue!

ramast commented 6 years ago

I'l sorry Greg, I've left the company I was doing that work for. I am not actively using slack at the moment :(

If you can't reproduce it I guess u could close the bug report for now, anyone who encounter is will reopen it

GregHilston commented 6 years ago

@ramast Oh no need to apologize, I was just writing that I have can reproduce the error hahah

I was just stoked to see someone else using this :)

ramast commented 6 years ago

Yes, I think it's pretty neat and quiet easy to use. Good job buddy

GregHilston commented 6 years ago

Thanks man! I hope to cross paths with you in the future!

GregHilston commented 6 years ago

This was resolved in v1.1.0

Thanks again for reporting this and apologies for how long it took me to fix this.