From 9c37208e96dca6011f7925d304bb2edf21b0e231 Mon Sep 17 00:00:00 2001 From: Abheek Dhawan Date: Wed, 31 Mar 2021 14:33:10 -0500 Subject: [PATCH] Add channel create event --- index.js | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index 2892c84..028a8e0 100644 --- a/index.js +++ b/index.js @@ -36,12 +36,23 @@ client.on('messageUpdate', (originalMessage, editedMessage) => { const editEmbed = new Discord.MessageEmbed() .setTitle("Message Edited") .addField("Author", editedMessage.author.tag) - .addField("Message", `<${originalMessage}\n>${editedMessage}`) + .addField("Message", `<< ${originalMessage}\n>> ${editedMessage}`) .setThumbnail(editedMessage.author.avatarURL()) .setFooter("ID: " + editedMessage.id) .setTimestamp() - .setColor('004444'); - editedMessage.guild.channels.cache.get("826876551756513314").send(editEmbed).catch(console.error); + .setColor('006699'); + editedMessage.guild.channels.cache.get("826876551756513314").send(editEmbed).catch(console.error); +}); + +client.on('channelCreate', channel => { + const editEmbed = new Discord.MessageEmbed() + .setTitle("Channel Created #️⃣") + .addField("Name", channel.name) + .addField("Category", channel.category) + .setFooter("ID: " + channel.id) + .setTimestamp() + .setColor('006699'); + editedMessage.guild.channels.cache.get("826876551756513314").send(editEmbed).catch(console.error); }); client.login(process.env.BOT_TOKEN);