Select Menu Collector
Having some trouble with my collector, per usual since last time I did it took me forever as well. Just threw this together looking through some docs, tutorials, and stackoverflow. The menu pops up and my options are correct but my collector just never collects. Discord.js Version 14.14.1, node version 18.16.0, here's my code:
10 Replies
- What's your exact discord.js
npm list discord.js
and node node -v
version?
- Not a discord.js issue? Check out #other-js-ts.
- Consider reading #how-to-get-help to improve your question!
- Explain what exactly your issue is.
- Post the full error stack trace, not just the top part!
- Show your code!
- Issue solved? Press the button!
- ✅
Marked as resolved by OPmy immediate guess is my filter is wrong, probably the latter half. but not sure how to check the interaction id correctly
without specifying
fetchReply: true
in your reply
options, reply
resolves in an InteractionResponse
currently there's a few issues with collectors created from InteractionResponse
s, including collecting from ephemeral messages
therefore you'd want to specify fetchReply: true
so that it resolves in a Message
insteadinteresting, well i added that flag at least. still no dice it seems though
Though you are correct here
Your menu's custom id is menu, not the interaction id
any idea if I can retrieve the custom id from the interaction?
also, i assume just hard coding the menu ID like that doesn't really help the custom id at all? cuz they'll all just have the same custom ID
<ComponentInteraction>.customId would be the custom id of the component that was interacted with
That being said, it doesn't really matter what or how your custom id is set if you only intend to utilize components once
You also aren't required to filter by custom id at all at that point
i found where to grab it from the response after some digging, and that was my thought as well but what about the edge case where a use has 2 menus open at once?
then the filters will catch the others. obviously that shouldn't happen. but it could i suppose
Creating a collector from a message will only listen for interactions from that message
hmmmm welp yea i'm overthinking it lol
thanks for the help