Skip to content

Using Modal() with Hybrid Commands #8122

Discussion options

You must be logged in to vote
class myModal(discord.ui.Modal):
  def __init__(self, title:str=None, label:str=None, placeholder:str=None, min_length:int=1, max_length:int=300, form_style=discord.TextStyle.long, custom_id:str=None, required:bool=True) -> None:
    super().__init__(title=title, custom_id=custom_id)

    self.add_item(
            discord.ui.TextInput(
              label = label,
              style = form_style,
              placeholder = placeholder,
              required = required,
              max_length = max_length,
            )
          )


  async def on_submit(self, interaction: discord.Interaction):
    await interaction.response.send_message(f"Submitting form! Wait!... {self.children[0].v…

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@iagolirapasssos
Comment options

@anselal
Comment options

@iagolirapasssos
Comment options

@anselal
Comment options

@Bluesy1
Comment options

Answer selected by iagolirapasssos
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants