mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-10-22 00:13:01 +00:00
Update modal example in docstring
This commit is contained in:
@@ -70,11 +70,11 @@ class Modal(BaseView):
|
|||||||
from discord import ui
|
from discord import ui
|
||||||
|
|
||||||
class Questionnaire(ui.Modal, title='Questionnaire Response'):
|
class Questionnaire(ui.Modal, title='Questionnaire Response'):
|
||||||
name = ui.TextInput(label='Name')
|
name = ui.Label(text='Name', component=ui.TextInput())
|
||||||
answer = ui.TextInput(label='Answer', style=discord.TextStyle.paragraph)
|
answer = ui.Label(text='Answer', component=ui.TextInput(style=discord.TextStyle.paragraph))
|
||||||
|
|
||||||
async def on_submit(self, interaction: discord.Interaction):
|
async def on_submit(self, interaction: discord.Interaction):
|
||||||
await interaction.response.send_message(f'Thanks for your response, {self.name}!', ephemeral=True)
|
await interaction.response.send_message(f'Thanks for your response, {self.name.component.value}!', ephemeral=True)
|
||||||
|
|
||||||
Parameters
|
Parameters
|
||||||
-----------
|
-----------
|
||||||
|
Reference in New Issue
Block a user