log guildId in pushCommands script

This commit is contained in:
Wroclaw 2023-05-10 03:03:45 +02:00
parent 312f22827e
commit 48b9ec02a0

View file

@ -22,13 +22,14 @@ const rest = new REST().setToken(config.tokens.Discord);
(async () => { (async () => {
const me = await rest.get(Routes.oauth2CurrentApplication()) as RESTGetAPIOAuth2CurrentApplicationResult; const me = await rest.get(Routes.oauth2CurrentApplication()) as RESTGetAPIOAuth2CurrentApplicationResult;
console.log(`Started refreshing ${post.length} application commands.`); if (guildId && guildId != "") {
if (guildId && guildId != "") console.log(`Started refreshing ${post.length} application guild (${guildId}) commands.`);
await rest.put( await rest.put(
Routes.applicationGuildCommands(me.id, guildId), Routes.applicationGuildCommands(me.id, guildId),
{ body: post }, { body: post },
); );
else { } else {
console.log(`Started refreshing ${post.length} application global commands.`);
await rest.put( await rest.put(
Routes.applicationCommands(me.id), Routes.applicationCommands(me.id),
{ body: post }, { body: post },