Skip to content

Commit 0ef7c8d

Browse files
authored
Add perfil command to display user profile information
1 parent f629957 commit 0ef7c8d

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

command/infos/perfil.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
from database import checar_saldo
2+
import discord
3+
from discord.ext import commands
4+
5+
intents = discord.Intents.default()
6+
intents.members = True
7+
8+
bot = commands.Bot(command_prefix='+', intents=intents)
9+
10+
@bot.tree.command(name="perfil", description="Veja o Perfil de Alguém!")
11+
async def perfil(interaction: discord.Interaction, user: discord.Member):
12+
13+
embed = discord.Embed(
14+
title=f"Perfil de {user}",
15+
colour=discord.Colour.dark_blue(),
16+
)
17+
18+
saldo = await checar_saldo(user)
19+
20+
joined = user.joined_at.strftime("%d/%m/%Y %H:%M:%S") if user.joined_at else "Indisponível"
21+
22+
embed.set_footer(text=f"MoonCoins: {saldo} | Entrou em: {joined}")
23+
24+
await interaction.response.send_message(embed=embed)

0 commit comments

Comments
 (0)