blob: cfaed1459c121ff3549797e85faa99ffb0eee017 [file] [log] [blame]
pineafan32767212022-03-14 21:27:39 +00001const {addLog} = require('../scripts/addLogs');
2const JsonDiff = require('json-diff');
3module.exports = {
4 name:'threadUpdate',
5 once:false,
6 async execute(oldThread, newThread) {
7 let ot = {
8 autoArchiveDuration: oldThread.autoArchiveDuration,
9 id: oldThread.id,
10 locked: oldThread.locked,
11 name: oldThread.name,
12 parentChannel: oldThread.parent.id,
13 slowmode: oldThread.rateLimitPerUser,
14 type: oldThread.type,
15 }
16 let nt = {
17 autoArchiveDuration: newThread.autoArchiveDuration,
18 id: newThread.id,
19 locked: newThread.locked,
20 name: newThread.name,
21 parentChannel: newThread.parent.id,
22 slowmode: newThread.rateLimitPerUser,
23 type: newThread.type,
24 }
25
26 let data = JsonDiff.diff(ot, nt, {full: true});
27
28 addLog(newThread.guild.id, data);
29
30 }
31}