From eb73be580f66316933525356e20b6818809fd767 Mon Sep 17 00:00:00 2001 From: Unknown Date: Sat, 24 Feb 2018 10:29:18 -0500 Subject: [PATCH] Bulk delete event --- bot.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/bot.js b/bot.js index 4744ed1..e335423 100644 --- a/bot.js +++ b/bot.js @@ -63,6 +63,20 @@ bot.on('guildMemberRemove', (member) => { bot.channels.get('416633835216830495').send(`**${member.user.tag}** just left. We now have ${member.guild.memberCount} members left. Aww man...`); }); +bot.on('messageDeleteBulk', (msgs) => { + try { + const embed = new Discord.RichEmbed() + .setColor(0x00ae86) + .setTitle(`:wastebasket: ${msgs.size}`) + .setDescription(`${msgs.size} messages in *${msgs.first().channel}* were bulk deleted.`) + .setTimestamp() + .setFooter('Messages purged'); + msgs.first().guild.channels.find('name', 'logs').send({ embed }); + } + catch (err) { + console.error(err.stack); + } +}); bot.on('message', (msg) => { parseCommand(msg);