Skip to content

Commit

Permalink
fix: handle missing guild when generating custom commands
Browse files Browse the repository at this point in the history
  • Loading branch information
TobiTenno committed Nov 2, 2021
1 parent fedfbab commit 5889109
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/eventHandlers/InteractionHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ module.exports = class InteractionHandler extends require('../models/BaseEventHa
// fetch can fail due to missing access. swallow error.
guild = await this.client.guilds.fetch(gid);
} catch (ignore) { /* Ignored */ }
if (!guild) continue; // probably should consider checking if the bot is in the server?
const guildCCs = grouped[gid];
guildCCs.length = 50;
await guild?.commands?.set(guildCCs.filter(c => c));
Expand Down

0 comments on commit 5889109

Please sign in to comment.