added messages when bot join new guild

This commit is contained in:
Loïc Bersier 2018-09-08 19:45:42 +02:00
parent 0457d9d546
commit 5c3fe5915c

View file

@ -29,7 +29,21 @@ client.registry
client.user.setActivity(activity); client.user.setActivity(activity);
const channel = client.channels.get('487766113292124160'); const channel = client.channels.get('487766113292124160');
channel.send(`Ready to serve in ${client.channels.size} channels on ${client.guilds.size} servers, for a total of ${client.users.size} users. ${client.readyAt}`); channel.send(`Ready to serve in ${client.channels.size} channels on ${client.guilds.size} servers, for a total of ${client.users.size} users. ${client.readyAt}`);
}); });
// when bot join a guild send embeds with detail about it
client.on("guildCreate", guild => {
const channel = client.channels.get('487766113292124160');
const exampleEmbed = {
color: 0x0099ff,
title: 'New guild!',
description: `${guild.name}\n${guild.memberCount} users\nOwner: ${guild.owner}`,
timestamp: new Date(),
};
channel.send({ embed: exampleEmbed });
})
// Auto respond to messages // Auto respond to messages
client.on("message", (message) => { client.on("message", (message) => {
if(responseObject[message.content]) { if(responseObject[message.content]) {