hi my command no function help me pls

d
19 Replies
d.js toolkit
d.js toolkit•13mo ago
- 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!
Syjalo
Syjalo•13mo ago
#how-to-get-help
./u.7-z
./u.7-z•13mo ago
yes ?? pls I'm trying to create a slash command but it doesn't appear in the list
d.js docs
d.js docs•13mo ago
guide 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
./u.7-z
./u.7-z•13mo ago
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!');
},
};
const { SlashCommandBuilder } = require('discord.js');

module.exports = {
data: new SlashCommandBuilder()
.setName('ping')
.setDescription('Replies with Pong!'),
async execute(interaction) {
await interaction.reply('Pong!');
},
};
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"
}
{
"token": "your-token-goes-here",
"clientId": "your-application-id-goes-here",
"guildId": "your-server-id-goes-here"
}
what guildID hmmm errno: -4052, syscall: 'scandir', code: 'ENOTDIR', path: 'D:\\202000\\commands\\ping.js'
treble/luna
treble/luna•13mo ago
your ping.js isnt a directory
./u.7-z
./u.7-z•13mo ago
No description
treble/luna
treble/luna•13mo ago
and? doesnt change my answer you're reading your ping.js as a directory, which it isnt
./u.7-z
./u.7-z•13mo ago
?? how we change it
treble/luna
treble/luna•13mo ago
your commands folder is a directory, your ping.js is a file
./u.7-z
./u.7-z•13mo ago
yes
treble/luna
treble/luna•13mo ago
you should know the difference either make subfolders, or edit your code to not scan your files as directories not djs related
./u.7-z
./u.7-z•13mo ago
okay i know Started refreshing 3 application (/) commands. Successfully reloaded 3 application (/) commands. i try it yes thanks
./u.7-z
./u.7-z•13mo ago
No description
treble/luna
treble/luna•13mo ago
do you have an event handler or at least listen to the interactionCreate event
./u.7-z
./u.7-z•13mo ago
?? no
treble/luna
treble/luna•13mo ago
then it indeed wont work
d.js docs
d.js docs•13mo ago
guide Creating Your Bot: Event handling read more
treble/luna
treble/luna•13mo ago
all of this is explained by the guide
Want results from more Discord servers?
Add your server