-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add slowmode command #8
base: master
Are you sure you want to change the base?
Conversation
Two things:
Edit: I haven't written commit guidelines for this repo, but the commit title format here generally is |
2262eaa
to
a07176b
Compare
Done. Do we need any sanity checks on the seconds parameter? Like clamping the seconds at the max possible value (21600) or making sure the parameter is actually an int? I forget if Python will handle the latter automatically. |
Well, it seems we should definitely either clamp |
As a note (because flake8 is going to complain about this), there should be a space between the assignment operator in the parameters, e.g. |
I'll rebase shortly. Was working on the clamping/error-handling code to prevent exceptions. Thoughts on that, by the way? |
Not many, ideally just respond with an error if anything fails. |
I can either clamp:
Or just return error messages. I'm fine with either. I think I prefer clamping, because if a channel is being flooded, you might not notice the error message. |
cf05b04
to
9ddda16
Compare
Oh yeah, also use |
9ddda16
to
322f4b9
Compare
Done. |
In its current form, this clamps negative int parameters to 0, and clamps anything higher than 21600 to 21600. If a user specifies a non-integer to the command, it will result in this exception:
This appears like we would need to handle it in main.py in |
Silent ignore is fine, |
Add the ability to edit a channel's slowmode delay.
322f4b9
to
7f5f5a5
Compare
Done. This should address all current feedback. |
Description
Add the ability to edit a channel's Slowmode delay.
Note: This requires the bot to have the "Manage Channels" permission on the server.
This uses the Discord Slowmode setting for a channel. This setting is enforced per-user per-channel according to how the Dyno documentation describes Discord's Slowmode:
References:
Thoughts for the future:
Motivation and Context
Give us another tool to use to quickly address mass flooding/spam without relying only on Dyno Premium (or Dyno itself) or having to hand out the Manage Channel permission to bot admins or whoever else should have access to this feature.
How Has This Been Tested?
Tested on a test server with a locally hosted build of the bot.
Types of changes
Checklist: