Changed embed to rich embed

This commit is contained in:
loicbersier 2018-09-26 13:35:43 +02:00
parent 5e01961405
commit 881a855cdc

View file

@ -1,4 +1,5 @@
const { CommandoClient } = require('discord.js-commando'); const { CommandoClient } = require('discord.js-commando');
const Discord = require('discord.js');
const path = require('path'); const path = require('path');
const { token, prefix, botID, statsChannel, ownerID, supportServer } = require('./config.json'); const { token, prefix, botID, statsChannel, ownerID, supportServer } = require('./config.json');
const responseObject = require("./json/reply.json"); const responseObject = require("./json/reply.json");
@ -41,12 +42,11 @@ client.registry
client.on("guildCreate", async guild => { client.on("guildCreate", async guild => {
console.log(`${guild.name}\n${guild.memberCount} users\nOwner: ${guild.owner.user.username}\nOwner ID: ${guild.owner}`); console.log(`${guild.name}\n${guild.memberCount} users\nOwner: ${guild.owner.user.username}\nOwner ID: ${guild.owner}`);
const channel = client.channels.get(statsChannel); const channel = client.channels.get(statsChannel);
const addEmbed = { const addEmbed = new Discord.RichEmbed()
color: 0x008000, .setColor("#FF0000")
title: 'Im in a new guild! :D YAY', .setTitle('Someone added me ! YAY :D')
description: `${guild.name}\n${guild.memberCount} users\nOwner: ${guild.owner.user.username}\nOwner ID: ${guild.owner}`, .setDescription(`${guild.name}\n${guild.memberCount} users\nOwner: ${guild.owner.user.username}\nOwner ID: ${guild.owner}`)
timestamp: new Date(), .setTimestamp()
};
channel.send({ embed: addEmbed }); channel.send({ embed: addEmbed });
}) })
@ -54,13 +54,12 @@ client.registry
client.on("guildDelete", async guild => { 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***`); 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 channel = client.channels.get(statsChannel);
const kickEmbed = { const kickEmbed = new Discord.RichEmbed()
color: 0xFF0000, .setColor("#FF0000")
title: 'They kicked me out :(', .setTitle('They kicked me out :(')
description: `${guild.name}\n${guild.memberCount} users\nOwner: ${guild.owner.user.username}\nOwner ID: ${guild.owner}`, .setDescription(`${guild.name}\n${guild.memberCount} users\nOwner: ${guild.owner.user.username}\nOwner ID: ${guild.owner}`)
timestamp: new Date(), .setTimestamp()
};
channel.send({ embed: kickEmbed }); channel.send({ embed: kickEmbed });
}) })