From 5c3fe5915cf05a3bdcae965c00b39609d5b3604b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Bersier?= Date: Sat, 8 Sep 2018 19:45:42 +0200 Subject: [PATCH] added messages when bot join new guild --- index.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/index.js b/index.js index 853a1995..f218a5ab 100644 --- a/index.js +++ b/index.js @@ -29,7 +29,21 @@ client.registry client.user.setActivity(activity); 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}`); + }); +// 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 client.on("message", (message) => { if(responseObject[message.content]) {