dgw / sopel-duel

Clone of a mIRC script that lets users duel each other
1 stars 1 forks source link

Ignore channel's last duel time in .dueloff #37

Closed dgw closed 7 years ago

dgw commented 7 years ago

The time_since_duel() check in exclude() (the .dueloff command handler) is meant to check the user's last duel only. But if the channel in which it is called is set to use the channel-wide timer instead, .dueloff will incorrectly refuse to turn off duels for any user, even if they have not recently initiated a duel.

exclude() needs time_since_duel() to have an optional kwarg specifying that it should use only the user's last action to calculate the returned value, and ignore the channel's last duel time.