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 7a59120..49fb8ca 100644 --- a/deploy-guild-commands.cjs +++ b/deploy-commands.cjs @@ -42,6 +42,12 @@ const commands = [ const rest = new REST({ version: '9' }).setToken(token); +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.')) + .then(() => console.log(`Successfully registered application commands for the guild ${guildId}.`)) .catch(console.error);