From 93505f26e95e79416c00d2eeba3e29cfd781982e Mon Sep 17 00:00:00 2001 From: WubzyGD Date: Sat, 18 Dec 2021 20:46:03 -0700 Subject: [PATCH] remove fatal bug for message events --- events/messageDelete.js | 1 + events/messageUpdate.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/events/messageDelete.js b/events/messageDelete.js index c81956e..5a146e5 100644 --- a/events/messageDelete.js +++ b/events/messageDelete.js @@ -4,6 +4,7 @@ const channelTypes = ["GUILD_MESSAGE", "DM", "GUILD_NEWS_THREAD", "GUILD_PRIVATE module.exports = async (client, message) => { if (!channelTypes.includes(message.channel.type)) {return;} + if (!message.guild) {return;} //if (!Object.keys(snipe.delete).includes(message.guild.id)) {snipe.delete[message.guild.id] = {};}; //snipe.delete[message.guild.id][message.channel.id] = message; diff --git a/events/messageUpdate.js b/events/messageUpdate.js index 394cb61..38fda2f 100644 --- a/events/messageUpdate.js +++ b/events/messageUpdate.js @@ -9,7 +9,7 @@ module.exports = async (client, oldM, newM) => { //if (!Object.keys(snipe.edit).includes(oldM.guild.id)) {snipe.edit[oldM.guild.id] = {};}; //snipe.edit[oldM.guild.id][oldM.channel.id] = {old: oldM, cur: newM}; - if (!oldM.guild.id) {return;} + if (!oldM.guild) {return;} let ts = client.guildconfig.logs.has(oldM.guild.id) && client.guildconfig.logs.get(oldM.guild.id).has('medit') ? client.guildconfig.logs.get(oldM.guild.id).get('medit') : null; if (ts) {if (oldM.guild.channels.cache.has(ts) && oldM.guild.channels.cache.get(ts).permissionsFor(client.user.id).has("SEND_oldMS")) {