mirror of
https://github.com/toast-ts/Daggerbot-TS.git
synced 2024-11-17 20:30:58 -05:00
15 lines
860 B
TypeScript
15 lines
860 B
TypeScript
|
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]})
|
||
|
}
|
||
|
}
|