slash command not showing

Hey guy’s, im learning djs i needed help regarding slash commands I made a slash command and it not showing i will send my code in few mins i will appreciate it if you can tell me what did i do wrong
17 Replies
d.js toolkit
d.js toolkit6d 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
Cenzo
CenzoOP6d ago
And sorry if this is wrong place
require('dotenv') .config();

const { REST, Routes } = require('discord.js');

const commands = [
{
name: 'Meow',
description: 'say meow',
}
]
const rest = new REST({ version: '10'}).setToken(process.env.TOKEN);



(async () => {
try {

console.log('Registering slash commands...');
await rest.put(
Routes.applicationGuildCommands(
process.env.CLIENT_ID,
process.env.GUILD_ID
),
{ body: commands }

console.log('Slash comannds deployed
SucessFully!')

} catch (error) {
console.log('Slash commands deployed successfully!');
} catch (error) {
console.log(`There was an error: ${error}`);
}
})();

require('dotenv') .config();

const { REST, Routes } = require('discord.js');

const commands = [
{
name: 'Meow',
description: 'say meow',
}
]
const rest = new REST({ version: '10'}).setToken(process.env.TOKEN);



(async () => {
try {

console.log('Registering slash commands...');
await rest.put(
Routes.applicationGuildCommands(
process.env.CLIENT_ID,
process.env.GUILD_ID
),
{ body: commands }

console.log('Slash comannds deployed
SucessFully!')

} catch (error) {
console.log('Slash commands deployed successfully!');
} catch (error) {
console.log(`There was an error: ${error}`);
}
})();

As i mentioned im very new to djs i just started. Btw i named this file “slash-main.js” if that’s matter
Steve
Steve6d ago
did it error?
Cenzo
CenzoOP6d ago
No
Steve
Steve6d ago
send console out out output*
Cenzo
CenzoOP6d ago
Im using replit if that’s important 😅 One second
Cenzo
CenzoOP6d ago
This?
No description
Cenzo
CenzoOP6d ago
When i turn on the bot it will send no error I think there’s an option for slash commands in discord sev portal?
Mark
Mark6d ago
it's a separate file, you need to run node <filename> for it to execute
Cenzo
CenzoOP6d ago
Ohh In shell i tried that too Lemme show
Cenzo
CenzoOP6d ago
No description
Mark
Mark6d ago
the error tells you what's wrong
Cenzo
CenzoOP6d ago
It said “)” this is missing But i don’t understand where is missing
Mark
Mark6d ago
yes, your syntax is incorrect it tells you where it's missing - after the arguments in your function function(arg1, arg2, ...)
Cenzo
CenzoOP6d ago
:blobsweats: Let me try to see 😅
Mark
Mark6d ago
i suggest you brush up on your js skills, these are fundamentals. #resources has several written guides and other sites, and there is #other-js-ts and #useful-servers for general servers like tcd and tph as well
Cenzo
CenzoOP6d ago
Thanks i will read them! Hey mark, thanks for helping me i end up fixing the code I really appreciate your help mark and steve <33

Did you find this page helpful?