You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The existing cooldown system tracks usage per sender (ctx.sender is the dict key in cooldown_calls). There is no way to apply a cooldown per room or globally across all users, which are common requirements for rate-limiting or noisy commands.
The idea is to add a BucketType that controls what the cooldown key is derived from. Per-user is the current behaviour and remains the default; per-room keys on ctx.room.room_id.
The change is localised to Command.set_cooldown in command.py, the user_id = ctx.sender line becomes a key derivation step based on the bucket type. BucketType can be a simple enum.Enum. The cooldown decorator in checks.py needs the extra parameter forwarded through; with default being global.. No structural changes to Command or Registry are needed beyond that.
Activity