title: Send another message if are more than 25 field Discord NodeJS
body: <p>I am making a discord bot <a href="https://github.com/ThatZiv/FiveM-Bot" rel="nofollow noreferrer" title="ThatZiv FiveM Bot (Original)">(Here is the original one)</a> in javascript of my GTA V RP server, the bot has a command that tells you the name, id and ping of the players but when there are more than 25 players an error occurs ( RangeError: RichEmbeds may not exceed 25 fields.). I have thought about the idea of ​​having more than 25 players send the others in another message.</p>
  <p>Here´s the code:</p>
  <pre><code>exports.run = async (client, message, args) =&gt; {
  
    var util = require(&quot;../fivem&quot;);
    message.delete();
    if (servers[message.guild.id].guild === message.guild.id) {
      try {
        var arg = `${servers[message.guild.id].ip}`
        /*    var args = `${servers[message.guild.id].ip}` */
        let api = `http://${arg}/players.json`
        let api2 = `http://${arg}/info.json`
        /*    if (!args) {return util.embed(&quot;Please Specify a Direct-IP address ex: `&quot;+config.prefix+&quot;players thatziv.ddns.net:30120`&quot;)}
           if (!message.content.includes(&quot;:&quot;)) {return util.embed(&quot;Please Specify a port ex: **&quot;+config.prefix+&quot;players thatziv.ddns.net__:30120__**&quot;)} */
        req(api2, function (err, response, main) {
          req(api, function (err, response, body) {
            if (err) {
              util.zembed(&quot;That server is offline or does not exist... \n**Console:**\n```js\n&quot; + err + &quot;```&quot;)
            }
            else {
              try {
                var start = JSON.parse(body)
                var start2 = JSON.parse(main)
  
                if (start == null || start == []) {
                  var e = 0
                } else {
                  var e = start.length;
                }
                var embed = new Discord.RichEmbed()
                  .setColor(color)
                  .setAuthor(state, icon)
                  .setThumbnail(icon)
                  .setDescription(`__**FamousLifeRP Players**__\n(First 25 players)\n**${e}** out of **${start2.vars.sv_maxClients}** Players.`)
                start.forEach(function (element) {
                  var sv = `**${element.name}**\nID: **${element.id}** Ping: **${element.ping}**`;
  
                  embed.addField(`**${element.name}**`, `ID: **${element.id}** Ping: **${element.ping}**`)
                })
  
                message.channel.send({ embed: embed });
                log(`Used Command [PLAYERS] in ${message.guild.name}`)
          
              } catch (err) {
                util.embed(&quot;That server is offline or does not exist...\n**Console:**\n```js\n&quot; + err + &quot;```&quot;)
              }
            }
  
          })
  
        })
  
      } catch (err) {
        util.embed(&quot;That server does not exist. \n**Console:**\n```js\n&quot; + err + &quot;```&quot;);
      }
    } else {
      return util.embed(&quot;Please **set** a Direct-Address for this server. ex: `&quot; + config.prefix + &quot;set thatziv.ddns.net:30120`\n***__Please make sure to include the address with port.__***&quot;)
  
    }
  };
  
  
  
  var exampleJSON = [
    {
      &quot;endpoint&quot;: &quot;[::ffff:5.15.226.104]:27594&quot;,
      &quot;id&quot;: 294,
      &quot;identifiers&quot;: [
        &quot;steam:110000114ff0dc9&quot;,
        &quot;license:12eaf8ef61955729188ff56b08e820c8a61bcbc3&quot;,
        &quot;ip:5.15.226.104&quot;
      ],
      &quot;name&quot;: &quot;Leonadro Di la Londra&quot;,
      &quot;ping&quot;: 165
    }
  ]
  </code></pre>
  <p>And here´s the error:</p>
  <p><a href="https://i.stack.imgur.com/cMBz7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cMBz7.png" alt="Error" /></a></p>
  <p>&quot;That server is offline or does not exist...
  Console:
  RangeError: RichEmbeds may not exceed 25 fields.&quot;</p>