Untitled

mail@pastecode.io avatar
unknown
python
20 days ago
1.4 kB
2
Indexable
Never
class SugestaoModal(discord.ui.Modal):
    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):
    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=SugestaoModal())
Leave a Comment