From dac7ef365977462c73b323030d3ad3e3f1d701e8 Mon Sep 17 00:00:00 2001 From: WubzyGD Date: Wed, 25 Aug 2021 10:12:53 -0600 Subject: [PATCH] event bugs --- events/guildCreate.js | 2 +- events/guildMemberAdd.js | 2 +- events/messageUpdate.js | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/events/guildCreate.js b/events/guildCreate.js index b2ca907..f348130 100644 --- a/events/guildCreate.js +++ b/events/guildCreate.js @@ -19,7 +19,7 @@ module.exports = async (client, guild) => { .setTitle(guild.name) .setThumbnail(guild.iconURL({size: 2048})) .addField('Owner', client.users.cache.get(guild.ownerId).tag, true) - .addField('Members', guild.members.cache.size, true) + .addField('Members', `${guild.members.cache.size}`, true) .addField('Position', `Server #${client.guilds.cache.size}`, true) .setColor('55ff7f') .setFooter('Natsuki') diff --git a/events/guildMemberAdd.js b/events/guildMemberAdd.js index f837d38..0ea20cd 100644 --- a/events/guildMemberAdd.js +++ b/events/guildMemberAdd.js @@ -14,6 +14,6 @@ module.exports = async (client, member) => { && member.guild.channels.cache.get(tg.wch).permissionsFor(client.user.id).has("SEND_MESSAGES") && !client.users.cache.get(member.id).bot ) { - try {member.guild.channels.cache.get(tg.wch).send(await sendResponse(member, member.guild.channels.cache.get(tg.wch), 'xdlol', client, tr.responses.get(tr.bindings.get('welcome'))));} catch {} + try {member.guild.channels.cache.get(tg.wch).send(await sendResponse(member, member.guild.channels.cache.get(tg.wch), 'xdlol', client, tr.responses.get(tr.bindings.get('welcome'))).catch(() => {}));} catch {} } }; \ No newline at end of file diff --git a/events/messageUpdate.js b/events/messageUpdate.js index 213b049..394cb61 100644 --- a/events/messageUpdate.js +++ b/events/messageUpdate.js @@ -9,6 +9,8 @@ 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;} + 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")) { let embed = new Discord.MessageEmbed()