return if guild is not cached

Slash-V14
Supositware 3 weeks ago
parent 705921b8d0
commit 7ad4618dd0

@ -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 } });

Loading…
Cancel
Save