diff options
author | Tollef Fog Heen <tfheen@err.no> | 2017-08-17 21:39:07 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-17 21:39:07 +0200 |
commit | 54120cfc59228557f7c1e1d8cf19509797d1a48c (patch) | |
tree | d616755be51f2ab7138b18f32bbffeccbf23d91a | |
parent | 42b77460e3645cbec29cf146ed9eebced7bb6a59 (diff) | |
parent | eed7e04384a186562235dcfa59f739d106d9592e (diff) | |
download | wee-slack-54120cfc59228557f7c1e1d8cf19509797d1a48c.tar.gz |
Merge pull request #423 from trygveaa/ignore-unknown-bot-ids
Check that the bot_id exists before using it
-rw-r--r-- | wee_slack.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/wee_slack.py b/wee_slack.py index 019ba5f..1c4ec45 100644 --- a/wee_slack.py +++ b/wee_slack.py @@ -1911,7 +1911,7 @@ class SlackMessage(object): def get_sender(self): name = "" name_plain = "" - if 'bot_id' in self.message_json and self.message_json['bot_id'] is not None: + if self.message_json.get('bot_id') in self.team.bots: name = "{} :]".format(self.team.bots[self.message_json["bot_id"]].formatted_name()) name_plain = "{}".format(self.team.bots[self.message_json["bot_id"]].formatted_name(enable_color=False)) elif 'user' in self.message_json: |