Can you get more interaction info from the ButtonInteraction object?
So basically, what I mean is I'm creating a command that will allow users to retrieve an image based on a selected category, and the slash command is structured like this
/find category:myquery
(category being an .addStringOption). Once it retrieves the image, it will post it, and then create a button saying 'Repeat'. If they click the button, it should repeat the exact same thing and post another one below. Currently, I'm receiving the ButtonInteraction object, but there's only basic information on the command within the object.
See below for the basic info I get on the interaction it originated from:
Doesn't look like there's any way for me to retrieve hoistedOptions.
I need to know what the option was from the original post.
Let me know what you think, thanks.14 Replies
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Code isn't really necessary in this question I don't think
You can pass it through the customId of the button
Sorry, what do you mean?
When you create your button
Yeah
You can put that data you want in the customId
oh
wait
so like
I can pass an object through there?
No
just a string?
and then just separate string?
You can do smt like "repeat-category"
yeah
split it by the -
nice one
And split the string to know whats the data and whats the "real" customId
thank you
actually
the ButtonInteraction seems to tell you what command the button originated from, so I can just pass the category through there anyway