diff --git a/cogs/commands.py b/cogs/commands.py index 049127c..58985d1 100755 --- a/cogs/commands.py +++ b/cogs/commands.py @@ -312,3 +312,16 @@ class Commands(commands.Cog): async def _getid(self, ctx): await ctx.message.add_reaction(emoji = '✅') return await ctx.send("Explication sur comment récuperer l'ID d'un utilisateur/salon : https://cdn.discordapp.com/attachments/640312926892195842/780802253258358834/GetID.mp4") + + @commands.command(name='avatar') + async def _avatar(self, ctx, *, user = '0'): + """Affiche ton avatar ou celui que tu mentionnes.\n ➡ Syntaxe: .avatar [user]""" + if user == '0': + user = ctx.author + else: + user = self.bot.get_user(int(user[2:-1].replace("!",""))) + await ctx.message.add_reaction(emoji = '✅') + embed = discord.Embed(description = f"[lien vers la photo de profil]({user.avatar_url}) de {user.mention}", color = randint(0, 0xFFFFFF)) + embed.set_author(name = f"Photo de profil de {user.name}") + embed.set_image(url = user.avatar_url) + await ctx.send(embed = embed)