flybywiresim / discord-bot

This is the repository for the FlyByWire Simulations Discord bot
https://flybywiresim.com
GNU Affero General Public License v3.0
17 stars 35 forks source link

Support configurable command rate limiting #401

Open pdellaert opened 1 year ago

pdellaert commented 1 year ago

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:

References (optional)

No response

Additional info (optional)

No response

Discord Username (optional)

straks#7240

benw202 commented 1 year ago

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

pdellaert commented 1 year ago

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.

benw202 commented 1 year ago

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

pdellaert commented 1 year ago

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).

NathanInnes commented 1 year ago

Why ratelimit the commands?

pdellaert commented 1 year ago

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)