show_modal(Args{
custom_id: "report_modal_123",
title: "Bug Report",
components: func() {
modalcmp_layout_label(Args{label: "Reason"})
},
})
Show Modal
BlockInteractions
Show a modal dialog in response to an interaction.
- Only works in flows started by an interaction: a slash command, button, dropdown, modal or context menu.
Inputs
Custom IDRequired
Custom ID for the modal (1-100 chars).
Example: report_modal_123
TitleRequired
Modal title (1-45 chars).
Example: Bug Report
ComponentsRequired
Between 1 and 5 modal components.
Holds blocks: Modal Label
Build a bot using blocks like Show Modal
Use this block in our visual flow editor. Bots are hosted 24/7 for free on inventor.bot.
Advanced Documentation
This documentation can be useful when using code mode. View as Markdown
ID:
show_modal- Only works in flows started by an interaction trigger (slash commands, buttons, dropdowns, modals, context menus).
Inputs
| Field | InventScript name | Value |
|---|---|---|
| Custom ID | custom_id | e.g. "report_modal_123" |
| Title | title | e.g. "Bug Report" |
| Components | components | blocks: func() { ... } with only modalcmp_layout_label* blocks |
Example InventScript
More interactions blocks
Respond to Interaction with TextSend a text response to an interaction (slash command, button, etc.).Defer InteractionAcknowledge an interaction and show a loading state. Use this when your response will take a while.Respond to Interaction with Advanced MessageSend a Components v2 response to an interaction (slash command, button, etc.).Embed Reply to InteractionSend an embed response to an interaction.Get Interaction Message DataGet message, channel, and server data from an interaction response.