props to button

Is it possible to pass props to button ? Like a variable for example
Solution:
FWIW for @Spinel (sapphiredev/spinel on GH) we use Redis and for @Dragonite I chuck the data in customId with compression like so: https://github.com/favware/dragonite/blob/main/src/lib/util/utils.ts Keep in mind that customId is max length 100...
GitHub
dragonite/src/lib/util/utils.ts at main · favware/dragonite
A Pokémon information Discord bot built around Discord Interactions - favware/dragonite
Jump to solution
7 Replies
Mateleo
Mateleo12mo ago
from chatInputRun --> InteractionHandler And also what about interaction.options ?
Favna
Favna12mo ago
It is not (discord api limitations). You have to chuck it in the customId And somehow pack it in or put a reference then get it from an in memory store or redis or DB Not sure what you mean by this
Mateleo
Mateleo12mo ago
I have an addUserOption() in the slash command So I would like to retrieve the data in the button logic too
Favna
Favna12mo ago
Yeah same about chucking it in customId
Mateleo
Mateleo12mo ago
Thks a lot will try something like this
Solution
Favna
Favna12mo ago
FWIW for @Spinel (sapphiredev/spinel on GH) we use Redis and for @Dragonite I chuck the data in customId with compression like so: https://github.com/favware/dragonite/blob/main/src/lib/util/utils.ts Keep in mind that customId is max length 100
GitHub
dragonite/src/lib/util/utils.ts at main · favware/dragonite
A Pokémon information Discord bot built around Discord Interactions - favware/dragonite
Mateleo
Mateleo12mo ago
Your solution is working perfectly thnks !
Want results from more Discord servers?
Add your server