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

API response with code 30034 should be added as a DiscordAPIError[30034] #10458

Open
aymanbhrr opened this issue Aug 23, 2024 · 4 comments
Open

Comments

@aymanbhrr
Copy link

Which application or package is this feature request for?

discord.js

Feature

I was having some problems deploying my app commands in my server; they weren't deploying at all and I was not getting any prompt (error, message...) and I was losing my mind ngl because I didn't know what was going on. Someone in the djs server suggested me to run a curl request to see what the reponse headers give me but it didn't really work and didn't clarify my confusion as I was not really familiar with curl, so I decided to use axios instead and I finally got a response which was "Max number of daily application command creates has been reached (200)". (status code 429)

Ideal solution or implementation

Add a DiscordAPIError whose message is "Max number of daily application command creates has been reached (200)" and its corresponding error code (30034)

Alternative solutions or implementations

No response

Other context

image

@imnaiyar
Copy link
Contributor

imnaiyar commented Aug 23, 2024

Discord.js queues requests on rate limits. If you want to know when that happens, you would have to listen to the rateLimited event on REST. This is by design.

Also, you should not attempt to deploy commands on startup. It should be a separate script that should be run only when you make changes to your commands, precisely because of the error you received.

@aymanbhrr
Copy link
Author

aymanbhrr commented Aug 23, 2024

Discord.js queues requests on rate limits. If you want to know when that happens, you would have to listen to the rateLimited event on REST. This is by design.

Actually, before using the axios method, I already was listening to that event and didn't get any prompt either.
REST.on("rateLimited", () => console.log("rate limited"))

Also, you should not attempt to deploy commands on startup. It should be a separate script that should be run only when you make changes to your commands, precisely because of the error you received.

I am aware of that, I'm just saying that it would be nice to have that feature in the library for those who are not aware.
Also, as discord.js queues requests on rate limits, this one could be an exception and actually prompt an error.

@Qjuh
Copy link
Contributor

Qjuh commented Aug 23, 2024

The event is named rateLimited and you‘d need to listen to it on the instance of the class REST, not the class itself.

@aymanbhrr
Copy link
Author

aymanbhrr commented Aug 23, 2024

The event is named rateLimited and you‘d need to listen to it on the instance of the class REST, not the class itself.

Oops, I've made a typo on the name of the event. And I already knew those two things, the "REST" word I wrote was just to make you understand that I use an instance of the REST class.
(and yes, I've wrote the event name correctly in my code before creating this issue, I just did a typo in my comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants