15 Replies
- 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 staffUnknown User•3mo ago
Message Not Public
Sign In & Join Server To View
ok
Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
require('dotenv').config();
const { REST, Routes } = require('discord.js');
const commands = [
{
name: '-bot',
description: 'Im ready!',
},
{
name: '-bot 3',
description: 'Ready!',
},
];
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 commands were registered successfully!');
} catch (error) {
console.log(
There was an error: ${error}
);
}
})();
this is the codeUnknown User•3mo ago
Message Not Public
Sign In & Join Server To View
also im pretty sure - is not an allowed character in names
Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
what is file tree? this?
Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
No i was watching a youtube video
OK
this is why you should not follow youtube videos.
Follow the guide, as told, and make sure you have a basic js understanding
as your error is pretty basic js