title: Couldn't fetch other IPs and Ports Gamedig discord.js v12
body: <p>I am trying to make all servers information in one embed, but the problem is that the bot fetches all the IPs and ports, giving correct server information but did not give right IPs and ports. It means the bot will give only one server IP and ports from all the servers!</p>
  <p>Here is <strong>Updatecmd.js</strong></p>
  <pre class="lang-js prettyprint-override"><code>const Discord = require(&quot;discord.js&quot;)
  const Gamedig = require(&quot;gamedig&quot;)
  
  const servers = new Discord.Collection()
  
  function getServerInfo() {
      delete require.cache[require.resolve(&quot;../serverinfo.json&quot;)] // ensure new IPs were not added
  
      let serverInfo = require(&quot;../serverinfo.json&quot;)
      // console.log(serverInfo.length)
  
      let ip = &quot;&quot;
      let port = 0
  
  
      for (let i = 0; i &lt; serverInfo.length; i++) {
  
          if (i &amp; 1) {
              port = serverInfo[i]
              // console.log(`**port** ` + port)
          } else {
              ip = serverInfo[i]
              // console.log(`**ip** ` + ip)
          }
  
          
  
          // query each IP in the file.
          Gamedig.query({
              type: &quot;cs16&quot;,
              host: ip,
              port: port,
              socketTimeout: 5000,
              udpTimeout: 10000
          }).then((state) =&gt; {
              let serverName  = state.name
              let map         = state.map
              let players     = state.players.length
              let maxPlayers  = state.maxplayers
              
              servers.set(serverName, [serverName, ip, port, map, players, maxPlayers])
              //console.log(servers)
          }).catch((error) =&gt; {
              
          })
      }
  
      return servers
  }
  
  getServerInfo()
  
  module.exports = {
      name: 'updatecmd',
      description: 'updatebot test.',
      aliases: ['memes', 'dm', 'dank'],
      usage: `meme`,
      category: 'Fun',
      execute(client, message, args) {
          let embed = new Discord.MessageEmbed()
              .setAuthor(message.client.user.username)
              .setFooter(&quot;test&quot;)
              .setColor(&quot;#3498DB&quot;)
              .setDescription(&quot;zzz&quot;)
          
              getServerInfo().forEach((val, key, map) =&gt; {
                  //console.log(map.size)
      
                  let info = servers.get(key)
                  //console.log(info)
  
                  embed.addField(`${info[0]}`, true)
                  embed.addField(&quot;Players:&quot;, `${info[5]}/${info[6]}`, true)
                  embed.addField(&quot;Map:&quot;, `${info[4]}`, true) 
                  embed.addField(&quot;Connect&quot;, `${info[1]}:${info[2]}`)      
              })
          message.channel.send(embed)
      }
  }
  </code></pre>
  <p>Here is <strong>serverinfo.json</strong></p>
  <pre><code>[
      &quot;serverip&quot;, port,
      &quot;serverIP&quot;,port
  ]
  </code></pre>