blob: a3e85db871db17d3f930b6f053d10914c5d4b079 [file] [log] [blame]
const {addLog} = require('../scripts/addLogs');
module.exports = {
name:'guildScheduledEventDelete',
once:false,
async execute(event) {
let logs = await event.guild.fetchAuditLogs({'type': 'GUILD_SCHEDULED_EVENT_DELETE'});
let log = logs.entries.find(log => log.target.id === event.id);
let data = {
id: event.id,
name: event.name,
deletedAt: log.createdTimestamp,
deletedBy: log.executor.id
}
addLog(event.guild.id, data);
}
}