-
Notifications
You must be signed in to change notification settings - Fork 9
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
Rename pending request channels with the amount of pending requests in that channel #136
Conversation
This gets the bot Rate Limited very quickly, I don't know if there is any way to do this while getting around rate limiting |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A way in which this could work without catching the rate limit is by not updating the name of the channel every time a new request is posted, but rather have a task updating the channel name regularily (e.g. every 10 minutes, but that should be configurable). It might be difficult to keep track of the amount of requests in a channel though. However, the way it's implemented now, we'd probably run into rate limits constantly.
For reference, the rate limit for channel name and topic updates is 2 updates per 10 minutes per channel.
this.logChannel = config.get( 'request.logChannel' ); | ||
|
||
if ( this.channels.length !== this.internalChannels.length ) { | ||
throw new Error( 'There are not exactly as many Request channels and ' ); | ||
} | ||
if ( this.internalChannels.length !== this.internalChannelNames.length ) { | ||
throw new Error( 'There are not exactly as many Internal channels and ' ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... and what?
throw new Error( 'There are not exactly as many Internal channels and ' ); | |
throw new Error( 'There are not exactly as many Internal channels as associated names' ); |
I would keep in memory the number of requests open, and update both the pending requests and the normal requests channel(for transparency) As for when to update, I think we should keep a timer of 1 min per channel. Every time that there is a change(ticket resolved), start the timer. Reset it back to 1 minute if there is another change. After the 1 min update both channel names |
For the normal channels, I think it makes more sense to update the channel topic for the public channels. But yeah, it would be nice to have that count public too.
This will just cause the bot to get rate limited by Discord, or alternatively, the channel name to never be updated. I'm probably going to open a completely new PR for this, so I'm going to copy these considerations to the issue. |
If its only updated 1 minute after the last change, I dont think it will get rate limited. Way more chances that every 10 mins too |
The rate limit is 2 channel renames per 10 minutes, as I said. In the worst case with your method the channel can be renamed up to 9 times in that time frame. |
Closing due to rate limiting and violine's assignment. |
Purpose
Closes #68
Approach
New config for channel names
Future work