I began adding reaction roles onto my bot and it worked. However, the reaction events don’t seem to work after restarting the bot. After some research I managed to find out it has something to do with message caching but I’m not entirely sure what about it.
Here’s the reaction code:
client.on('messageReactionAdd', async (reaction, user) => {
if (user.bot) return;
if (reaction.message.partial) reaction.message.fetch()
if (reaction.partial) reaction.fetch()
if (reaction.emoji.id === '791026439452360714') {
reaction.message.guild.members.cache.get(user.id).roles.add('799416358373949470')
}
});