blob: a3e85db871db17d3f930b6f053d10914c5d4b079 [file] [log] [blame]
pineafan32767212022-03-14 21:27:39 +00001const {addLog} = require('../scripts/addLogs');
2
3module.exports = {
4 name:'guildScheduledEventDelete',
5 once:false,
6 async execute(event) {
7
8 let logs = await event.guild.fetchAuditLogs({'type': 'GUILD_SCHEDULED_EVENT_DELETE'});
9 let log = logs.entries.find(log => log.target.id === event.id);
10
11 let data = {
12 id: event.id,
13 name: event.name,
14 deletedAt: log.createdTimestamp,
15 deletedBy: log.executor.id
16 }
17
18 addLog(event.guild.id, data);
19 }
20}