Search code examples
discorddiscord.py

Ask. How to mention the sender and the person they mentioned (discord py.)


I tried to do it in different ways, but none gave the desired result. I need to use it in an embed.

I am new to this area and have not found any information.

What I want to achieve

Screenshot translation: @name spit @name


Solution

  • Try to explain your question a bit more and show code you have tried, you can use {ctx.author.mention} to mention the member that used the command and {member.mention} to mention the member that was @ make sure to call the member by useinf member :discord.Member in your async def ( )

    Example:

    async def hi(ctx, member : discord.Member):
      await ctx.send(f"{ctx.author.mention} said hi to {member.mention}")