From 7ad4618dd0169a2825eb433a2edea240ba1f6103 Mon Sep 17 00:00:00 2001 From: Supositware Date: Wed, 28 Aug 2024 14:44:48 +0200 Subject: [PATCH] return if guild is not cached --- events/client/guildDelete.js | 1 + 1 file changed, 1 insertion(+) diff --git a/events/client/guildDelete.js b/events/client/guildDelete.js index 88f88ba6..f8363b15 100644 --- a/events/client/guildDelete.js +++ b/events/client/guildDelete.js @@ -7,6 +7,7 @@ const { statusChannel, NODE_ENV } = process.env; export default { name: 'guildDelete', async execute(guild, client) { + if (!guild.available) return; const guildOwner = await client.users.fetch(guild.ownerId); const isOptOut = await db.optout.findOne({ where: { userID: guildOwner.id } });