Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Rate limit Twitch stream announces #145

Open
tsa96 opened this issue Jan 27, 2023 · 0 comments
Open

Rate limit Twitch stream announces #145

tsa96 opened this issue Jan 27, 2023 · 0 comments
Labels
good first issue Good for newcomers improvement Nothing is broken, making it better

Comments

@tsa96
Copy link
Member

tsa96 commented Jan 27, 2023

We quite often see Twitch streams on bad internet spamming the #live-streams channel every time their stream restarts. Also, it's obviously pretty abuse-able, so worth limiting before 1.0.0 drops.

Here's a sketch of the system we've been discussing:

  1. When a stream message is deleted, store the streamer ID, and schedule a method call for 1 hour in the future (time should be configurable)
  2. If it drops and comes back up a first time, announce again but don't ping users with the "@LiVe Streams" role.
  3. If it drops and comes back up a second time, don't re-announce, but track that this has happened.
  4. In the delayed call scheduled in (1), check if the stream is in the announce-blocked state tracked in (3), and re-announce it.
  5. Follow the same logic each hour, if it's been reannounced, allow it to drop and be re-announced only once per hour.
  6. Stream pings should be limited to once per 6 hours (again, this can be configurable), so any re-announces 6 hours after the first announce don't ping.

This should be a fun little programming task that doesn't require a great deal of knowledge of DSharpPlus, mostly just C# task scheduling and writing sensible data structures for handling the states. So a very good first issue.

@tsa96 tsa96 added good first issue Good for newcomers improvement Nothing is broken, making it better labels Jan 27, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
good first issue Good for newcomers improvement Nothing is broken, making it better
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant