return if guild is not cached

This commit is contained in:
Supositware 2024-08-28 14:44:48 +02:00
parent 705921b8d0
commit 7ad4618dd0

View file

@ -7,6 +7,7 @@ const { statusChannel, NODE_ENV } = process.env;
export default { export default {
name: 'guildDelete', name: 'guildDelete',
async execute(guild, client) { async execute(guild, client) {
if (!guild.available) return;
const guildOwner = await client.users.fetch(guild.ownerId); const guildOwner = await client.users.fetch(guild.ownerId);
const isOptOut = await db.optout.findOne({ where: { userID: guildOwner.id } }); const isOptOut = await db.optout.findOne({ where: { userID: guildOwner.id } });