penguin-band/register.js
2023-11-24 18:35:58 -06:00

24 lines
535 B
JavaScript

import { REST, Routes } from "discord.js";
const { token, client_id, guild_id } = require("./config.json");
const commands = [
{
name: "hello",
description: "Replies 'world'",
},
];
const rest = new REST({ version: "10" }).setToken(token);
try {
console.log("Started refreshing application (/) commands.");
await rest.put(Routes.applicationGuildCommands(client_id, guild_id), {
body: commands,
});
console.log("Successfully reloaded application (/) commands.");
} catch (error) {
console.error(error);
}