mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-04-19 15:36:02 +00:00
Add docstring example for ui.Modal
This commit is contained in:
parent
a909c1ff06
commit
6788ec2533
@ -58,6 +58,19 @@ class Modal(View):
|
||||
This object must be inherited to create a modal popup window within discord.
|
||||
|
||||
.. 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
|
||||
-----------
|
||||
|
Loading…
x
Reference in New Issue
Block a user