Skip to content

Commit c45815f

Browse files
committed
try catch guild command registration
1 parent 4596949 commit c45815f

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/commands/CommandManager.js

+8-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,14 @@ export class CommandManager {
122122
(command, guild) => command.isAvailableIn(guild), guild
123123
));
124124

125-
await guild.commands.set(commands);
125+
try {
126+
await guild.commands.set(commands);
127+
}
128+
catch (e) {
129+
if (![RESTJSONErrorCodes.MissingPermissions, RESTJSONErrorCodes.MissingAccess].includes(e.code)) {
130+
await logger.error(`Failed to register commands in guild ${guild.id}`, e);
131+
}
132+
}
126133
}
127134

128135
/**

0 commit comments

Comments
 (0)