mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-07-11 04:17:58 +00:00
Add docstring example for ui.Modal
This commit is contained in:
parent
a909c1ff06
commit
6788ec2533
@ -59,6 +59,19 @@ class Modal(View):
|
|||||||
|
|
||||||
.. versionadded:: 2.0
|
.. versionadded:: 2.0
|
||||||
|
|
||||||
|
Examples
|
||||||
|
----------
|
||||||
|
|
||||||
|
.. code-block:: python3
|
||||||
|
from discord import ui
|
||||||
|
|
||||||
|
class Questionnaire(ui.Modal, title='Questionnaire Response'):
|
||||||
|
name = ui.TextInput(label='Name')
|
||||||
|
answer = ui.TextInput(label='Answer', style=discord.TextStyle.paragraph)
|
||||||
|
|
||||||
|
async def on_submit(self, interaction: discord.Interaction):
|
||||||
|
await interaction.response.send_message(f'Thanks for your response, {self.name}!', ephemeral=True)
|
||||||
|
|
||||||
Parameters
|
Parameters
|
||||||
-----------
|
-----------
|
||||||
title: :class:`str`
|
title: :class:`str`
|
||||||
|
Loading…
x
Reference in New Issue
Block a user