add little config bot

This commit is contained in:
Arthur Puechberty
2026-01-15 01:37:43 +01:00
parent a4d93afaa3
commit 0a0c419c6b
5 changed files with 140 additions and 3 deletions
+28
View File
@@ -0,0 +1,28 @@
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);
}
};