#Can you get more interaction info from the ButtonInteraction object?

22 messages · Page 1 of 1 (latest)

pliant beacon
#

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]
}

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.

bold ginkgo
#

• 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.

pliant beacon
#

Code isn't really necessary in this question I don't think

paper dust
pliant beacon
#

Sorry, what do you mean?

paper dust
#

When you create your button

pliant beacon
#

Yeah

paper dust
#

You can put that data you want in the customId

pliant beacon
#

oh

#

wait

#

so like

#

I can pass an object through there?

paper dust
#

No

pliant beacon
#

just a string?

#

and then just separate string?

paper dust
#

You can do smt like "repeat-category"

pliant beacon
#

yeah

#

split it by the -

#

nice one

paper dust
#

And split the string to know whats the data and whats the "real" customId

pliant beacon
#

thank you

#

actually