title: Discord.js error = "message is not defined"
body: <pre><code>const Discord = require('discord.js');
  
  exports.run = async (bot, message, args) =&gt; {
      let userInfMent = message.guild.member(message.mentions.users.first() || message.guild.members.get(args[0]))
      message.channel.send(userInfo(userInfMent));
      }
  
  function userInfo(user) {
      const Discord = require('discord.js');
      let userInfMent = message.guild.member(message.mentions.users.first() || message.guild.members.get(args[0]))
      var userCreated = userInfMent.createdAt.toString().split(' ');
      var lastMsg = userInfMent.lastMessage.createdAt.toString().split(' ')
  
      const userInfoEmbed = new Discord.RichEmbed()
      .addField('Никнейм: ', userInfMent.username)
      .addField('Тег: ', userInfMent.tag)
      .addField('ID: ', userInfMent.id)
      .addField('Аккаунт был создан: ', userCreated[1] + ', ' + userCreated[2] + ', ' + userCreated[3])
      .addField('Последнее сообщение: ', userInfMent.lastMessage + ' в ' + lastMsg[1] + ', ' + lastMsg[2] + ', ' + lastMsg[3] + ', ' + lastMsg[4])
      .addField('Статус: ', userInfMent.presence.status)
      .setColor('RANDOM')
      .setThumbnail(userInfMent.avatarURL);
  
      return userInfoEmbed
  }
  </code></pre>
  
  <p><strong>Hi. I'm a Node.js beginner.</strong></p>
  
  <p>When i start the command, in console i see the error: </p>
  
  <blockquote>
    <p>(node:6312) UnhandledPromiseRejectionWarning: ReferenceError: message
    is not defined
        at userInfo (C:\Users\deris\Desktop\Проекты\Node.js\discord.js\JSBot-master\commands\userinfo.js:10:23)
        at Object.exports.run (C:\Users\deris\Desktop\Проекты\Node.js\discord.js\JSBot-master\commands\userinfo.js:5:26)</p>
  </blockquote>