More information in modals
Is there a way to add a description to a modal? I want to add a bit more info about the modal but the title doesn't accept that many characters and that isn't the best place anyway.
What about additional lines of text between the text input boxes?
What I'm trying to do is display different modals based on the slash command the user picks and give them information about the character they selected. The modal will show them what they need to do for each step and when necessary, collect information for what they chose to do for the step (there are some where they just reset a dial so I don't need input from them for that. I just want to remind them to do it).
If modal isn't the best choice for this, what should I use and what's a good tutorial out there for that option.
14 Replies
- What's your exact discord.js
npm list discord.js
and node node -v
version?
- Not a discord.js issue? Check out #other-js-ts.
- Consider reading #how-to-get-help to improve your question!
- Explain what exactly your issue is.
- Post the full error stack trace, not just the top part!
- Show your code!
- Issue solved? Press the button!discord.js version: [email protected]
node version: v22.14.0
So more details about what I'm doing.
Some friends and I are playing Aliens: Another Glorious Day in the Corps via play by post and Foundry VTT. Each person has 7 steps they take during their turn and I have to open several windows to see what my actions are, what cards I have in my hand, etc. and then post all my choices on discord every time.
I want to give the players a form that shows them the steps and what they need to do at each step. Since each character has different options, I need different modals for each person.
Example for Ripley:
1. reset aim dial
2. resolve all on activation abilities - draw 1 card; recycle two cards
3. equip endurance cards
4. perform up to two actions
- move: move up to character's speed
- attack: reduce aim dial by one after attack
- barricade: <= tech number
- aim: increase aim by 1
- interact: see mission details
- card action
- rest: may draw up to two cards from the endurance deck and then may recycle up to three cards from the exhaust pile or their hand
5. resolve all end of activation abilities - none
6. use rank to activate grunts
7. pass the activation token
There are also passive actions the user can do at any time and I want to make a note of that for them as well as their stats like speed, tech, defense, etc. I'm not going to keep track of cards and things like that. I just want the users to say "I equiped the pulse rifle"

Current Modal for character Apone. I don't need input for steps 1 and 5 in this case but the user needs to see the steps

only text input is available for modals and "description" like things are not available
for a more card-like look i'd suggest checking out components v2 whenever those are dropping (our last info is soon™️ from discord)
they allow sections with buttons on the side, so for each step you could have a container "card" with a button to the side to pop a modal for those that need it
that would still require some state managing as you'd need to/probably want to update the "cards" with the input when the modal is sent
"cards" here means the visual, not the cards you refer to above
understood. I'll check that out
for now you can still di something similar with buttons but currently they will always display below the embed
for (4) you might be able to use a select menu
you can disable options as you select them to prevent re-selection of the same value
same deal tho, currently displays at the bottom of the message
for 4 they can do the same action twice so no need to disable after selection

that's the kind of sectioning "card" behavior i mean
where there are images there can also be a button, so it clearly belongs to a section
the permissions button is within the container vs. below in current embeds
reckon that capability would work nicely with your requirements - or at least be less painful to work around
that would work as long as I can output everything so all users can see like i've done here with the modal results, well sort of

sure, the ephemerality "only you can see this" is by choice
as selections/input happens you can reflect that on the message itself if you want
you can also try to model that on embeds for now with the components displaying at the bottom of the message to try some general design concepts
components v2 will be more free in a sense but generally work with similar structures
Thanks. I'll look into all that and see what I can come up with
if you need help with a specific step, make a post! people will usually gladly help if you are specific enough
components v2 will take some more time until discord flips the experiment switch off - the library is ready for it
also to answer the original question clearly again:
modals are limited to text input components and cannot have a description or other input elements