Slash Commands Not Loading
So my bot is working perfectly but when I add it into a new server slash commands don't load like at all. No errors, it has administrator along with application.commands auth.
67 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 OPits maybe supposed to load after some time??
Unknown User•6mo ago
Message Not Public
Sign In & Join Server To View
I do not pose any specific code that targets guild id's, though, I have a a specific channel only command in which it still doesn't work, I tried updating the channel id to a channel from the server I tried adding it to.
Providing the register code in a sec
im a beginner so there might be a mistake
Unknown User•6mo ago
Message Not Public
Sign In & Join Server To View
my apologies
I thought you asked for guild-id specific code
Unknown User•6mo ago
Message Not Public
Sign In & Join Server To View
how do you suggest I change it
Unknown User•6mo ago
Message Not Public
Sign In & Join Server To View
also does this basically mean
commands are loaded for servers that are existant while bot is being started?
(registering per guild)
Unknown User•6mo ago
Message Not Public
Sign In & Join Server To View
so I make body [], start the bot
then change the line you wanted
and restart?
Unknown User•6mo ago
Message Not Public
Sign In & Join Server To View
bot only has a single command
made for a specific purpose
Unknown User•6mo ago
Message Not Public
Sign In & Join Server To View
oh you mean like that
ohh they save?
Unknown User•6mo ago
Message Not Public
Sign In & Join Server To View
I thought they had to be registered every time bot starts
Unknown User•6mo ago
Message Not Public
Sign In & Join Server To View
but whenever I edit a command code I gotta register right
for the edit to take effect
Unknown User•6mo ago
Message Not Public
Sign In & Join Server To View
aight the reset of the body is in effect
ill revert the body and change the code
Unknown User•6mo ago
Message Not Public
Sign In & Join Server To View
I reset the body, publish, revert the body, change the code you asked me to
but the new server still doesn't have the commands
should I like wait for some time or
no errors
Unknown User•6mo ago
Message Not Public
Sign In & Join Server To View
of course
Unknown User•6mo ago
Message Not Public
Sign In & Join Server To View
I appreciate the help, im the one getting helped here
Unknown User•6mo ago
Message Not Public
Sign In & Join Server To View
aight
Unknown User•6mo ago
Message Not Public
Sign In & Join Server To View
all good
Unknown User•6mo ago
Message Not Public
Sign In & Join Server To View
I did
I made sure it got published
Unknown User•6mo ago
Message Not Public
Sign In & Join Server To View
waited till it was all deployed and then reverted the body and changed it to non-guilfd
no the commands weren't loaded when the body was []
but I can retry if you'd like
Unknown User•6mo ago
Message Not Public
Sign In & Join Server To View
nothing, no errors, no commands
same as before
Unknown User•6mo ago
Message Not Public
Sign In & Join Server To View
only error I got
bot started etc
also a "commands refreshed" & "commands loaded" print
absolutely no other prints
if its supposed to fix this I can maybe transfer it to another application???
Unknown User•6mo ago
Message Not Public
Sign In & Join Server To View
whole script
aight ill do that
praying that I won't break the bot
Unknown User•6mo ago
Message Not Public
Sign In & Join Server To View
hope so
also in guide it reads , should I run this in VSC terminal? Hosting website I use doesn't pose a terminal I think
Unknown User•6mo ago
Message Not Public
Sign In & Join Server To View
should I also put button/event registers to the new register script?
or only commands
Unknown User•6mo ago
Message Not Public
Sign In & Join Server To View
aight
one question, since im keeping buttons/events at the main script, how should I pass the client?
it creates the client object via Discord.js package at the main script
Unknown User•6mo ago
Message Not Public
Sign In & Join Server To View
but the register script requires it too
I don't?
Unknown User•6mo ago
Message Not Public
Sign In & Join Server To View
basically while I was making this bot I wasn't aware of any of this
so I made it like
Unknown User•6mo ago
Message Not Public
Sign In & Join Server To View
interaction handler was working this way
and the register like this
ik its stupid but this was the only way as I knew of
whats the alternative so I can get rid of this
Unknown User•6mo ago
Message Not Public
Sign In & Join Server To View
right yeah
this seemed smart at first but now ik how bad it is
Unknown User•6mo ago
Message Not Public
Sign In & Join Server To View
also in the guide you sent it registers the commands with
should I change it
Unknown User•6mo ago
Message Not Public
Sign In & Join Server To View
aight
added the register file, trying
aight so I added the register file
ran the code
bot is online with no errors but the hosting service I use (Railway) only allows terminal commands from desktop CLI, I downloaded n all but having some trouble with running the register code
is there any alternative like a one time thing for this
these are direct references from discord js guide so
idk how its erroring
token is directly defined as a string
yea if figured that out
aigh
yup it worked with a ;
thank you