#hello im new to java script and i watched some videos trying to make a discord bot but an error came
4 messages · Page 1 of 1 (latest)
Can you share your code?
its a casual register command code
require('dotenv').config();
const { REST, Routes } = require( 'discord.js' );
const commands = [
{
name: 'hey',
description: 'Replies with hey',
},
];
const rest = new REST({ version: '10' }).setToken(procces.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 registered.')
} catch (error) {
console.log(Error: ${error});
}
})();