sharkbound / PythonTwitchBotFramework

asynchronous twitchbot framework made in pure python
MIT License
100 stars 26 forks source link

fix CooldownManager.on_cooldown for uninitialized keys #55

Closed electronicgore closed 1 year ago

electronicgore commented 1 year ago

If CooldownManager.on_cooldown encounters a key that is not registered, then elapsed_seconds returns 0, which is interpreted as 'the command was just run', meaning that the command is always on cooldown. This commit changes behavior of on_cooldown so that it returns False for uninitialized keys (so that they can actually be initialized once the command is run and put on cooldown).