blob: cfaed1459c121ff3549797e85faa99ffb0eee017 [file] [log] [blame]
const {addLog} = require('../scripts/addLogs');
const JsonDiff = require('json-diff');
module.exports = {
name:'threadUpdate',
once:false,
async execute(oldThread, newThread) {
let ot = {
autoArchiveDuration: oldThread.autoArchiveDuration,
id: oldThread.id,
locked: oldThread.locked,
name: oldThread.name,
parentChannel: oldThread.parent.id,
slowmode: oldThread.rateLimitPerUser,
type: oldThread.type,
}
let nt = {
autoArchiveDuration: newThread.autoArchiveDuration,
id: newThread.id,
locked: newThread.locked,
name: newThread.name,
parentChannel: newThread.parent.id,
slowmode: newThread.rateLimitPerUser,
type: newThread.type,
}
let data = JsonDiff.diff(ot, nt, {full: true});
addLog(newThread.guild.id, data);
}
}