Haha-Yes/listeners/guildCreate.js

28 lines
925 B
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 {
2019-01-02 08:09:45 +01:00
constructor() {
super('guildCreate', {
emitter: 'client',
eventName: 'guildCreate'
});
}
2019-01-01 08:32:29 +01:00
2019-01-02 08:09:45 +01:00
async exec(guild) {
console.log(`${guild.name}\n${guild.memberCount} users\nOwner: ${guild.owner.user.username}\nOwner ID: ${guild.owner}`);
const channel = this.client.channels.get(statsChannel);
const addEmbed = new Discord.RichEmbed()
.setColor('#52e80d')
.setTitle('Someone added me ! YAY :D')
.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: addEmbed });
}
2019-01-01 08:32:29 +01:00
}
module.exports = guildCreateListener;