From 28482d08ecc168d691efae37da6e9e3f2545af69 Mon Sep 17 00:00:00 2001 From: loicbersier Date: Sat, 29 Sep 2018 11:21:28 +0200 Subject: [PATCH] removed the bot id cuz it was stupid --- config-exemple.json | 1 - index.js | 9 ++++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/config-exemple.json b/config-exemple.json index 42613ee..2b595d3 100644 --- a/config-exemple.json +++ b/config-exemple.json @@ -2,7 +2,6 @@ "token": "Your token", "prefix": "your prefix", "ownerID": "Your id", - "botID": "ID of the bot", "statsChannel": "ID of the channel that the bot are going to post its stats", "supportServer": "Invite link for the support server of the bot" } \ No newline at end of file diff --git a/index.js b/index.js index 64e72bf..1f4dc2a 100644 --- a/index.js +++ b/index.js @@ -32,12 +32,13 @@ client.registry console.log(`Logged in as ${client.user.tag}! (${client.user.id})`); console.log(`Ready to serve in ${client.channels.size} channels on ${client.guilds.size} servers, for a total of ${client.users.size} users. ${client.readyAt}`); // Send stats to the "stats" channel in the support server if its not the test bot - if (client.user.id === botID) { + if (client.user.id === 377563711927484418) { const channel = client.channels.get(statsChannel); 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}`); client.user.setActivity('"haha help" or "@me help" for help'); } }); + // When bot join a guild send embeds with details about it. client.on("guildCreate", async guild => { console.log(`${guild.name}\n${guild.memberCount} users\nOwner: ${guild.owner.user.username}\nOwner ID: ${guild.owner}`); @@ -50,11 +51,13 @@ client.registry .setTimestamp() channel.send({ embed: addEmbed }); - }) + }); + // When bot get kicked from a guild send embeds with details about it. client.on("guildDelete", async 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 = client.channels.get(statsChannel); + const kickEmbed = new Discord.RichEmbed() .setColor("#FF0000") .setTitle('They kicked me out :(') @@ -63,7 +66,7 @@ client.registry .setTimestamp() channel.send({ embed: kickEmbed }); - }) + }); client.on("message", async (message) => { let message_content = message.content.toLowerCase();