Can't use commands of other files

I've made a folder with the commands and i've put there a folder called test for the ping command and the user command. I've done the command handler and it doesn't work. That's how the directory looks.
No description
8 Replies
d.js toolkit
d.js toolkit3mo 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! - Marked as resolved by OP
Developer
DeveloperOP3mo ago
Node Version: 21.4.0 npm list discord.js: [email protected] The commands don't appear when i write / with the bot + i have the ping command that normally you do in the index.js but i removed it (https://discord.js.org/docs/packages/discord.js/14.15.3) now i have that one /ping command even if i removed it from the code, instead of having the ping command of my ping.js file. ping.js:
const { SlashCommandBuilder } = require('discord.js')

module.exports = {
data: new SlashCommandBuilder()
.setName('ping')
.setDescription('Testing 2'),
async execute(interaction) {
await interaction.reply('Pong!');
},
};
const { SlashCommandBuilder } = require('discord.js')

module.exports = {
data: new SlashCommandBuilder()
.setName('ping')
.setDescription('Testing 2'),
async execute(interaction) {
await interaction.reply('Pong!');
},
};
discord.js
discord.js
discord.js is a powerful Node.js module that allows you to interact with the Discord API very easily. It takes a much more object-oriented approach than most other JS Discord libraries, making your bot's code significantly tidier and easier to comprehend.
d.js docs
d.js docs3mo ago
To share long code snippets, use a service like gist, sourcebin, pastebin, or similar instead of posting them as large code blocks or files.
Developer
DeveloperOP3mo ago
Gist
The commands don't appear when i write / with the bot + i have the ...
The commands don't appear when i write / with the bot + i have the ping command that normally you do in the index.js but i removed it (https://discord.js.org/docs/packages/discord.js/14.15....
Developer
DeveloperOP3mo ago
Do you mean doing nodemon ping.js stopping it and then doing nodemon index.js? I didn't
Developer
DeveloperOP3mo ago
https://discordjs.guide/creating-your-bot/command-deployment.html#guild-commands you mean with the rest.put in this part of documentation?
discord.js Guide
Imagine a guide... that explores the many possibilities for your discord.js bot.
Developer
DeveloperOP3mo ago
Thanks you!
Want results from more Discord servers?
Add your server