mirror of
https://github.com/DerTyp7/discord-twitch-bot.git
synced 2025-10-29 12:52:12 +01:00
28 lines
607 B
JavaScript
28 lines
607 B
JavaScript
const { REST, Routes } = require("discord.js");
|
|
const config = require("./config");
|
|
|
|
const commands = [
|
|
{
|
|
name: "setup",
|
|
description: "Setup Twitch bot!",
|
|
},
|
|
];
|
|
|
|
const rest = new REST({ version: "10" }).setToken(config.token);
|
|
|
|
async function registerCommands() {
|
|
try {
|
|
console.log("Started refreshing application (/) commands.");
|
|
|
|
await rest.put(Routes.applicationCommands(config.clientId), {
|
|
body: commands,
|
|
});
|
|
|
|
console.log("Successfully reloaded application (/) commands.");
|
|
} catch (error) {
|
|
console.error(error);
|
|
}
|
|
}
|
|
|
|
module.exports = { registerCommands };
|