Pycord modal #1944
Pycord modal
#1944
-
@Lulalaby Hello @bot.slash_command(name="test",)
async def text(ctx: discord.ApplicationContext, text:str):#the text arg is the text to import
...
class MyModal(discord.ui.Modal):
def __init__(self, *args, **kwargs) -> None:
super().__init__(*args, **kwargs)
self.add_item(discord.ui.InputText(label=text)) # i want to show the command text arg
async def callback(self, interaction: discord.Interaction):
await ctx.response.send_message("Hey")
class MyButton(discord.ui.Button):
async def callback(self, interaction: discord.Interaction):
await interaction.response.send_modal(MyModal(title="Modal via Button")) thank you in advance |
Beta Was this translation helpful? Give feedback.
Answered by
Lulalaby
Feb 25, 2023
Replies: 1 comment
-
Don't ping us.. Read the guide and the documentation. It's 100% in there. If you need further help, join https://discord.gg/pycord. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Lulalaby
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Don't ping us..
Read the guide and the documentation. It's 100% in there.
If you need further help, join https://discord.gg/pycord.