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

Event-based renaming instead of loops. #54

Open
gregzaal opened this issue Jul 14, 2020 · 0 comments
Open

Event-based renaming instead of loops. #54

gregzaal opened this issue Jul 14, 2020 · 0 comments
Labels
help wanted Extra attention is needed performance Improve the speed and responsiveness

Comments

@gregzaal
Copy link
Owner

Since discord nerfed their rate limit for channel renaming down to only twice every 10 minutes, it's no longer acceptable to just check each channel in a loop every X seconds/minutes if they need to be renamed.

Instead, we need a system without loops that catches various events (user activity changes, users joining the channel...) depending on the template used (e.g. only catch user activity changes if @@game_name@@ is used in the template) and queues up a rename for the channel.

Then there could be a queue handler that decides if it's safe to rename the channel (to avoid hitting the rate limit) and sends the actual request when it's safe to do so.

For bonus points, if a user uses the vc/name command and the queue handler decides it's not safe to rename the channel yet, it could return a callback so the bot can respond to the user and tell them exactly how soon the channel will be renamed. Currently with the loop only running once every 10 minutes, the vc/name command can have no effect for 10 minutes, with no feedback to the user to explain why.

@gregzaal gregzaal added help wanted Extra attention is needed performance Improve the speed and responsiveness labels Jul 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed performance Improve the speed and responsiveness
Projects
None yet
Development

No branches or pull requests

1 participant