aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTollef Fog Heen <tfheen@err.no>2015-12-02 17:51:02 +0100
committerTollef Fog Heen <tfheen@err.no>2015-12-02 17:51:02 +0100
commitf96dd6cbaff5123c7925b29742c61c56b6576586 (patch)
tree6907162b67614b26b565d8876c3ca78c42299a92
parent07cfb9a8d1cb8599bf7048c174f835f215eeda83 (diff)
downloadwee-slack-f96dd6cbaff5123c7925b29742c61c56b6576586.tar.gz
Format fix for file upload and similar
File uploads have bot_id in the json structure, but it's null (translated into None). Handle that as if it's not there.
-rw-r--r--wee_slack.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/wee_slack.py b/wee_slack.py
index 338a4fc..8a01ff7 100644
--- a/wee_slack.py
+++ b/wee_slack.py
@@ -1688,7 +1688,7 @@ def unfurl_refs(text, ignore_alt_text=False):
def get_user(message_json, server):
- if 'bot_id' in message_json:
+ if 'bot_id' in message_json and message_json['bot_id'] is not None:
name = u"{} :]".format(server.bots.find(message_json["bot_id"]).formatted_name())
elif 'user' in message_json:
name = server.users.find(message_json['user']).name