Can someone please take a look at my code please? Rate limited constantly

.
22 Replies
d.js toolkit
d.js toolkit2mo ago
- 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!
jay
jayOP2mo ago
I am being rate limited WAYYY too often. A very simple bot with commands like "ping", "avatar" etc. Not doing many requests at all. Like 3-5 per hour. Any tips?
jay
jayOP2mo ago
d.js docs
d.js docs2mo ago
To share long code snippets, use a service like gist, sourcebin, pastebin, or similar instead of posting them as large code blocks or files.
jay
jayOP2mo ago
Perfect, thank you
jay
jayOP2mo ago
Gist
bot.js
GitHub Gist: instantly share code, notes, and snippets.
Mark
Mark2mo ago
what logs are you getting to indicate you're being rate limited?
jay
jayOP2mo ago
None Just getting stuck when the commands are updating So I assumed it was stuck in the queue When we shouldn't be
Mark
Mark2mo ago
you shouldn't update commands on an interval. you should know when they change, so you make the changes, then redeploy manually
jay
jayOP2mo ago
Right So in a command?
d.js docs
d.js docs2mo ago
:guide: Creating Your Bot: Registering slash commands The command deployment script, to register your slash commands with Discord so they appear in the interface. read more
jay
jayOP2mo ago
Tbf that interval was there just as a test
Mark
Mark2mo ago
it should be a separate file that you run when you need to deploy
jay
jayOP2mo ago
But that isn't causing my issue It's getting stuck at line 98 to be more specific if anyone has any idea what's going on? https://gist.github.com/kerneljay/ed89dc6a811ce8f618e952207bc8fbde#file-bot-js-L98
Mark
Mark2mo ago
if it gets stuck there, it's because you're rate limited because you deployed too many commands in a 24 hour period
jay
jayOP2mo ago
That line of code was added after this issue occured... that isn't my issue here Plus, registering command every hour? Is that actually gunna hit the rate-limit? I mean theres like 5 commands And never in use
Unknown User
Unknown User2mo ago
Message Not Public
Sign In & Join Server To View
jay
jayOP2mo ago
Gotcha Makes sense
Unknown User
Unknown User2mo ago
Message Not Public
Sign In & Join Server To View
jay
jayOP2mo ago
Do i even need to use rest here?
Unknown User
Unknown User2mo ago
Message Not Public
Sign In & Join Server To View
jay
jayOP2mo ago
Yep gotcha thank u Finally Now I can actually see the rate limit details Thank you so much, confident I can fix the deploying commands into its own command and then should be fixed. Appreciate it

Did you find this page helpful?