#105 taught moho to run slash commands and press the buttons a message carries. There
is a third answer Discord can give to a command, and it is the one that goes nowhere:
an interaction modal - a small form the server asks you to fill in and submit.
INTERACTION_MODAL_CREATE is not handled. There is not a single occurrence of "modal"
in nobilis/src/backend/discord.rs, so a command that answers with one is a command
that appears to do nothing at all: no form, no error, no line in the log. The commands
that do this are ordinary ones - a bot asking for a title and a description, a report
form, an application.
What is needed
Handle the INTERACTION_MODAL_CREATE dispatch and carry its component tree to the
client, the way note_components already does for message components
(extract_components, backend/discord.rs).
A dialog in the renderer built from that tree: text inputs, short and paragraph,
with the labels and placeholders the server sent.
Submit as interaction type 5 (MODAL_SUBMIT) through the same /interactions path run_command and use_component already use.
Done looks like: a command that opens a form opens a form here, and submitting it
gets the same answer the official client gets.
Reference: the official Discord client. Follows #105.
#105 taught moho to run slash commands and press the buttons a message carries. There
is a third answer Discord can give to a command, and it is the one that goes nowhere:
an **interaction modal** - a small form the server asks you to fill in and submit.
`INTERACTION_MODAL_CREATE` is not handled. There is not a single occurrence of "modal"
in `nobilis/src/backend/discord.rs`, so a command that answers with one is a command
that appears to do nothing at all: no form, no error, no line in the log. The commands
that do this are ordinary ones - a bot asking for a title and a description, a report
form, an application.
**What is needed**
- Handle the `INTERACTION_MODAL_CREATE` dispatch and carry its component tree to the
client, the way `note_components` already does for message components
(`extract_components`, `backend/discord.rs`).
- A dialog in the renderer built from that tree: text inputs, short and paragraph,
with the labels and placeholders the server sent.
- Submit as interaction type 5 (`MODAL_SUBMIT`) through the same `/interactions` path
`run_command` and `use_component` already use.
**Done looks like:** a command that opens a form opens a form here, and submitting it
gets the same answer the official client gets.
Reference: the official Discord client. Follows #105.
Handled in nobilis 2aee7a2, with the dialog in moho 6ea68c3.
INTERACTION_MODAL_CREATE is read in the gateway dispatch and its component tree carried to the client. The fields arrive as the bot described them - which are a single line and which are a paragraph, which may be left empty, and how long each may be - so the form the renderer draws is the bot's form and not a generic box. Submitting goes back through the same /interactions path run_command and use_component already use, as interaction type 5.
A command that answers with a form now opens one.
Finished.
Handled in nobilis [2aee7a2](https://git.salastil.com/Salastil/nobilis/commit/2aee7a23bf59b2b27a624312b45f1c27ce5e0c1a), with the dialog in moho [6ea68c3](https://git.salastil.com/Salastil/moho/commit/6ea68c3).
`INTERACTION_MODAL_CREATE` is read in the gateway dispatch and its component tree carried to the client. The fields arrive as the bot described them - which are a single line and which are a paragraph, which may be left empty, and how long each may be - so the form the renderer draws is the bot's form and not a generic box. Submitting goes back through the same `/interactions` path `run_command` and `use_component` already use, as interaction type 5.
A command that answers with a form now opens one.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
#105 taught moho to run slash commands and press the buttons a message carries. There
is a third answer Discord can give to a command, and it is the one that goes nowhere:
an interaction modal - a small form the server asks you to fill in and submit.
INTERACTION_MODAL_CREATEis not handled. There is not a single occurrence of "modal"in
nobilis/src/backend/discord.rs, so a command that answers with one is a commandthat appears to do nothing at all: no form, no error, no line in the log. The commands
that do this are ordinary ones - a bot asking for a title and a description, a report
form, an application.
What is needed
INTERACTION_MODAL_CREATEdispatch and carry its component tree to theclient, the way
note_componentsalready does for message components(
extract_components,backend/discord.rs).with the labels and placeholders the server sent.
MODAL_SUBMIT) through the same/interactionspathrun_commandanduse_componentalready use.Done looks like: a command that opens a form opens a form here, and submitting it
gets the same answer the official client gets.
Reference: the official Discord client. Follows #105.
Finished.
Handled in nobilis 2aee7a2, with the dialog in moho 6ea68c3.
INTERACTION_MODAL_CREATEis read in the gateway dispatch and its component tree carried to the client. The fields arrive as the bot described them - which are a single line and which are a paragraph, which may be left empty, and how long each may be - so the form the renderer draws is the bot's form and not a generic box. Submitting goes back through the same/interactionspathrun_commandanduse_componentalready use, as interaction type 5.A command that answers with a form now opens one.