Description
Supersedes #3325.
This issue is for the addition of a new argument to the !slowmode set
command to have the bot time out slowmodes.
Proposed syntax: !slowmode set [channel] <delay> <duration>
Example use: !slowmode set #python-discussion 10s 30m
After expiration the slowmode should probably restore to whatever the previous value is, that way Moderators can still set a permanent value and have that be preserved (i.e. temporarily have a 10s slowmode before reverting to 2s after 2 hours).
We should persist this in Redis as it is non-critical if this information gets lost but will continue across reboots. This can likely be integrated with the existing scheduler.
Activity
Rudransh-K999 commentedon May 19, 2025
yo
b0nes1 commentedon Jun 1, 2025
Hey I'm looking to tackle this one but just wanted to run through the implementation.
I'm not super familiar with redis but here's my understanding of approximately what needs to happen.
Scheduled tasks don't persist bot reboot, so when the cog is loaded it should load redis cache and check if there are active slowmodes for which a task to remove them needs to be created (for the time remaining), or if there are any slowmodes active which have already elapsed and for which the original timeout should be applied.
My proposed solution for when slowmode command with a timeout is sent:
if a moderator changes the slowmode and there is already a slowmode with a timeout counting down, then cancel the task to reapply the original slowmode. Create a new task with the more recent timeout and update redis.