Skip to content

Why do I get an error with slash commands? #9082

Closed Answered by RobbiDev
gamer167 asked this question in Q&A
Discussion options

You must be logged in to vote

Answer

After testing your issue it seems to work fine on my end. I assume it has to do something with your env declaration. Try changing your env into a ./config.json file like this if your just hosting the bot yourself. If your using a Host platform like render or heroku. Look at their env file docs.

{
    "token": "token-here",
    "clientId": "clientid-here",
    "guildId": "guildid-here",
}

Some Advice

Keepalive()

In your main code. Why do you exactly have

const keepalive = require('./keepalive.js');
// ...

keepalive();

Discord.js automatically keeps your bot alive as long as its being hosted on the server.

Use code blocks

when asking for help on anything code related. Use code blocks

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Jiralite
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants