Bot no register slash commands
Tried: reinviting the bot with scopes enabled, testing with ping command in docs example(it worked), using applicationGuildCommand() as well, but to no avail.
13 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!How do you deploy your commands, its applicationGuildCommands aswell
And are you sure the guild id is correct
Ummm command handler? I take al the commands from the file, turn it into json, export it to another file, the add that deployment variable to the body
Ah yea, typo
100%
checked it multiple times
And did you redeploy after inviting the bot
yes
Show your deploy file
RegisterSlash.js:
first of all commands do not have an alias or usage property
Also you might be ratelimited because you make 3 requests
yea I was testing if it worked with that property there, and it does work.
You should only make one and if you want multiple guilds use global commands
No no, I make only 1 request the other two are commented out
I have only one guild for testing
Help pls, I've been trying to get the slash commands to register for the past 3 days
;-;
console.log(commands) does show me the json format of my comands. I did try it and the console shows me nothing when running the deployment, just shows that it started refreshing slash comands and after that it shows my bot is ready from the bot.ready thingy and for the next9 hours, literally nothing
Okay so, I've tried it like 10 times in like 10 minutes ig?
That was before
Around 16 hours ago
I tried it once, just now, spat an error, fixed it and ran it again for the seond time in 16 hours, and same behaviour
But I will try and add the rate limited thing, that might actually help, thank you
I tried rest.on('rateLimited', console.log) nothing happened, but when I changed it to rest.on('rateLimited', console.log("being rate limited") I got this error:
I did this:and got:
I truly am not being rate limited rn because
This is my code:and this is my output:
But it still isn't being registered
wdym?
it catches only if there is an errror, but there is no error
idk what the error console is
from vscode
like
powershell terminal
no it shows everything in one terminal
even if there is an error
sure
Here, see?
I don't exactly call it, it goes to the bot directly, it is awaited
bot is my Client
ajshdkad forgive me, I'm stil kinda learning, in uni rn, anyway, I think it's called when the bot is logged on
Cuz it worked when I gave it only a single command to register
It's called in my index.js, right before the bot.login function
code:
loadcommands is declared:
const loadcommands = require("./util/commandHandler")
how do I await it
Nah I use a command handler, so all of it is stored in different files
Oh right
did that, and now the bot isn't logging in either ;-;
//load slash command regitry
require("./util/RegisterSlash")(bot).then(() => bot.login(process.env.token))
do I try it after I console.log the ratelimit or before?
Yea I got that
Started refreshing application (/) commands.
{ remaining: 120, resetAt: 1691330981093 }
[REST Global(PUT:/applications/:id/guilds/:id/commands):global] Received bucket hash update
Old Hash : Global(PUT:/applications/:id/guilds/:id/commands)
New Hash : a3b974ef6eb1c925dd4ceb42f4db26fd
[REST Global(PUT:/applications/:id/guilds/:id/commands):global] Encountered unexpected 429 rate limit
Global : false
Method : PUT
URL : https://discord.com/api/v10/applications/762887460405379122/guilds/702812667957739611/commands
Bucket : /applications/:id/guilds/:id/commands
Major parameter: global
Hash : Global(PUT:/applications/:id/guilds/:id/commands)
Limit : 2
Retry After : 30050ms
Sublimit : 30050ms
So I am getting rate limited huh
It says to retry after 30 seconds tho yea?
It says I'm rate limited by ther restDebug but the rest.on('rateLimited', console.log) does not show up in my terminal at all??????
I'm actually trying to just test it ;-;
But yea, I'll keep that in mind, I'm sorry
output:
on my computer
not at all
but my isp's routing is truly, pure trash
oki, thanks
wait, I tried running the code on a hosting webiste and it spits me the same goddamn error?!
I can 100% tell you that I've deployed it only 14 times today
Cuz within 24 hours, I've run this bot only like 20 times, out of which, a few times without running the registering command
nodemon
Ik it restarts the bot every time I make a change. That's why I'm using nodemon. Otherwise I was just using node.
Cuz I didn't edit it and save more than 14 times, duh
Dude, this doesn't make sense to me at all. The rate limit says retry after 30050 ms, the sublimit shows the same amount of time and the limit is two. The last time I tried registering commands was at 1:40 am last night, 12 hours later(rn) I get the same unexpected 429 rate limit error. How does that compute?