hi my command no function help me pls

d
19 Replies
d.js toolkit
d.js toolkit14mo 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
Syjalo14mo ago
#how-to-get-help
./u.7-z
./u.7-zOP14mo ago
yes ?? pls I'm trying to create a slash command but it doesn't appear in the list
d.js docs
d.js docs14mo 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-zOP14mo 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/luna14mo ago
your ping.js isnt a directory
./u.7-z
./u.7-zOP14mo ago
No description
treble/luna
treble/luna14mo ago
and? doesnt change my answer you're reading your ping.js as a directory, which it isnt
./u.7-z
./u.7-zOP14mo ago
?? how we change it
treble/luna
treble/luna14mo ago
your commands folder is a directory, your ping.js is a file
./u.7-z
./u.7-zOP14mo ago
yes
treble/luna
treble/luna14mo 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-zOP14mo ago
okay i know Started refreshing 3 application (/) commands. Successfully reloaded 3 application (/) commands. i try it yes thanks
./u.7-z
./u.7-zOP14mo ago
No description
treble/luna
treble/luna14mo ago
do you have an event handler or at least listen to the interactionCreate event
./u.7-z
./u.7-zOP14mo ago
?? no
treble/luna
treble/luna14mo ago
then it indeed wont work
d.js docs
d.js docs14mo ago
guide Creating Your Bot: Event handling read more
treble/luna
treble/luna14mo ago
all of this is explained by the guide
Want results from more Discord servers?
Add your server