Don't send log message if the channel changed position ( as to avoid spam )

This commit is contained in:
loicbersier 2020-06-15 03:33:48 +02:00
parent f405116827
commit 67e9ed4d75

View file

@ -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 (oldChannel === newChannel || oldChannel.rawPosition !== newChannel.rawPosition) return;
if (logStats) {
const fetchedLogs = await newChannel.guild.fetchAuditLogs({
limit: 1,