title: How to mention a user in a message with discord.js?
body: <p>I am implementing a command to mute users. For example, the following command would mute the user <code>@anon</code> for 5 seconds:</p>
  
  <pre><code>!mute @anon 5
  </code></pre>
  
  <p>My program listens for the <code>message</code> event, mutes the user and sends a confirmation message like this:</p>
  
  <pre><code>@anon#1234 has now been muted for 5 s
  </code></pre>
  
  <p>Unfortunately Discord does not recognize the username in this message as a mention. How can I mention a specific user with the <code>msg.channel.send</code> function? This sample includes the code which sends the confirmation message:</p>
  
  <pre class="lang-js prettyprint-override"><code>bot.on("message", msg =&gt; {
      let args = msg.content.substring(PREFIX.length).split(" ")
      let time = args[2]
      let person = msg.guild.member(msg.mentions.users.first() || msg.guild.members.fetch(args[1]))
  
      // muting the user here and sending confirmation message
      msg.channel.send(`@${person.user.tag} has now been muted for ${time} s`)
  
      setTimeout(() =&gt; {
          // unmuting the user after specified time and 
          // sending confirmation message
          msg.channel.send(`@${person.user.tag} has been unmuted.`)
      }, time * 1000);
  })
  </code></pre>
  
  <p>The muting is not included in this sample, it works. The messages are being sent correctly but the user is not mentioned, meaning the username is not clickable and doesn't get highlighted.</p>