import { REST, Routes } from "discord.js"; const { TOKEN, CLIENT_ID, GUILD_ID } = require("./config.json"); const commands = [ { name: "hello", description: "Replies 'world'", }, { name: "topicking", description: "Pulls team and addup channel members into picking channel", }, { name: "end", description: "Pulls team and addup channel members into picking channel", }, { name: "resetteams", description: "Pulls team channel members into picking channel", }, { name: "fatkid", description: "Moves added players to picking and randomly selects fatkids", }, { name: "fk", description: "Moves added players to picking and randomly selects fatkids", }, /*{ name: "testfk", description: "debug fk", },*/ { name: "fklist", description: "Pulls addup channel members into fk channel and lists them", }, { name: "listfk", description: "Pulls addup channel members into fk channel and lists them", }, { name: "clear", description: "Clears bot messages in command channel", }, { name: "bclear", description: "Clears bot messages in command channel", }, { name: "scout", description: "Lists picking channel members with scout role", }, { name: "soldier", description: "Lists picking channel members with soldier role", }, { name: "pyro", description: "Lists picking channel members with pyro role", }, { name: "demo", description: "Lists picking channel members with demo role", }, { name: "demoman", description: "Alias of /demo", }, { name: "heavy", description: "Lists picking channel members with heavy role", }, { name: "engineer", description: "Lists picking channel members with engineer role", }, { name: "engi", description: "Alias of /engineer", }, { name: "medic", description: "Lists picking channel members with medic role", }, { name: "sniper", description: "Lists picking channel members with sniper role", }, { name: "spy", description: "Lists picking channel members with spy role", }, { name: "pick", description: "Automatically picks teams", }, { name: "autocaptain", description: "Automatically picks teams", }, ]; const rest = new REST({ version: "10" }).setToken(TOKEN); try { console.log("Started refreshing application (/) commands."); // application reload await rest.put(Routes.applicationCommands(CLIENT_ID), { body: commands, }); // guild reload, faster than application reload //await rest.put(Routes.applicationGuildCommands(CLIENT_ID, GUILD_ID), { // body: commands, //}); // clear guild commands //await rest.put(Routes.applicationGuildCommands(CLIENT_ID, GUILD_ID), { // body: [], //}); console.log("Successfully reloaded application (/) commands."); } catch (error) { console.error(error); }