From dc1961d2247bdbbcad8dfa720e3a46e004e0262d Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Tue, 12 Jul 2022 19:49:42 -0400 Subject: Fixed about; No longer requiring guild id for deploy command --- deploy-command.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'deploy-command.js') diff --git a/deploy-command.js b/deploy-command.js index f04872e..cd698ee 100644 --- a/deploy-command.js +++ b/deploy-command.js @@ -2,7 +2,7 @@ import fs, { readFileSync } from 'node:fs'; import { REST } from '@discordjs/rest'; import { Routes } from 'discord-api-types/v10'; // import config from './config.json' assert {type: 'json'} -const config = JSON.parse(readFileSync('./config.json')); +const { clientID, token } = JSON.parse(readFileSync('./config.json')); const commands = []; const commandFiles = fs.readdirSync('./commands').filter(file => file.endsWith('.js')); @@ -12,8 +12,8 @@ for (const file of commandFiles) { commands.push(command.data.toJSON()); } -const rest = new REST({ version: '10' }).setToken(config.token); +const rest = new REST({ version: '10' }).setToken(token); -rest.put(Routes.applicationGuildCommands(config.clientID, config.guildID), { body: commands }) +rest.put(Routes.applicationCommands(clientID), { body: commands }) .then(() => console.log('Successfully registered application commands.')) .catch(console.error); -- cgit v1.2.3