title: Discord Bot setting someones nickname
body: <p>I am trying to make a Discord bot and I want to make a !nick command and I keep getting the same error, could someone help me:</p>
  
  <p>ERROR:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>{ DiscordAPIError: Missing Permissions
  
      at item.request.gen.end (/rbd/pnpm-volume/76d7cd6d-9602-4908-bb55-ccc4f8de8537/node_modules/.registry.npmjs.org/discord.js/11.4.2/node_modules/discord.js/src/client/rest/RequestHandlers/Sequential.js:79:15)
  
      at then (/rbd/pnpm-volume/76d7cd6d-9602-4908-bb55-ccc4f8de8537/node_modules/.registry.npmjs.org/snekfetch/3.6.4/node_modules/snekfetch/src/index.js:215:21)
  
      at &lt;anonymous&gt;
  
      at process._tickCallback (internal/process/next_tick.js:189:7)
  
    name: 'DiscordAPIError',
  
    message: 'Missing Permissions',
  
    path: '/api/v7/guilds/485921672013283339/members/469227202345697280',
  
    code: 50013,
  
    method: 'PATCH' }</code></pre>
  </div>
  </div>
  
  CODE:
  <div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>const Discord = require("discord.js");
  
  exports.run = (client, message, args, member) =&gt; {
    const arg = args.join(" ")
    if (arg === null || arg === "" || arg === undefined || arg == " ") {
      var embed = new Discord.RichEmbed()
        embed.setColor(0x00AE86);
        embed.addField("USAGE", "!nick (nickname)", false);
      message.channel.send(embed);
    }
    else {
      var embed = new Discord.RichEmbed()
        embed.setColor(0x00AE86);
        embed.addField("NICKNAME", "You have set your nickname to **" + arg + "**", false);
      message.channel.send(embed);
      message.member.setNickname("["+ member.highestRole.name + "]" + member.displayName)
        .then(console.log)
        .catch(console.error);
  }
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>Does anyone know why I am getting this error, if so please tell me <strong>HOW</strong> to fix it. Thank you!</p>