blob: 92d9134030f3ed8be845b5bc2122fd5b61667058 [file] [log] [blame]
pineafan32767212022-03-14 21:27:39 +00001const {addLog} = require('../scripts/addLogs');
2
3module.exports = {
4 name:'messageDeleteBulk',
5 once:false,
6 async execute(messages) {
7
8 let logs = await messages.first().guild.fetchAuditLogs({type: 'MESSAGE_DELETE_BULK'});
9 let entry = logs.entries.first();
10
11 let data = {
12 messages:messages.map(message=>{
13 return {
14 id:message.id,
15 channel:message.channel.id,
16 content:message.content
17 }
18 }),
19 deletedBy:entry.executor.id,
20 deletedAt:entry.createdAt
21 }
22
23 addLog(messages.first().guild.id, data);
24 }
25}