From 725b62f11792d297810bb7f633e03d729dcd3711 Mon Sep 17 00:00:00 2001 From: Abheek Dhawan Date: Sat, 3 Apr 2021 12:39:15 -0500 Subject: [PATCH] Attempt to add starboard type functionality --- index.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index efb850e..5daf8f0 100644 --- a/index.js +++ b/index.js @@ -670,11 +670,26 @@ client.on('messageReactionAdd', (messageReaction, user) => { .setFooter("Message ID: " + messageReaction.message.id) .setTimestamp() .setColor('00aaff'); + + const kulboardEmbed = new Discord.MessageEmbed() + .setTitle("Very kül message") + .setURL(messageReaction.message.url) + .setAuthor(messageReaction.message.author.tag, messageReaction.message.author.avatarURL()) + .addField("Message", messageContent) + .addField("Channel", messageReaction.message.channel) + .setFooter("Message ID: " + messageReaction.message.id) + .setTimestamp(); collection.findOne({ guild_id: messageReaction.message.guild.id }, (error, result) => { if (error) { console.error; } - if (result.bot_logs_id) + if (result.kulboard_id) { + kulboardChannel = result.kulboard_id; + if (messageReaction.message.guild.channels.cache.get(kulboardChannel) && messageReaction.emoji.name === "😎" && messageReaction.count > 3) { + messageReaction.message.guild.channels.cache.get(kulboardChannel).send(kulboardEmbed).catch(console.error); + } + } + if (result.bot_logs_id) { botLogsChannel = result.bot_logs_id; if (messageReaction.message.guild.channels.cache.get(botLogsChannel)) { messageReaction.message.guild.channels.cache.get(botLogsChannel).send(messageReactionAddEmbed).catch(console.error);