title: Discord.JS: Array resets itself after some time
body: <p>Some days ago, I programmed a Discord bot with a count game. Someone has to send 1, then someone else had to say 2 and so on. When someone said a number twice, or said the wrong number, the game started all over again. When someone says the wrong number, the bot returns what the number had to be.</p>
  <p>However, I noticed something was wrong. Some people said the following number, but it appeared the array was resetted. The bot returned the following number to be 1. It already happened a lot of times.</p>
  <p>The code:</p>
  <pre><code>var counter = [{
      name: &quot;bot&quot;,
      nummer: 0
  }];
  client.on(&quot;message&quot;, message =&gt; {
      if (message.channel.id == &quot;804378504300200016&quot;) {
          if(!isNaN(message.content)){
              var counterlast = counter[counter.length - 1];
              var countercheck = counterlast[&quot;nummer&quot;] + 1;
              var pinger = parseInt(message.content);
              var lastuser = counterlast[&quot;name&quot;];
              if(countercheck === pinger &amp;&amp; lastuser !== message.author.id){
                  counter.push({name: message.author.id, nummer: countercheck});
                  message.react('✅');
              }
              else{
                  if(lastuser === message.author.id){
                      message.react('⚠️');
                      message.reply(`Chappie, niet nog een keer. Volgend nummer is 1`);
                      counter.length = 0;
                      counter.push({name: &quot;bot&quot;, nummer: 0});
                  }
                  else{
                      message.react('⚠️');
                      message.reply(`Chappie, verkeerd nummer. Het moest ${countercheck} zijn. Volgend nummer is 1.`);
                      counter.length = 0;
                      counter.push({name: &quot;bot&quot;, nummer: 0});
                  }
              }
          }
      }
  });
  </code></pre>
  <p>I have actually no clue what the problem could be. Does someone has a alternative method or the solution?</p>
  <p>My bot is running on a Ubuntu server with 1vCPU &amp; 1Gb ram</p>