1
0
mirror of https://github.com/toast-ts/Daggerbot-TS.git synced 2024-11-17 20:30:58 -05:00
Daggerbot-TS/src/events/messageDeleteBulk.ts

15 lines
860 B
TypeScript
Raw Normal View History

import Discord, { Message, Snowflake } from 'discord.js';
import { TClient } from '../client';
export default {
name: 'messageDeleteBulk',
execute: async(client:TClient, messages:Discord.Collection<Snowflake, Message>)=>{
const channel = client.channels.resolve(client.config.mainServer.channels.logs) as Discord.TextChannel;
if (!client.config.botSwitches.logs) return;
let text = '';
messages.forEach((m)=>{
text += `${m.author.username}: ${m.content}\n`;
});
const embed = new client.embed().setColor(client.config.embedColorRed).setTimestamp().setTitle(`${messages.size} messages were purged`).setDescription(`\`\`\`${text}\`\`\``.slice(0,3900)).addFields({name: 'Channel', value: `<#${(messages.first() as Discord.Message).channel.id}>`});
channel.send({embeds: [embed]})
}
}