Discord uses special formatting for pings: <@user_id>
. With discord.py, there are two easy ways to ping a user:
# If you have the ctx object (inside a command)
await ctx.send(ctx.message.author.mention)
# If you have a message object (such as the on_message event)
await message.channel.send(message.author.mention)
# If you know their ID
await ctx.send("<@" + str(user_id) + ">")
Confusion