Sending deploy request

✅ .env is read correctly ✅ Token, Client ID, and Guild ID are valid ✅ 44 commands are loaded correctly ✅ The REST client initiates the PUT request… ⚠️ …but after that, nothing happens (it hangs on “🌐 Sending deploy request…”) This is what chatgpt says. The strange thing is that it simply won't upload, but it doesn't give any error response either. As soon as I try to upload the commands. Does anyone understand this?
19 Replies
d.js toolkit
d.js toolkit2w ago
Amgelo
Amgelo2w ago
sounds like you're ratelimited can confirm by logging rest.on('rateLimited', console.log)
Danny Terpstra
Danny TerpstraOP2w ago
Okay global: false, method: 'PUT', url: 'https://discord.com/api/v10/applications/1411709275260194857/guilds/1411704042916417559/commands', route: '/applications/:id/guilds/:id/commands', majorParameter: 'global', hash: 'Global(PUT:/applications/:id/guilds/:id/commands)', limit: 2, timeToReset: 35396, retryAfter: 35396, sublimitTimeout: 0, scope: 'user'
Amgelo
Amgelo2w ago
yeah you're ratelimited make sure you're not deploying on start and just wait it out or I think resetting your token also resets it but if you don't change anything you'll likely hit it again
Danny Terpstra
Danny TerpstraOP2w ago
Okay, because I suddenly had this. I don't understand why. then I added it to my index.js so that it uploads it during startup but that doesn't work either. I have already reset token but this doesn't work. so there are no solutions for this?
Amgelo
Amgelo2w ago
just waiting it out then
Danny Terpstra
Danny TerpstraOP2w ago
Does it take a long time?
Amgelo
Amgelo2w ago
and yeah if you deploy on every start then you'll likely hit it quickly that's why the guide does it in a separate script called manually when you change commands the timeToReset is there, I believe in seconds
Danny Terpstra
Danny TerpstraOP2w ago
I put it in that script because it didn't work anymore. It was last night that I tried the last one and he's not doing it yet?
Amgelo
Amgelo2w ago
maybe it resets if you keep hitting it, not sure how it works just wait it out and you'll be fine ah, and remove it from the start logic
Danny Terpstra
Danny TerpstraOP2w ago
I did. I just think it's a shame I have to wait for this. Because my whole discord runs on slash commands.
Amgelo
Amgelo2w ago
you don't need to deploy for commands to work though the ones you had will work fine you just can't update that list which is what deploying does ^^
Danny Terpstra
Danny TerpstraOP2w ago
Yes, it's true. only added to the script that he removed and reuploaded all commands. because there were doubles in it
d.js docs
d.js docs2w ago
If you have duplicate commands on your server, you registered both global and guild commands. You can remove the duplicates by resetting either the global or guild commands - Resetting global commands: rest.put(Routes.applicationCommands(clientId), { body: [] }) - Resetting guild commands: rest.put(Routes.applicationGuildCommands(clientId, guildId), { body: [] })
Danny Terpstra
Danny TerpstraOP2w ago
Yeah, I did. I put it back now. I'll wait a few days
Amgelo
Amgelo2w ago
for that you only need a single call ^^ (which you can delete after you execute once)
Danny Terpstra
Danny TerpstraOP2w ago
aaah okay. yes then I have to wait until my cooldown is over hahaha It was very short that it worked again. he is now that I am in a cooldown again!
Samtino
Samtino2w ago
How often are you re-deploying your commands? You should only ever deploy your commands when you actually make changes to your command structure So when you change things like the "name" "description" or "options" of a command, add new commands, or remove existing commands When you change the code that is run when a command is executed, you do NOT need to redeploy Additionally. It's also helpful to do all development on a second bot account than your main bot This is so that if you ever DO get rate limited, by something you're testing, it doesn't effect your main bot
Danny Terpstra
Danny TerpstraOP2w ago
I only update it when I add new things. only I'm all making minigames. my main bot is my test bot because the server itself is not really operational No, that's what I did when he completely blocked. Now i just register and update commands. I have that rate limit now. IS that due to the removal of double commands?

Did you find this page helpful?