#How to make a button that will open a modal window

1 messages · Page 1 of 1 (latest)

nova sable
#

Good afternoon, I have a problem, the problem is that I do not know how to make a button open a modal window, can someone send a code for such a button?

hollow hull
#

-d disnake.MessageInteraction.responce.send_modal

hardy pathBOT
hollow hull
#

-d disnake.InteractionResponce.send_modal

hardy pathBOT
#

await send_modal(modal=None, *, title=None, custom_id=None, components=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).

Responds to this interaction by displaying a modal.

New in version 2.4.

Note

Not passing the `modal` parameter here will not register a callback, and a [`on_modal_submit()`](https://docs.disnake.dev/en/latest/api.html#disnake.on_modal_submit "disnake.on_modal_submit") interaction will need to be handled manually.
brisk wolfBOT
#
interactions/modal.py

An example demonstrating two methods of sending modals and handling modal responses.

hollow hull
#

@nova sable here you are