#Dynamic embed button responses

1 messages · Page 1 of 1 (latest)

deep linden
#

I don't fully follow this, I'm using interaction.editReply({ embeds: [embed], components: [buttons] }) to send the embed

#

im mostly confused because when you click a button, it generates a completely separate interactionCreate instance

inland geode
#

What's the initial reply

deep linden
#

I don't have one, i call await interaction.deferReply()

inland geode
#

ok fair enough.. you can just reply immediately but that is the safe way to go

#

as for button interactions

deep linden
#

yeah, so currently my setup is basically: receive the command request, call the api im using to fetch data, reply to the user with a simple embed that says "click button a to display some stats, click button b to display other stats"

#

and i have the data available

#

i just dont know how to pass that data to the button click

#

because its generating a completely separate interaction

inland geode
#

you can make an interaction collector within your slash command that fires when the button is pressed

deep linden
#

so that data isnt immediately accessible unless im mistaken..

deep linden
#

ah

#

and id be able to access it from the collector?

tawny plinthBOT
inland geode
#

Use an InteractionCollector

deep linden
#

i've designed this in the past but with emote collectors.. i'll look into interaction collectors instead

#

thanks!

inland geode
deep linden
#

is it possible to stick a collector inside of a slash command file?

#

so that it only collects for those specific interactions?