From c04b6ffc1156504213b554cdaa304ce7a476fbef Mon Sep 17 00:00:00 2001 From: powermaker450 Date: Wed, 23 Oct 2024 12:12:41 -0400 Subject: [PATCH] Redo some stuff in updateGuild script --- .prettierignore | 15 ++++++++------- src/scripts/updateGuild.ts | 10 +++++----- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/.prettierignore b/.prettierignore index 75e7c9d..ebc56bb 100644 --- a/.prettierignore +++ b/.prettierignore @@ -4,10 +4,11 @@ **/persist # Files -**/.env -**/.prettierrc -**/LICENSE -**/package-lock.json -**/package.json -**/README.md -**/tsconfig.json +.env +.prettierrc +LICENSE +package-lock.json +package.json +README.md +tsconfig.json +pnpm-lock.yaml diff --git a/src/scripts/updateGuild.ts b/src/scripts/updateGuild.ts index f5189c5..ebc55b6 100644 --- a/src/scripts/updateGuild.ts +++ b/src/scripts/updateGuild.ts @@ -26,10 +26,10 @@ if (process.argv.length < 3 || !process.argv[2]) { BotClient.on(Events.ClientReady, () => { try { - BotClient.guilds.fetch(process.argv[2]) - .then(guild => { - deployCommands({ guildId: guild.id }); - console.log(`Updated (/) commands for "${guild.name}".`); + BotClient.fetchGuildPreview(process.argv[2]) + .then(({ id, name }) => { + deployCommands({ guildId: id }); + console.log(`Updated (/) commands for "${name}".`); process.exit(0); }) .catch(err => { @@ -40,4 +40,4 @@ BotClient.on(Events.ClientReady, () => { console.log("An error occurred refreshing (/) commands:", err); process.exit(1); } -}) +});