Hide Embed Content

So I have something like this working for my bot. Essential the bottom embed tells the bot to consume any reply made to this message and where to store that response (modals don't allow emojis, mentions, etc). But it isn't exactly a pleasant solution. I was wondering if there is anyway to hide content within an embed. The top embed stores final values until the user presses save and they are stored on a database.
9 Replies
d.js toolkit
d.js toolkit12mo ago
• 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.
lupus
lupus12mo ago
If you set the description of an embed, it will always be shown to the user in the way you set it. You can mark it as a spoiler to semi-hide it from the user, but other than that, there‘s no solution to hide an embed description. I don‘t know how your code in itself works, but maybe you could just try storing those values in a variable as an object or string instead of putting them into the embed?
It's Manny
It's Manny12mo ago
Yeah the spoiler might be my best bet I think, appreciate the suggestion. And normally I would do that but I don't want the menu to timeout after a certain period. Trying to keep all the information on there so it can be parsed when a user needs it again.
Darth Vader
Darth Vader12mo ago
I'd encode it in base64 so it looks like an id or something, which is a little less ugly if a user opens the spoiler
lupus
lupus12mo ago
Oh, I see. Another solution in that case might be to store it in a map/collection in a parent scope and then map those values by message ID. Or store it in a temporary file if you need it to survive a bot restart.
It's Manny
It's Manny12mo ago
yeah lol thanks, I'll be sure to do that well I could always create a separate database table for these, just tried not to
lupus
lupus12mo ago
I see - it does depend on whether those menus are supposed to time out at all - if not, it’ll slowly fill your database with unused menu data, so storing it in the message may actually be a good way.
It's Manny
It's Manny12mo ago
yeah that was my thought process But thanks for the suggestions guys
lupus
lupus12mo ago
You’re welcome