discord-bot icon indicating copy to clipboard operation
discord-bot copied to clipboard

Support configurable command rate limiting

Open pdellaert opened this issue 2 years ago • 6 comments

Feature type

Utility or complex functionality

Description

Some commands get flooded by users in certain situations, it could be useful to have a rate limiter implemented that prevents a command from being used too often within a single channel.

Proposal for the feature is:

  • Support rate limiting a command (based on time: set to a certain time interval, a command can only be used once within the time interval)
  • Introduce mod command to manage (set, unset) a rate limit for a command, can be any command (automatically matches the aliased)
  • Mod commands should be blocked from rate limiting

References (optional)

No response

Additional info (optional)

No response

Discord Username (optional)

straks#7240

pdellaert avatar Jan 18 '23 00:01 pdellaert

Is this looking to rate limit individual commands rather than a blanket rate limit?

benw202 avatar Jan 20 '23 19:01 benw202

Is this looking to rate limit individual commands rather than a blanket rate limit?

Yeah, idea is to have .ratelimit when 10s and it rate limits the .when command. The only question I have if it is server-wide, or if we want to be able to say it's just for a specific channel.

I feel like per channel is a fair amount of work to maintain, but server wide might be very restrictive.

pdellaert avatar Jan 20 '23 20:01 pdellaert

Is this looking to rate limit individual commands rather than a blanket rate limit?

Yeah, idea is to have .ratelimit when 10s and it rate limits the .when command. The only question I have if it is server-wide, or if we want to be able to say it's just for a specific channel.

I feel like per channel is a fair amount of work to maintain, but server wide might be very restrictive.

Hmm yeah, there will be pros and cons to both. Probably worth a discussion in #moderation or with @CS

benw202 avatar Jan 21 '23 11:01 benw202

Is this looking to rate limit individual commands rather than a blanket rate limit?

Yeah, idea is to have .ratelimit when 10s and it rate limits the .when command. The only question I have if it is server-wide, or if we want to be able to say it's just for a specific channel. I feel like per channel is a fair amount of work to maintain, but server wide might be very restrictive.

Hmm yeah, there will be pros and cons to both. Probably worth a discussion in #moderation or with @CS

Or we make it two commands .ratelimit, which is global; and .channelratelimit which is local to the channel. If there's a local rate limit, then it takes precedence over the global one (it overwrites it for the specific channel).

pdellaert avatar Jan 21 '23 15:01 pdellaert

Why ratelimit the commands?

NathanInnes avatar Feb 14 '23 06:02 NathanInnes

It's a request to prevent spams like .when in chat. This command would set a temporary rate limit on a specific command. Details TBD. I propose it is tracked per channel, but can be set as a global rule, or a channel specific rule (globally set to 10s == each channel can have the command once every 10 seconds; channel specific rule only applies to that channel)

pdellaert avatar Feb 14 '23 07:02 pdellaert