diff --git a/event/listeners/log/channelUpdate.js b/event/listeners/log/channelUpdate.js index b37656d..3ddd35b 100644 --- a/event/listeners/log/channelUpdate.js +++ b/event/listeners/log/channelUpdate.js @@ -11,7 +11,7 @@ class channelUpdateListener extends Listener { async exec(oldChannel, newChannel) { const logStats = await LogStats.findOne({where: {guild: newChannel.guild.id}}); - + if (oldChannel === newChannel) return; if (logStats) { const fetchedLogs = await newChannel.guild.fetchAuditLogs({ limit: 1, diff --git a/event/listeners/log/roleUpdate.js b/event/listeners/log/roleUpdate.js index 34d63b0..45eae9f 100644 --- a/event/listeners/log/roleUpdate.js +++ b/event/listeners/log/roleUpdate.js @@ -12,8 +12,9 @@ class roleUpdateListener extends Listener { }); } - async exec(role) { - const guild = role.guild; + async exec(oldRole, newRole) { + if (oldRole === newRole) return; + const guild = oldRole.guild; const logStats = await LogStats.findOne({where: {guild: guild.id}}); if (logStats) { const fetchedLogs = await guild.fetchAuditLogs({ @@ -27,12 +28,12 @@ class roleUpdateListener extends Listener { let Embed = this.client.util.embed() .setColor('NAVY') .setTitle('Role updated') - .setDescription(`${role.name} got updated!`) + .setDescription(`${oldRole.name} got updated!`) .setTimestamp(); if (!creationLog) return channel.send(Embed); - Embed.setDescription(`${role.name} got updated by ${creationLog.executor}`); + Embed.setDescription(`${oldRole.name} got updated by ${creationLog.executor}`); channel.send(Embed); }