#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)

upbeat dock
#

im trying to register commands with node src/register-commands.js and i have completed the code but the terminal doesnt seem to respond in this command and im lost to that problem for about an hour please someone dm me or help me here im completly stuck

warped wedge
#

Can you share your code?

upbeat dock
#

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});
}
})();