title: Discord.js permission
body: <p>I'm making a discord bot using the discord.js module, and i'm planning to make these features:</p>
  <ol>
  <li>Kicking (and blocking) users</li>
  <li>Setting the user's nickname</li>
  <li>Managing channels</li>
  <li>Assigning &amp; Creating Roles</li>
  <li>Editing &amp; Creating the channel</li>
  </ol>
  <p>And I want to limit these (section 1, 2, 4) capabilities to a Server Moderator or Manager. What permissions bit flag should I use? Currently I am using <code>1475677686</code>.</p>
  <h2>Here is my code</h2>
  <p><code>Kick Command</code>:</p>
  <pre class="lang-js prettyprint-override"><code>if(!message.member.hasPermission(&quot;ADMINISTRATOR&quot;)){
    return message.reply(&quot;You don't have permission to do that.&quot;);
  }
  
  if(message.mentions.users.size === 0){
    return message.reply(&quot;Usage: `_kick [mention]`&quot;);
  }
  
  message.mentions.members.forEach((member) =&gt; {
    member.ban({
      reason: &quot;Banned by admin&quot;,
      days: 7
    }).then((value) =&gt; {
      message.reply(&quot;Succeed to kick member&quot;);
    }).catch((error) =&gt; {
      message.reply(&quot;Internal bot error&quot;);
      console.error(error);
    });
  });
  </code></pre>
  <p><code>Nickname Command</code>:</p>
  <pre class="lang-js prettyprint-override"><code>if(!message.member.hasPermission(&quot;ADMINISTRATOR&quot;)){
    return message.reply(&quot;You don't have permission to do that.&quot;);
  }
  
  var nickname = message.content.replace(&quot;_nickname &quot;, &quot;&quot;);
  
  if(nickname.trim() === &quot;&quot;){
    return message.reply(&quot;Enter the nickname.&quot;);
  }
  
  if(message.mentions.users.size === 0){
    return message.reply(&quot;Usage: `_nickname [mention] [nick]`&quot;);
  }
  
  message.mentions.members.forEach((member) =&gt; {
    nickname = nickname.replace(&quot;&lt;@!&quot; + member.id + &quot;&gt; &quot;, &quot;&quot;);
    member.setNickname(nickname).then((value) =&gt; {
      message.reply(&quot;Succeed to change nickname&quot;);
    }).catch((error) =&gt; {
      message.reply(&quot;Internal bot error&quot;);
      console.error(error);
    });
  });
  </code></pre>