© 2026 Hedgehog Software, LLC
await interaction.deferReply({ ephemeral: true }); //Collect Upvotes/individual rankings const x = 0; let messageReacted; for (const msgID of UpvoteContainer.msgID){ //fetch message(s) of ID UpvoteContainer.msgID messageReacted = interaction.client.channels.cache.get(interaction.channelId).messages.fetch(msgID); //const messageReacted = client.channels.cache.get('channelId').messages.fetch('messageId') console.log("messageReacted achievd"); //For Each Reaction on the message(s) ERROR ==> await messageReacted.reactions.cache.forEach(async(reaction) => { <== ERROR //const emojiName = reaction._emoji.name //const emojiCount = reaction.count //const reactionUsers = await reaction.users.fetch(); if (reaction.emoji.id == UpvoteContainer.emojiUpvoteID){ x += reaction.count; } else if (reaction.emoji.id == UpvoteContainer.emojiDownvoteID){ x =- reaction.count; } }); }
TypeError: Cannot read properties of undefined (reading 'cache')