Redo some stuff in updateGuild script

This commit is contained in:
powermaker450 2024-10-23 12:12:41 -04:00
parent 0693713bbe
commit c04b6ffc11
2 changed files with 13 additions and 12 deletions

View file

@ -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

View file

@ -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);
}
})
});