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

Viewed 6693

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

4 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)

You can't mention user on title, only description. See an example:

@client.command()
async def pollyn(ctx, *, title):
##  ##
await ctx.message.add_reaction('')
embed = discord.Embed(title=title, description=f"{ctx.author.mention} iniciou uma votação.", color=0xff5555)
message = await ctx.send(embed=embed)
await message.add_reaction('')
await message.add_reaction('')
await message.add_reaction('‍♂️')
return 
##  ##

You can't mention people within an embed. If you want the member to be pinged you will have to ping them in a normal message before or after the message.

You can't mention in the title/footer of the embed.

The other parts work, but the mention is still not pinging the user.

Related