Zey
DIAdiscord.js - Imagine an app
•Created by Zey on 8/28/2024 in #djs-questions
error
No i was watching a youtube video
22 replies
DIAdiscord.js - Imagine an app
•Created by Zey on 8/28/2024 in #djs-questions
error
this is the code
22 replies
DIAdiscord.js - Imagine an app
•Created by Zey on 8/28/2024 in #djs-questions
error
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}
);
}
})();22 replies