2019-01-01 08:32:29 +01:00
|
|
|
const { Listener } = require('discord-akairo');
|
2019-01-02 10:21:21 +01:00
|
|
|
const { MessageEmbed } = require('discord.js');
|
2019-01-10 09:00:30 +01:00
|
|
|
const { statsChannel } = require('../../config.json');
|
2019-01-01 08:32:29 +01:00
|
|
|
|
|
|
|
|
|
|
|
class guildCreateListener extends Listener {
|
2019-01-02 08:09:45 +01:00
|
|
|
constructor() {
|
|
|
|
super('guildDelete', {
|
|
|
|
emitter: 'client',
|
2019-01-02 21:46:12 +01:00
|
|
|
event: 'guildDelete'
|
2019-01-02 08:09:45 +01:00
|
|
|
});
|
|
|
|
}
|
2019-01-01 08:32:29 +01:00
|
|
|
|
2019-01-02 08:09:45 +01:00
|
|
|
async exec(guild) {
|
|
|
|
console.log(`***BOT KICKED***\n${guild.name}\n${guild.memberCount} users\nOwner: ${guild.owner.user.username}\nOwner ID: ${guild.owner}\n***BOT KICKED***`);
|
|
|
|
const channel = this.client.channels.get(statsChannel);
|
2019-01-01 08:32:29 +01:00
|
|
|
|
2019-01-02 10:21:21 +01:00
|
|
|
const kickEmbed = new MessageEmbed()
|
2019-01-02 08:09:45 +01:00
|
|
|
.setColor('#FF0000')
|
2019-03-31 00:37:35 +01:00
|
|
|
.setTitle('Some mofo just removed me from there guild :(')
|
2019-01-02 08:09:45 +01:00
|
|
|
.setURL('https://www.youtube.com/watch?v=6n3pFFPSlW4')
|
2019-03-31 00:37:35 +01:00
|
|
|
.setThumbnail(guild.iconURL())
|
|
|
|
.addField('Guild name', guild.name, true)
|
|
|
|
.addField('Guild ID', guild.id, true)
|
2019-04-17 19:11:16 +02:00
|
|
|
.addField('Total numbers of members', guild.memberCount, true)
|
|
|
|
.addField('Number of users', guild.members.filter(member => !member.user.bot).size, true)
|
|
|
|
.addField('Numbers of bot', guild.members.filter(member => member.user.bot).size, true)
|
2019-03-31 00:37:35 +01:00
|
|
|
.addField('Owner', guild.owner.user.username, true)
|
2019-04-01 00:47:37 +02:00
|
|
|
.addField('Owner ID', guild.owner.id, true)
|
2019-04-07 20:53:09 +02:00
|
|
|
.setFooter(`Im now in ${this.client.guilds.size} servers!`)
|
2019-01-02 08:09:45 +01:00
|
|
|
.setTimestamp();
|
2019-01-01 08:32:29 +01:00
|
|
|
|
2019-01-02 08:09:45 +01:00
|
|
|
channel.send({ embed: kickEmbed });
|
|
|
|
}
|
2019-01-01 08:32:29 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = guildCreateListener;
|