1
0
mirror of https://github.com/toast-ts/Daggerbot-TS.git synced 2024-09-30 00:50:59 -04:00
Daggerbot-TS/src/events/messageDeleteBulk.ts

11 lines
761 B
TypeScript
Raw Normal View History

import Discord from 'discord.js';
2023-01-27 21:33:55 -05:00
import TClient from '../client';
export default {
2023-03-05 05:04:10 -05:00
run(client:TClient, messages:Discord.Collection<string, Discord.Message<boolean>>){
if (!client.config.botSwitches.logs) return;
if (client.config.mainServer.id != '468835415093411861') return;
const channel = client.channels.resolve(client.config.mainServer.channels.logs) as Discord.TextChannel;
2023-04-10 04:30:47 -04:00
channel.send({embeds: [new client.embed().setColor(client.config.embedColorRed).setTimestamp().setTitle(`${messages.size} messages were purged`).setDescription(`\`\`\`${messages.map((msgs)=>`${msgs.author?.username}: ${msgs.content}`).reverse().join('\n').slice(0,3900)}\`\`\``).addFields({name: 'Channel', value: `<#${messages.first().channel.id}>`})]})
2023-03-05 05:04:10 -05:00
}
}