From 5889109b1ea6710e367b8e49f342173d8a4983bc Mon Sep 17 00:00:00 2001 From: Tobiah Date: Tue, 2 Nov 2021 15:17:48 -0500 Subject: [PATCH] fix: handle missing guild when generating custom commands --- src/eventHandlers/InteractionHandler.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/eventHandlers/InteractionHandler.js b/src/eventHandlers/InteractionHandler.js index d79ca85dd..0d3ac6f21 100644 --- a/src/eventHandlers/InteractionHandler.js +++ b/src/eventHandlers/InteractionHandler.js @@ -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));