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.
Haha-Yes/event/listeners/log/channelDelete.js

27 lines
769 B
JavaScript

const { Listener } = require('discord-akairo');
const LogStats = require('../../../models/').LogStats;
class channelDeleteListener extends Listener {
constructor() {
super('channelDelete', {
emitter: 'client',
event: 'channelDelete'
});
}
async exec(GuildChannel) {
const logStats = await LogStats.findOne({where: {guild: GuildChannel.guild.id}});
if (logStats) {
console.log(GuildChannel);
const channel = this.client.channels.resolve(await logStats.get('channel'));
let Embed = this.client.util.embed()
.setColor('NAVY')
.setTitle('Channel created!')
.setDescription(`${GuildChannel.type} channel ${GuildChannel.name} got deleted!`)
.setTimestamp();
channel.send(Embed);
}
}
}
module.exports = channelDeleteListener;