Untitled
unknown
python
a year ago
1.3 kB
5
Indexable
class BotaoSugestao(discord.ui.View): def __init__(self): super().__init__(timeout=None) embedsugestao = discord.Embed( colour=26367, title='Sugestão', description=f"> Vou mudar depois." ) @discord.ui.button(label="Sugestao", style=discord.ButtonStyle.blurple, emoji='💡') async def on_submit(self, interaction:discord.Interaction, view=View): await interaction.response.send_modal(SugestaoModal()) class SugestaoModal(discord.ui.Modal): def __init__(self): super().__init__(title='sugestão') nome = discord.ui.TextInput(label='Nome', placeholder='Digite o seu nome', max_length=15) sugestao = discord.ui.TextInput(label='Sugestão', style=discord.TextStyle.long, max_length=1000) async def on_submit(self, interaction: discord.Interaction): embed = discord.Embed( color= 16722474, description= f'**Nome**: {self.nome}\n**Sugestão**: {self.sugestao}' ) await interaction.response.send_message(embed=embed) @tree.command(guild=discord.Object(id=1254562365316399195),name="sugestao",description='Adicionar uma sugestão') async def _sugestao(interaction:discord.Interaction): await interaction.response.send_message(view=BotaoSugestao())
Editor is loading...
Leave a Comment