Haha-Yes/listeners/guildDelete.js

31 lines
1.1 KiB
JavaScript
Raw Normal View History

2019-01-01 08:32:29 +01:00
const { Listener } = require('discord-akairo');
2019-01-01 08:53:42 +01:00
const Discord = require('discord.js');
2019-01-01 08:35:44 +01:00
const { statsChannel } = require('../config.json');
2019-01-01 08:32:29 +01:00
class guildCreateListener extends Listener {
constructor() {
super('guildDelete', {
emitter: 'client',
eventName: 'guildDelete'
});
}
2019-01-01 08:51:44 +01:00
async exec(guild, client) {
2019-01-01 08:32:29 +01:00
console.log(`***BOT KICKED***\n${guild.name}\n${guild.memberCount} users\nOwner: ${guild.owner.user.username}\nOwner ID: ${guild.owner}\n***BOT KICKED***`);
2019-01-01 08:52:48 +01:00
const channel = this.client.channels.get(statsChannel);
2019-01-01 08:32:29 +01:00
const kickEmbed = new Discord.RichEmbed()
.setColor("#FF0000")
.setTitle('They kicked me out :(')
.setURL('https://www.youtube.com/watch?v=6n3pFFPSlW4')
.setThumbnail(guild.iconURL)
.setDescription(`${guild.name}\n${guild.id}\n${guild.memberCount} users\nOwner: ${guild.owner.user.username}\n(${guild.owner.id})`)
.setTimestamp()
channel.send({ embed: kickEmbed });
console.log('***BOT KICKED***')
}
}
module.exports = guildCreateListener;