Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

unable to tag members in embed message's title discord.py

My discord bot is suppose to tag people in an embed containing a GIF. I'm using the following code to mention:

embed = discord.Embed(title = f"{member.mention}, I'm sorry...")

However, instead of tagging the member, I get the ID instead: Screenshot

like image 789
RikSantra Avatar asked Dec 31 '22 02:12

RikSantra


1 Answers

Alkes02's answer isn't true.

You can tag (they won't get a notification) people in embeds.

See the below image from my bot: https://gyazo.com/118f0251798afd32bdd23d806c694544

I believe you just take the message's author and add a .mention to the end of the object.

for user in board:
    description += f"**{board.index(user) + 1}.** {user[0].mention} | Level: {user[1]} | 
                   XP: {user[2]}\n"
msg = discord.Embed(
    color=discord.Color.green(),
    title=f"{str(ctx.guild)}" "s Valley Leaderboard",
    description=description,
)

await ctx.send(embed=msg)
like image 150
FerociousKyle Avatar answered Jan 22 '23 11:01

FerociousKyle