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:
interaction: {
id: '1056934697361481808',
type: 2,
commandName: 'find',
user: [User]
}
interaction: {
id: '1056934697361481808',
type: 2,
commandName: 'find',
user: [User]
}
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
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
AJ
AJOP2y ago
Code isn't really necessary in this question I don't think
Parogo_72
Parogo_722y ago
You can pass it through the customId of the button
AJ
AJOP2y ago
Sorry, what do you mean?
Parogo_72
Parogo_722y ago
When you create your button
AJ
AJOP2y ago
Yeah
Parogo_72
Parogo_722y ago
You can put that data you want in the customId
AJ
AJOP2y ago
oh wait so like I can pass an object through there?
Parogo_72
Parogo_722y ago
No
AJ
AJOP2y ago
just a string? and then just separate string?
Parogo_72
Parogo_722y ago
You can do smt like "repeat-category"
AJ
AJOP2y ago
yeah split it by the - nice one
Parogo_72
Parogo_722y ago
And split the string to know whats the data and whats the "real" customId
AJ
AJOP2y ago
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
Want results from more Discord servers?
Add your server