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
Auto delete could potentially make a lot of requests #87
Comments
Maybe we can just integrate every auto-things to |
This issue still exists for PUT requests Edit: i don't think there is really any good option atm, but i think there should at least be a way to opt out of the feature while still being able to use |
I've conducted a small experiment with my bot being in 15 separate guilds, and I can confirm that this is potentially a huge threat to the library itself if My recommendation is to go with AnotherCat's suggestion by only reading slash commands with the |
Another idea: we have the user define "shards" in some sense not through official d.py wrapper but with this internally so the API can handle "sections" or blocks of guilds it has to scan through, this might be a temporary or long-term workaround. |
Yeah like a list of guilds at start up which the bot will check every time |
I think we should do this even though it's a breaking change because currently it means that people could potentially be API banned because of this. I just remembered something, on all api requests (which i think includes slash commands) there is a global limit of 10k invalid requests per 10 mins. And a GET or POST request to guilds that haven't been authorised with |
The shards idea might be very much a good idea then for the large bots with 10K+ servers. We just don't know right now how big slash commands are going to get, and it's better that we prepare for this now than never. |
I'm not too sure how sharding works with slash commands, like do guilds with only slash commands get put into shards? Edit: (i do a lot of edits don't i) |
For now it looks like these option can be used:
|
This doesn't really change anything, just warning. How about implenting an arg for |
This looks extremely unusable for large bots; there's no way using your UI to say that you'll only ever use global commands, which is what I'm assuming most large bots will end up wanting |
This is not only a severe design flaw for this API wrapper but in the Bot API itself. I'll be working at some attempts this weekend to see if a working model of Cat and I's idea can be made feasible. |
Here is an update to the problem as referring to #92 : tl;dr: This is a massive problem and we need to fix this ASAP pending v.1.0.9's release. A user named knarfie#0001 described their issue of converting all of their guild commands to global commands in the Support Server. Their bot is in only 4 servers, and they have 25 commands. However, they experienced reaching a rate limit from the Discord Bot API despite being in very few servers.
The biggest problem this serves is that Discord default to 24 hours per event of the quota of HTTP requests on a particular set action being reached on their Bot API, which means bot developers must wait 1 full day in total in order to process either smaller chunks of commands, or to even re-attempt it in total. |
For anyone that's looking at this and is interested, we're discussing how to solve this on the discord server |
This should be fixed on new commit. |
The Problem
Currently if
auto_delete
isTrue
a GET request will be made for every guild the bot is in on every load.This could potentially cause thousands of requests (depending on the size of the bot) and discord has indicated that they might be introducing rate limits for slash commands.
This could make the library unusable for some.
Proposed solution
Add a
check_all_guilds
parameter toSlashCommand
which defaults toFalse
.If it's false then check all guilds that have commands registered to them, don't check all guilds.
If it's true check all guilds (like currently), possibly add a WARNING if guilds above a certain number.
The only problem I can see with this is that it won't delete commands in a guild if there are no commands registered to that guild in SlashCommand
Possible alternatives
False
The text was updated successfully, but these errors were encountered: