Files
LazyBot/app/slash_commands.js
T
Arthur Puechberty 0a0c419c6b add little config bot
2026-01-15 01:37:43 +01:00

29 lines
618 B
JavaScript

const { REST, Routes } = require('discord.js');
module.exports = async () => {
const TOKEN = process.env.BOT_TOKEN;
const CLIENT_ID = process.env.CLIENT_ID;
const commands = [
{
name: 'ping',
description: 'Replies with Pong!',
},
];
const rest = new REST({ version: '10' }).setToken(TOKEN);
try {
console.log('Started refreshing application (/) commands.');
await rest.put(
Routes.applicationCommands(CLIENT_ID),
{ body: commands }
);
console.log('Successfully reloaded application (/) commands.');
} catch (error) {
console.error(error);
}
};