Untitled
unknown
python
a year ago
1.4 kB
7
Indexable
class Botao(discord.ui.View):
def __init__(self):
super().__init__(timeout=None)
@discord.ui.button(label="Sugestao", style=discord.ButtonStyle.blurple, emoji='💡')
async def on_submit(interaction:discord.Interaction):
embedsugestao = discord.Embed(
colour=26367,
title='Sugestão4',
description=f"> Vou mudar depois."
)
await interaction.response.send_modal(SugestaoModal())
class SugestaoModal(discord.ui.Modal):
def __init__(self):
super().__init__()
self.nome = discord.ui.TextInput(label='Nome', placeholder='Digite o seu nome', max_length=15)
self.sugestao = discord.ui.TextInput(label='Sugestão', style=discord.TextStyle.long, max_length=1000)
async def on_submit(self, interaction: discord.Interaction):
logschannel = interaction.guild.get_channel(id_logs_sugestao)
embed = discord.Embed(
color= 26367,
title= 'Sugestão',
description= f'**Nome** {self.nome.value}\n**Sugestão:** {self.sugestao.value}'
)
await logschannel.send(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_modal(view=SugestaoModal())Editor is loading...
Leave a Comment