title: Nickname all members in a discord server
body: <p>I'm trying to make a script that can nickname all the people on a discord server I would like it to rename all the members and not only the active ones for the moment I have this</p>
  <pre><code>module.exports.run = async (client, msg, args, config) =&gt; {
  msg.delete();
  const guild = client.guilds.get(&quot;888868333498290176&quot;);
      if(!msg.guild.me.hasPermission(&quot;MANAGE_NICKNAMES&quot;)) return console.log('Cette commande a besoin de permissions')
      await msg.guild.members.cache;
      let members = msg.guild.id
  
      if (args.join(&quot; &quot;).length &gt; 32) return msg.reply('Le nom ne peut pas dépasser 32 caractères.')
      console.log('Modifier le surnom de ' + members.length + ' member(s), attendez un moment.')
      for(let i = 0; i &lt; members.length; i++) {
  
          await members[i].setNickname(args.join(&quot; &quot;))
         
      }
  
      console.log('  [+] Le surnom de tout le monde sur le serveur a été changé !'.green)
  
  }
  </code></pre>
  <p>and this error</p>
  <pre><code>C:\Users\PC\Desktop\discord\1140\commands\nickall.js:12
          await members[i].setNickname(args.join(&quot; &quot;))
                           ^
  
  TypeError: members[i].setNickname is not a function
  </code></pre>