title: Discord.js Bot Replying to All Commands
body: <p>I am using discord.js to create a &quot;text-adventure&quot; bot. The user chooses what they would like to do by replying a, b, c, or d. I have separated the questions by using a variable called &quot;stage&quot;. The problem is, the bot does not let the user choose the next choice, but instead uses their previous answer.</p>
  <p>I tried using .lastMessage, but I either couldn't get it to work. That or I had been using it wrong, as I am a bit of an amateur.</p>
  <p>Below is a bit of code to show you how I handled it. (I removed the story as it got a bit...violent)</p>
  <pre><code>require(&quot;dotenv&quot;).config();
  
  var stage = 0;
  let time = 0;
  const { Client } = require('discord.js');
  const client = new Client();
  
  client.on('ready', () =&gt; {
  console.log(`${client.user.username} has arrived`);
  }); 
  
  client.on('message', (message) =&gt; {
  
  if (message.author.bot === true) return;
  
  
  if (message.content === 'begin') {
      
      }
  if (message.content === 'restart'){
      stage = 0;
      message.channel.send('Welcome adventurer! To begin, type &quot;a&quot;');
  }
      if (message.content === 'a' &amp;&amp; stage === 0) {
         
          message.channel.send('...');
          message.channel.send('...');
          message.channel.send('...');
          message.channel.send('Do you:');
          message.channel.send('a) ...');
          message.channel.send('b) ...');
          message.channel.send('c) ...');
          message.channel.send('d) ...');
  
          stage = 1;
          
          }
          if (message.content === 'a' &amp;&amp; stage === 1) {
              message.channel.send('...');
              message.channel.send('...);
              message.channel.send('...');
              message.channel.send('...');
              message.channel.send('...');
              message.channel.send('Do you:');
              message.channel.send('a) ...');
              message.channel.send('b) ...');
  
          }    
  });
  
  client.login(process.env.DISCORDJS_BOT_TOKEN);
  
  
  </code></pre>
  <p>EDIT: Sorry I didn't add that much code, I am unfamiliar with this website, and added the rest. The bot itself works, I'm just not sure how to make it only respond to one message once.</p>
  <p>I used this video if you need more info:
  <a href="https://www.youtube.com/watch?v=BmKXBVdEV0g&amp;t=15s&amp;ab_channel=TraversyMedia" rel="nofollow noreferrer">https://www.youtube.com/watch?v=BmKXBVdEV0g&amp;t=15s&amp;ab_channel=TraversyMedia</a></p>