dgw / sopel-BombBot

Customized version of a custom version of a bomb module for Sopel
2 stars 1 forks source link

Shenanigans when bomb explodes while user is out of channel #46

Closed dgw closed 6 years ago

dgw commented 6 years ago

Scenario

Result

Bomb explosion exits early, before printing the "BOOM" message or (attempting to) kick User B. Future attempts to bomb User B will fail until the bot is restarted or the module is reloaded. (The bot thinks there is already a bomb on User B.)

Expectation

The bomb explodes anyway, and User B's bomb state is cleared.

dgw commented 6 years ago

This is happening because of a KeyError in the routine to check which explode method the bot should use (kick or just say "boom"). kicking_available() just assumes that all users will be in the channel when it runs, which is obviously not a safe assumption.