You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, you can have a rest proxy and have your bot send requests to Discord API through that, and with #3122, you can now have a single rest proxy for multiple bots. This is great, however, there's a few things to be addressed to make this truly reliable for multiple bots:
Ratelimit handling:
Current behavior is assuming we use only one token, thus ratelimit handling is done in one place only. But we need a way for ratelimits to be stored and handled individually for different bot tokens used by rest requests, so that they all can utilize their individual limits fully. As an example, with the current implementation, if there are 5 bots trying to send a message in the same channel using the same rest proxy, they can only send 5 messages per 5 secs but if the ratelimit handling is split individually for as many bot tokens used, they can send 25 messages per 5 secs (5 per bot). So they'll basically have to have different ratelimit data stored for different tokens and also global ratelimit should only affect a single bot and not all bots.
Invalid Requests handling:
I believe current implementation might not need much changes regarding this but while making a PR to do ratelimit handling individually, it should be made sure that it doesn't end up having different invalid requests tracker, this must continue to remain global, as invalid requests for the cloudflare ban is based on IP and not token.
The text was updated successfully, but these errors were encountered:
In pr #3185 all the queues and ratelimit information are prefixed by the authentication being used. So, it might also address this issue as a rest proxy for example could use the Authorization header (changing the proxy auth header) to be able handle the ratelimit for all the tokens propriety
Currently, you can have a rest proxy and have your bot send requests to Discord API through that, and with #3122, you can now have a single rest proxy for multiple bots. This is great, however, there's a few things to be addressed to make this truly reliable for multiple bots:
Ratelimit handling:
Current behavior is assuming we use only one token, thus ratelimit handling is done in one place only. But we need a way for ratelimits to be stored and handled individually for different bot tokens used by rest requests, so that they all can utilize their individual limits fully. As an example, with the current implementation, if there are 5 bots trying to send a message in the same channel using the same rest proxy, they can only send 5 messages per 5 secs but if the ratelimit handling is split individually for as many bot tokens used, they can send 25 messages per 5 secs (5 per bot). So they'll basically have to have different ratelimit data stored for different tokens and also global ratelimit should only affect a single bot and not all bots.
Invalid Requests handling:
I believe current implementation might not need much changes regarding this but while making a PR to do ratelimit handling individually, it should be made sure that it doesn't end up having different invalid requests tracker, this must continue to remain global, as invalid requests for the cloudflare ban is based on IP and not token.
The text was updated successfully, but these errors were encountered: