From a06d70c730acbf81c8e9072ed9ce91681afd25e7 Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Thu, 21 May 2020 16:41:01 -0400 Subject: Added embeds when booting the bot and addeed auto role --- bot_discord.js | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'bot_discord.js') diff --git a/bot_discord.js b/bot_discord.js index 4a9b109..340aee7 100644 --- a/bot_discord.js +++ b/bot_discord.js @@ -160,6 +160,11 @@ rl.on('line', function(cmd){ break; case "exit": console.log('[i] AleeBot will now exit!'.blue) + const embed = new Discord.RichEmbed() + .setAuthor("AleeBot Status", client.user.avatarURL) + .setDescription("AleeBot is now going offline...") + .setColor("#ff3333") + client.channels.find('id', '606602551634296968').send({embed}); client.destroy(); process.exit(0); break; @@ -198,7 +203,7 @@ client.on('ready', () => { 'Fighting AstralMod', ]; setInterval(() => { - dbl.postStats(client.guilds.size, client.shards.Id, client.shards.total); + dbl.postStats(client.guilds.size, client.shards.id, client.shards.total); }, 1800000); client.user.setPresence({ status: 'online', @@ -210,10 +215,22 @@ client.on('ready', () => { }); }, 200000); client.user.setStatus('online'); - client.channels.find('id', '606602551634296968').send("**AleeBot Status:** AleeBot has started."); + const embed = new Discord.RichEmbed() + .setAuthor("AleeBot Status", client.user.avatarURL) + .setDescription("AleeBot has started") + .setColor("#5cd65c") + client.channels.find('id', '606602551634296968').send({embed}); rl.prompt(); }); +client.on('guildMemberAdd', member => { + if (member.guild.id != '243022206437687296') return 0 + var role = member.guild.roles.find((role) => role.name === "Member"); + member.addRole(role); + log(`[i] ${member.user.username} joined Alee Productions.`.green); + log(`[i] I gave ${member.user.username} the "Member" role.`.green); +}); + client.on('guildCreate', guild => { log(`[i] New guild joined: ${guild.name} (id: ${guild.id}). This guild has ${guild.memberCount} members!`.blue); @@ -246,7 +263,7 @@ client.on('message', (msg) => { if (msg.content.toLowerCase().includes("shut") && msg.content.toLowerCase().includes("up")) { switch (Math.floor(Math.random() * 1000) % 3) { case 0: - msg.reply("Excuse me? Can you not speak to me in that tone...") + msg.reply("Hey, Can you not speak to me in that tone...") break; case 1: msg.reply("NO! I can talk as much I can!"); -- cgit v1.2.3