Untitled
unknown
python
a year ago
1.0 kB
9
Indexable
class NotificarBotaoTicket(discord.ui.Button):
def __init__(self, label, style, emoji, user):
super().__init__(label=label, style=style, emoji=emoji)
self.user = user
async def callback(self, interaction: discord.Interaction):
embed = discord.Embed(
color=26367,
description=f'Seu ticket foi atendido! Nossa equipe está te aguardando {interaction.channel.mention}'
)
# Enviando a mensagem para o canal atual
await interaction.response.send_message(f'Usuário notificado', ephemeral=True)
# Enviando uma DM para o usuário que criou o ticket
try:
dm_channel = await self.user.create_dm()
await dm_channel.send(embed=embed)
except discord.Forbidden:
# Se o bot não puder enviar uma mensagem direta
await interaction.response.send_message("Não consegui enviar uma mensagem direta, o perfil do usuário é bloqueado.", ephemeral=True)
Editor is loading...
Leave a Comment