pineafan | 3276721 | 2022-03-14 21:27:39 +0000 | [diff] [blame] | 1 | const {addLog} = require('../scripts/addLogs'); |
| 2 | module.exports = { |
| 3 | name:'stickerDelete', |
| 4 | once:false, |
| 5 | async execute(sticker) { |
| 6 | |
| 7 | let logs = await sticker.guild.fetchAuditLogs({type: 'STICKER_DELETE'}); |
| 8 | let entry = logs.entries.find(e => e.target.id === sticker.id); |
| 9 | |
| 10 | let data = { |
| 11 | id: sticker.id, |
| 12 | deletedAt: entry.createdTimestamp, |
| 13 | description: sticker.description, |
| 14 | name: sticker.name, |
| 15 | type: sticker.type, |
| 16 | tags: sticker.tags, |
| 17 | deletedBy: entry.executor.id |
| 18 | } |
| 19 | |
| 20 | addLog(role.guild.id, data); |
| 21 | |
| 22 | } |
| 23 | } |