From dfbc5630f82182960942bf9d725de80c879f588f Mon Sep 17 00:00:00 2001 From: supositware Date: Fri, 17 Jun 2022 02:08:32 +0200 Subject: [PATCH] Rename again --- deploy-guild-commands.cjs => deploy-commands.cjs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) rename deploy-guild-commands.cjs => deploy-commands.cjs (85%) diff --git a/deploy-guild-commands.cjs b/deploy-commands.cjs similarity index 85% rename from deploy-guild-commands.cjs rename to deploy-commands.cjs index 7a59120c..49fb8cad 100644 --- a/deploy-guild-commands.cjs +++ b/deploy-commands.cjs @@ -42,6 +42,12 @@ const commands = [ const rest = new REST({ version: '9' }).setToken(token); -rest.put(Routes.applicationGuildCommands(clientId, guildId), { body: commands }) - .then(() => console.log('Successfully registered application commands.')) +if (process.argv[2] === 'global') { + rest.put(Routes.applicationCommands(clientId), { body: commands }) + .then(() => console.log('Successfully registered application commands globally.')) + .catch(console.error); +} + +rest.put(Routes.applicationGuildCommands(clientId, guildId), { body: commands }) + .then(() => console.log(`Successfully registered application commands for the guild ${guildId}.`)) .catch(console.error);