remove fatal bug for message events

master
Kit Kasune 3 years ago
parent b46edb2256
commit 93505f26e9
  1. 1
      events/messageDelete.js
  2. 2
      events/messageUpdate.js

@ -4,6 +4,7 @@ const channelTypes = ["GUILD_MESSAGE", "DM", "GUILD_NEWS_THREAD", "GUILD_PRIVATE
module.exports = async (client, message) => { module.exports = async (client, message) => {
if (!channelTypes.includes(message.channel.type)) {return;} 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] = {};}; //if (!Object.keys(snipe.delete).includes(message.guild.id)) {snipe.delete[message.guild.id] = {};};
//snipe.delete[message.guild.id][message.channel.id] = message; //snipe.delete[message.guild.id][message.channel.id] = message;

@ -9,7 +9,7 @@ module.exports = async (client, oldM, newM) => {
//if (!Object.keys(snipe.edit).includes(oldM.guild.id)) {snipe.edit[oldM.guild.id] = {};}; //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}; //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; 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")) { if (ts) {if (oldM.guild.channels.cache.has(ts) && oldM.guild.channels.cache.get(ts).permissionsFor(client.user.id).has("SEND_oldMS")) {

Loading…
Cancel
Save