Problem with rest module
So i asked in #djs-help-v14 a few time about my deploy command not working, especially all lines after the rest.put. Since i put this code in my ready event, everyone and me thought that i was rate limit. But the night after someone said that to me, it worked again. then, i removed the code from my ready event, changed the way to execute it so i executed it only 1 time, continued to work on my bot, and when i added a new command and executed my deploy command, it didn't work. I thought it was rate limit again because the var "response = rest.put(..." was empty. But i just found about client.rest.on("response", console.log) and i saw that i was not rate limit. So i'm asking here for help
deploy_command.js:
one of the 10 000000 rest reponse:
6 Replies
- What's your exact discord.js
npm list discord.js
and node node -v
version?
- Not a discord.js issue? Check out #other-js-ts.
- Consider reading #how-to-get-help to improve your question!
- Explain what exactly your issue is.
- Post the full error stack trace, not just the top part!
- Show your code!
- Issue solved? Press the button!
- ✅
Marked as resolved by OPafter writing all the response in a file (because the terminal is too small), all the response are from when i set the send_message permission of all channel for the role "Muted" to false. The reponse for the deploy command request don't appear (or the request don't exist)
i did but there was nothing
that's why i listen to response because in the resposne there is the rate limit information
not in the one i show
mb
So I'm not rate limit. My put request is simply not executed (or at least, no response is returned)
In the second response I sent, you can see the x-ratelimit-limit: 10 and the x-ratelimit-remaining: 9
And I already listened to the rate limit event by following the djs 14 guide and nothing appeared
no , indeed but now i did it and still nothing
yes
everything after the rest.put is not executed
in my console, i have nothing, and i don't think i have logs
Daki Hosting
Daki Hosting
Hey, you want to host your bot for free today and with a good uptime? Then you are exactly right with Daki, convince yourself today!
yes but i have 2 pcs and i'm tired of forgeting files and not being able to progress until i recode the missing files
but i could
ok, i'll try, it will be quick
got problem with vs c++
idk, it raised an error telling me i needed it, and on my other pc, i installed it but i didn't remember why
maybe something with others packages
but finally i'm here
wait what ?????
solved it, i used the previous version
I LOVE YOU
i try
the new one...
i left for at least 2-3 minutes so the 43 second were ok then i closed my bot (ctrl + c) and reexecute the node main.js
now i got the new one
but newer one appear
it seems like it reexecute the request again and again
got 3 new
with the new one appearing, i fell like the time is in second not ms
i log the time when the ratelimit event is sent every time to see the diference and compar to the time in the response
every 1 minutes exactly it resend the request and the number "time to reset" goes down 55
i don't
it do this alone
am i that dumb?
yes
got this after closing the host:
i'm still ratelimit
that's not logic
after someone told me about the rrate limit ( i think it was you) i removed the functionfrom my ready evnet and only use it 2 times in the day and the second was false due to rater limit
ok
nope
and i log all response and rate-limit so i would have seen it
the strange tthing is that after changing my token, rate-limit event is not trigger anymore, but my new command isn't load in my server
reloading didn't solve it. Too many automatic request, my terminal was full, didn't see if the then catch. Restart it, rate-limit came back
everything's "right"
just have to wait 12 h
true
so, see you in 12 h i guess
Just, how do you know these informations? I've searched online and I found nothing
If you have the section about the rate limit in the doc, can you send it pls?
:discord: Rate Limits
Rate limits exist across Discord's APIs to prevent spam, abuse, and service overload. Limits are applied to individual bots and users both on a per-route basis and globally. Individuals are determined using a request's authentication—for example, a bot token for a bot.
read more
waiiiiiit
so if i deploy them globaly, it will works?
yeah, i misunderstood
i saw that if you deploy the commands globally, it can take times, sometimes to one hour but in only one guild, it's instant
and since i'm working on it, i don't wanna wait to use my commands
something weird append
i changed to global deployement and when i restart my bot, i didn't get the limit rate message and i get the data.length error as you said
but my command are not send and i got these error:
why didn't you start by that 🤣
i understand, and i correct it, thank you for everything
now i'll use global deploying ( because i'm not rate limit on it )