diff options
author | Trygve Aaberge <trygveaa@gmail.com> | 2017-08-17 01:33:54 +0200 |
---|---|---|
committer | Trygve Aaberge <trygveaa@gmail.com> | 2017-08-17 21:33:42 +0200 |
commit | eed7e04384a186562235dcfa59f739d106d9592e (patch) | |
tree | d616755be51f2ab7138b18f32bbffeccbf23d91a /_pytest | |
parent | 42b77460e3645cbec29cf146ed9eebced7bb6a59 (diff) | |
download | wee-slack-eed7e04384a186562235dcfa59f739d106d9592e.tar.gz |
Check that the bot_id exists before using it
Instead of just checking that bot_id is not None, check that it exists
in the list of bots. This prevents a KeyError when trying to access a
bot that doesn't exist in the list.
This KeyError would happen if you use a reminder. The message from
slackbot then has bot_id B01 which is not in the list of bots from
rtm.start and gives bot_not_found if trying to look it up with the
bots.info API endpoint.
By ignoring the bot_id we fall back to the user/username, which in the
case of reminders is slackbot, so the name appears just as the other
messages from slackbot.
Fixes #420
Diffstat (limited to '_pytest')
0 files changed, 0 insertions, 0 deletions