From f93e10ef7d0c9b2ec7579bf5bc03195853e3ca2f Mon Sep 17 00:00:00 2001 From: SiskelDev Date: Thu, 26 Jun 2025 17:55:55 +0200 Subject: [PATCH] Added Reaction Roles --- bot.js | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/bot.js b/bot.js index ff40746..1027c2e 100644 --- a/bot.js +++ b/bot.js @@ -14,7 +14,8 @@ const { request } = require("node:http"); //const { Birthday } = require('./database'); const Instagram = require('instagram-web-api') -const FileCookieStore = require('tough-cookie-filestore2') +const FileCookieStore = require('tough-cookie-filestore2'); +const { channel } = require("node:diagnostics_channel"); const username = config.igusername; @@ -192,7 +193,7 @@ client.on(Events.MessageCreate, async (message) => { }); client.on(Events.MessageReactionAdd, async (reaction, user, channel) => { - if(reaction.message.partial) await reaction.message.fetch(); + /*if(reaction.message.partial) await reaction.message.fetch(); if(reaction.partial) await reaction.fetch(); if(user.bot) return; @@ -204,7 +205,7 @@ client.on(Events.MessageReactionAdd, async (reaction, user, channel) => { if(reaction.emoji.id === '8789972642138767364') { reaction.message.guild.members.cache.get(user.id).roles.add('8779841244749004804') } - } + }*/ }); client.on('interactionCreate', async (interaction) => { @@ -417,17 +418,29 @@ client.on(Discord.Events.GuildMemberAdd, (member) => { // on Reaction Added client.on(Discord.Events.MessageReactionAdd, async (reaction, user, detail) => { - const emoji = reaction._emoji; const emojiId = (emoji.id == null) ? emoji.name : emoji.id; const member = reaction.message.guild.members.cache.get(user.id); const messageID = reaction.message.id; + const channelID = reaction.message.channel.id; - member.roles.add(ReactionRole.role); + // Reaction Role for Rules + if (channelID == 1288527949129318443 && messageID == 1332383887598419968 && emojiId == "🐼") { + member.roles.add("1288955703972728984"); + } else if (channelID == 1288527949129318443 && messageID == 1332383887598419968 && emojiId != "🐼") { + reaction.remove(); + } - // replace with right thing - if (ReactionRoleMessage !== undefined) { + + // Reaction Role for Wuthering Waves + if (channelID == 1288545301543518268 && messageID == 1387778040452616294 && emojiId == "✨") { + member.roles.add("1288956345386663947"); + } else if (channelID == 1288545301543518268 && messageID == 1387778040452616294 && emojiId == "💫") { + member.roles.add("1288954814042083360"); + } else if (channelID == 1288545301543518268 && messageID == 1387778040452616294 && emojiId == "😂") { + member.roles.add("1288957389768491028"); + } else if (channelID == 1288545301543518268 && messageID == 1387778040452616294 && emojiId != "😂") { reaction.remove(); } });