#hi my command no function help me pls

45 messages · Page 1 of 1 (latest)

split scroll
#

d

covert adderBOT
#
  • What's your exact discord.js npm list discord.js and node node -v version?
  • 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!
trim crystal
#

#how-to-get-help

split scroll
#

yes ??

#

pls

keen lance
#

You didn’t provide any information

split scroll
#

I'm trying to create a slash command but it doesn't appear in the list

plush spokeBOT
#

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

keen lance
#

Did you do this yet?

split scroll
#

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!');
    },
};
keen lance
#

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

split scroll
#

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

keen lance
#

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
split scroll
#

hmmm

#

errno: -4052, syscall: 'scandir', code: 'ENOTDIR', path: 'D:\\202000\\commands\\ping.js'

zinc osprey
split scroll
zinc osprey
#

and?

#

doesnt change my answer

#

you're reading your ping.js as a directory, which it isnt

split scroll
#

??

#

how we change it

zinc osprey
#

your commands folder is a directory, your ping.js is a file

split scroll
#

yes

zinc osprey
#

you should know the difference

zinc osprey
#

not djs related

split scroll
#

okay

#

i know

#

Started refreshing 3 application (/) commands.
Successfully reloaded 3 application (/) commands.

#

i try it

#

yes thanks

zinc osprey
#

do you have an event handler

#

or at least listen to the interactionCreate event

split scroll
#

??

#

no

zinc osprey
#

then it indeed wont work

plush spokeBOT