pineafan | 3276721 | 2022-03-14 21:27:39 +0000 | [diff] [blame^] | 1 | const {addLog} = require('../scripts/addLogs'); |
| 2 | const JsonDiff = require('json-diff'); |
| 3 | module.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 | } |