I have my bot reading all messages in all channels and then assigning a role based on there only being the ???? emoji and nothing else.
Const Above All Code
const Discord = require('discord.js');
const bot = new Discord.Client();
const Yard = '694204522528243752';
Code works to read messages
bot.on('message', (message) => {
if (message.content == '????') {
message.member.roles.add(Yard);
}
});
I am attempting to make the bot listen to a single message in a certain channel, Then depending on the the reaction assigning a role/permission group to the user that placed the reactions.
Trying to have bot read reactions instead
bot.on('Reaction Assign Role', async (reaction, user) => {
const filter = (reaction) => reaction.emoji.name === '????';
const rules = message.id('694538155336138752')
await rules.message.id === filter;
message.member.roles.add(Yard);
});
I am not sure how this is suppose to work. I figure the bot is listening for reaction on a target message. If message gets a reaction and the reaction is equal to the filter emoji then add role to the target user.
Not sure how to make the bot listen for reactions on a message by ID. Once I get that I hope I can figure out the rest.