#how can i pass any data to the interaction button?
23 messages · Page 1 of 1 (latest)
• 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.
I can get this data via embed, but it's a crutch.
Do you need to handle the button in another file or can you also use a button collector in the file you have the data in you need?
Handling buttons in separate files is usually required when making a "persistent collector", I guess
Well, for a „persistent“ collector you need to persist the data you need somehow obviously… database would be advisable in most cases then
I haven't heard much about button collector
Suggestion for @native portal:
Interactions: Receiving button interactions
read more
This is what my message looks like, I need to pass this data to the button to create a new ticket (in database)
I can save to the database in advance at the time of preview, but the person can click "dismiss" and the ticket in the database will remain
Since this is on an ephemeral message a button collector would be perfect for this
what if a person creates for a very long time?
Ephemeral messages won’t be around for a very long time, so…
And collectors won’t work beyond bot restarts
Why awaitMessageComponent is only triggered by the second click of a button
I don't quite get it, it just returns the ButtonInteraction that I'm already getting here
I just need to get the values to use their in handler button (TicketCreateButton)
the value is indicated by an arrow on the screen
Don’t make a ButtonHandler class for the button. Make the collector inside the command that send the message containing the buttons
And in that scope you have the data you used for the embed still available
i think this is impossible because sending a message is done in a modal handler (ModalSubmitInteraction) and the message is null
Why would the message be null? If you send it you can fetchReply it. Then you have the message right there
I understood what you meant, it dawned on me