Skip to content

Commit

Permalink
Merge pull request #506 from aternosorg/v3
Browse files Browse the repository at this point in the history
try catch guild command registration
  • Loading branch information
JulianVennen authored Oct 24, 2022
2 parents da80472 + c45815f commit 99e5bbf
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/commands/CommandManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,14 @@ export class CommandManager {
(command, guild) => command.isAvailableIn(guild), guild
));

await guild.commands.set(commands);
try {
await guild.commands.set(commands);
}
catch (e) {
if (![RESTJSONErrorCodes.MissingPermissions, RESTJSONErrorCodes.MissingAccess].includes(e.code)) {
await logger.error(`Failed to register commands in guild ${guild.id}`, e);
}
}
}

/**
Expand Down

0 comments on commit 99e5bbf

Please sign in to comment.