title: Discord.py - How to (at)mention a Discord user from Bot Command
body: <p><strong>Not really a dupe? Explaination:</strong><br />
  <a href="https://stackoverflow.com/questions/51978974/how-to-mention-a-sender-of-a-command-discord-py">This question is not looking to (at)mention a user</a><br />
  <a href="https://stackoverflow.com/questions/50262096/for-discord-py-how-would-i-turn-the-authors-id-into-the-discord-users-actual">This question lists member.mention but does not provide a complete example</a></p>
  
  <p><strong>My Question</strong><br />
  Using Discord.py (if the title was not clear enough) I am trying to figure out how to add the <strong>@mention</strong> attribute to a Discord user when they run a command. <br /></p>
  
  <p><strong>Example:</strong><br />
  User input: $99<br />
  Bot output: <strong>@User</strong> your quote is: Bingpot!</p>
  
  <p><strong>UPDATE: 10/24/2019</strong> <br />
  - @epic-programmer pointed out a pretty egregious copy-paste error which I have fixed :)<br>
  - That fix sets "member" as an argument for the command.  What I would like to to is get the members display name, and use that in the command output (as an @mention)</p>
  
  <h1>Google Answer</h1>
  
  <pre><code>@commands.command()
  async def mention_ping(self, ctx, member : discord.Member):
      await ctx.send(f"PONG {member}")
  </code></pre>
  
  <h1>My Code (Updated: Use @epic-programmers partial fix)</h1>
  
  <pre><code>import random
  import discord
  
  from discord.ext import commands
  
  #----
  tokenfile = 'token.txt'
  with open(tokenfile) as tf:
      line = tf.readline()
      TOKEN = line.rstrip()
  #----
  
  bot = commands.Bot(command_prefix='$')
  
  @bot.command(name='99', help='Responds with a random quote from Brooklyn 99')
  async def nine_nine(ctx, member : discord.Member):
      brooklyn_99_quotes = [
          'I\'m the human form of the  emoji.',
          'Bingpot!',
          (
              'Cool. Cool cool cool cool cool cool cool, '
              'no doubt no doubt no doubt no doubt.'
          ),
      ]
  
      response = random.choice(brooklyn_99_quotes)
      await ctx.send("{} your quote is: {}".format(member, response))
  
  bot.run( TOKEN)
  </code></pre>
  
  <h1>Resources I've looked at</h1>
  
  <ul>
  <li><a href="https://www.programcreek.com/python/example/107413/discord.Member" rel="nofollow noreferrer">https://www.programcreek.com/python/example/107413/discord.Member</a> </li>
  <li><a href="https://discordpy.readthedocs.io/en/latest/api.html#message" rel="nofollow noreferrer">https://discordpy.readthedocs.io/en/latest/api.html#message</a></li>
  <li><a href="https://github.com/Rapptz/discord.py/blob/master/examples/basic_bot.py#L46-L49" rel="nofollow noreferrer">https://github.com/Rapptz/discord.py/blob/master/examples/basic_bot.py#L46-L49</a></li>
  </ul>