#hi my command no function help me pls
45 messages · Page 1 of 1 (latest)
- What's your exact discord.js
npm list discord.jsand nodenode -vversion? - Not a discord.js issue? Check out #1081585952654360687.
- 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-to-get-help
You didn’t provide any information
I'm trying to create a slash command but it doesn't appear in the list
Creating Your Bot: Registering slash commands
The command deployment script, to register your slash commands with Discord so they appear in the interface.
read more
Did you do this yet?
yes is same code
const { SlashCommandBuilder } = require('discord.js');
module.exports = {
data: new SlashCommandBuilder()
.setName('ping')
.setDescription('Replies with Pong!'),
async execute(interaction) {
await interaction.reply('Pong!');
},
};
That’s not the code of the page I linked. That’s just the command itself, not the deployment script
Please read the page I linked and follow what it tells you
well why doesn't it work
what it this
{
"token": "your-token-goes-here",
"clientId": "your-application-id-goes-here",
"guildId": "your-server-id-goes-here"
}
what guildID
Read. The. Page. Everything is explained in great detail there
- If you‘re one of those impatient people that can‘t be bothered to read anything and instead ask to be spoonfed: just stop and do something else
- if it‘s a language issue: use Google translate to translate the guide to your language
- if there are other reasons stopping you from reading the guide: please tell
hmmm
errno: -4052, syscall: 'scandir', code: 'ENOTDIR', path: 'D:\\202000\\commands\\ping.js'
your ping.js isnt a directory
and?
doesnt change my answer
you're reading your ping.js as a directory, which it isnt
your commands folder is a directory, your ping.js is a file
yes
you should know the difference
either make subfolders, or edit your code to not scan your files as directories
not djs related
okay
i know
Started refreshing 3 application (/) commands.
Successfully reloaded 3 application (/) commands.
i try it
yes thanks
then it indeed wont work