Skip to content
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

Command rate limiting #7

Closed
Southclaws opened this issue Feb 27, 2017 · 0 comments
Closed

Command rate limiting #7

Southclaws opened this issue Feb 27, 2017 · 0 comments

Comments

@Southclaws
Copy link
Owner

Commands should be rate limited in:

  • private
  • channel
  • summon

This can either be per-user or global but generally follows this structure:

  1. When a message is received, mark the time it was received.
  2. When a message is received, check if the time since the last message is below a certain threshold
    • (per user) Increment a map[string]int value for the command author
    • (global) Increment an int for the bot
  3. If that value goes over a threshold, block commands for the next X seconds and reset the counters.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant