Skip to content

Event-based renaming instead of loops. #54

@gregzaal

Description

@gregzaal

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is neededperformanceImprove the speed and responsiveness

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions