Passing data between interactions
Hi everyone,
I'm looking for suggestions on how to handle passing data between interactions in discord.js. Currently, I use the customId for buttons, select menus, and similar components, as most do. However, the 100-character limit of customId is restrictive, and I need to pass more data than it allows.
For example, one button fetches some data, and later, when another button is clicked, I need to reuse that same information. I'd like to avoid querying the database or an external API again.
Has anyone encountered this situation or have any recommendations on best practices? Should I consider caching, storing data in memory, or is there another more suitable approach?
I'm looking for suggestions on how to handle passing data between interactions in discord.js. Currently, I use the customId for buttons, select menus, and similar components, as most do. However, the 100-character limit of customId is restrictive, and I need to pass more data than it allows.
For example, one button fetches some data, and later, when another button is clicked, I need to reuse that same information. I'd like to avoid querying the database or an external API again.
Has anyone encountered this situation or have any recommendations on best practices? Should I consider caching, storing data in memory, or is there another more suitable approach?