My slash commands aren't registering in my discord server. Client.on() doesn't seem to run.
Github: https://github.com/Niimaii/Harmony
I am putting the repo here to make things easier.
I put several console.log() to check how things are. The bot does login, it seems to register all the commands. However it doesn't show up when I try to use the slash command in the server.
I am at a loss and spent wayyyyy too much time trying to figure this out, there is probably a simple explanation, I just can't figure it out.
The only hint I have is that the only console.log() that doesn't show up are the one in this section:
So it seems that client.on() isn't running at all, I am not sure. Please help! ahahahaha
GitHub
GitHub - Niimaii/Harmony
Contribute to Niimaii/Harmony development by creating an account on GitHub.
7 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!I am sure there is something wrong with it, but it doesn't seem to error when I run it
I am a little stupid and new to discord bots.
I tried not calling anything from deploy-commands in index, but nothing from the deploy-commands would run (even the console.log()). So I was desperate and thought I needed to run it in index.js?
tbh I am pretty lost on what to do.
None of this code from deploy-commands is running including the console.logs() I have there (i updated it to what I had it originally before deciding to call it in index):
Oh wow, I didn't even catch that. Thank you! I updated the code to this:
The deploy-commands.js file doesn't seem to run still. None of the console.log() are running.
I tried updating my package.json script to include it when I run, but nothing still:
So commands are now registered! But only when I manually run the script; the deploy-commands.js script is still not running on it's own and the bot does not reply with 'pong' or anything when I run the slash command.
that is intended, hence why its a separate script
You still have to run your actual bot itself
The bot is being ran though
I had to manually run deploy-commands so the slash commands would register. Are you saying that it's intended to be like that?
yes
thats why its a separate file
to avoid running it every time your bots starts
Ohhhhhh
Interesting, I didn't realize that's how it worked.