forked from Supositware/Haha-Yes
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
867 B
JavaScript
28 lines
867 B
JavaScript
const { Listener } = require('discord-akairo');
|
|
const LogStats = require('../../../models/').LogStats;
|
|
|
|
class messageDeleteListener extends Listener {
|
|
constructor() {
|
|
super('messageDelete', {
|
|
emitter: 'client',
|
|
event: 'messageDelete'
|
|
});
|
|
}
|
|
|
|
async exec(message) {
|
|
const logStats = await LogStats.findOne({where: {guild: message.guild.id}});
|
|
if (logStats) {
|
|
const channel = this.client.channels.resolve(await logStats.get('channel'));
|
|
let Embed = this.client.util.embed()
|
|
.setColor('NAVY')
|
|
.setAuthor(`${message.author.username}#${message.author.discriminator}`)
|
|
.setDescription(`**${message.author} deleted their message in ${message.channel}**`)
|
|
.addField('Message deleted', message)
|
|
.setFooter(`Author ID: ${message.author.id}`)
|
|
.setTimestamp();
|
|
|
|
channel.send(Embed);
|
|
}
|
|
}
|
|
}
|
|
module.exports = messageDeleteListener; |