Untitled

mail@pastecode.io avatar
unknown
python
14 days ago
761 B
0
Indexable
Never
class BotaoCall(discord.ui.Button):
    def __init__(self, label, style):
        super().__init__(label=label, style=style)
    async def callback(self, interaction: discord.Interaction):
        guild = interaction.guild.get_channel(id_canal_chamada_suporte)

        channel = await guild.create_voice_channel(interaction.user.name)
        channel = await channel.edit(user_limit=2)


        canalTemporario.append(channel.id)

        await interaction.response.send_message(f'Entre na sua chamada {channel.mention}. Canal será excluído após 20s de inatividade.', ephemeral=True)

        while True:
            await asyncio.sleep(20)
            if not channel.members:
                await channel.delete()
                return
Leave a Comment