Pulling reactions not working when the message has a button attached
Hello when I run this code I get Collection(0) [Map] {} giving me no reactions to loop through. But when I try the same code on another message that does not have a button on it, I get this: Collection(1) [Map] { with my beloved reactions inside of it.
how can I fix this? @.gwapes
43 Replies
- What's your exact discord.js
npm list discord.js
and node node -v
version?
- Post the full error stack trace, not just the top part!
- Show your code!
- Explain what exactly your issue is.
- Not a discord.js issue? Check out #useful-servers.
- Issue solved? Press the button!Here is an image example of what I am looking at
Unknown User•17mo ago
Message Not Public
Sign In & Join Server To View
I assumed so sorry
Unknown User•17mo ago
Message Not Public
Sign In & Join Server To View
this is my log when I do it on the message in the image above
Collection(0) [Map] {}
It gives me what I want
Unknown User•17mo ago
Message Not Public
Sign In & Join Server To View
yea im real stumped tried googling and chatgpt
Unknown User•17mo ago
Message Not Public
Sign In & Join Server To View
yeah its really specific
was there also an embed in that message?
Unknown User•17mo ago
Message Not Public
Sign In & Join Server To View
yeah definitely
Unknown User•17mo ago
Message Not Public
Sign In & Join Server To View
const reaction = await message.reactions.cache.first();
^
TypeError: Cannot read properties of undefined (reading 'cache')
Unknown User•17mo ago
Message Not Public
Sign In & Join Server To View
message.reactions.cache = Collection(0) [Map] {}
error:
const users = await reaction.users.fetch();
^
TypeError: Cannot read properties of undefined (reading 'users')
exact same code on a different message with reactions works like a charm
Unknown User•17mo ago
Message Not Public
Sign In & Join Server To View
pass it through a function
Unknown User•17mo ago
Message Not Public
Sign In & Join Server To View
Here's the whole code, a lot of it won't be relevant
Unknown User•17mo ago
Message Not Public
Sign In & Join Server To View
It just doesnt seem to be caching the reactions
when I apply the same code to another message it seems to be caching it
message.reactions has: reactions: [Circular *1],
then message.reactions.cache = Collection(0) [Map] {}
Unknown User•17mo ago
Message Not Public
Sign In & Join Server To View
its so weird, because what runs this code is a button, and I want that button to be on the same message that the reactions will be on, but if I make two seperates messages containing this button and I press the older one, but still using the code to pull reacts from the newer message it will work, but doing the same thing with the new message I get no reactions cached
Unknown User•17mo ago
Message Not Public
Sign In & Join Server To View
I got these two messages, and when I reload the bot and press the top one first it works fine and then also press the bottom after that and it works fine
Unknown User•17mo ago
Message Not Public
Sign In & Join Server To View
(the code is coded to get reactions from the bottom message no matter what button I press)
have tried
same result
Unknown User•17mo ago
Message Not Public
Sign In & Join Server To View
IntentsBitField { bitfield: 38659 }
Unknown User•17mo ago
Message Not Public
Sign In & Join Server To View
I might shoot myself
discord is trolling me
Unknown User•17mo ago
Message Not Public
Sign In & Join Server To View
its gaslighting me by workign sometimes
and then not working the next
Unknown User•17mo ago
Message Not Public
Sign In & Join Server To View
this worked like a charm before I tried it with the buttons idk
wtf
like how does it work when I press the above button
but not the one below
same code
Unknown User•17mo ago
Message Not Public
Sign In & Join Server To View
Oh my god
My heroes
Unknown User•17mo ago
Message Not Public
Sign In & Join Server To View
No both
I will forever be in your debt
Unknown User•17mo ago
Message Not Public
Sign In & Join Server To View