Untitled

mail@pastecode.io avatar
unknown
plain_text
20 days ago
1.5 kB
2
Indexable
Never
class CreateSugestion(discord.ui.View):
    def __init__(self):
        super().__init__(timeout=None)
        self.value=None
    @discord.ui.button(label="Sugestao", style=discord.ButtonStyle.blurple, emoji='💡')
    async def sugestao(self, interaction: discord.Interaction, button: discord.ui.Button):
        embedsugestao = discord.Embed(
            colour=26367,
            title='Sugestão4',
            description=f"> Vou mudar depois."
        )
        await interaction.response.send_modal(SugestaoModal())


class SugestaoModal(discord.ui.Modal):
    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 _sugestao(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}\n**Sugestão:** {self.sugestao}'
        )
        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):
    sugestaochannel = interaction.guild.get_channel(id_logs_sugestao)
    await interaction.channel.send(view=CreateSugestion())
Leave a Comment