title: creating a game on a discord bot
body: <p>So I am creating a discord bot and I want it to roll a random number(I already know how to do this) if the roll is higher than 49 the user can use the command "buy". Now that is the part I am not able to code. How to attach a specific command to conditional. Also if the player gets lower than 49 he wont be able to use "buy".</p>
  
  <pre><code>if(command === "shekels"){
      var object = (prizes[Math.floor(Math.random()*prizes.length)])
      var shekels = Math.floor(Math.random()*99 +1 )
      message.channel.send(`You rolled ${shekels} shekels !`)
      if(shekels &lt;49){
          message.channel.send("Oi you dont have enough shekels to buy at my store *rubs hands*")
      }//49 brackets
      else{
          message.channel.send("Hey you do have enough shekels to buy something from my store")
      };
  
  
  
  };//command bracket
  
  
  
   if(shekels &lt; 49){
              message.channel.send("Oi you dont have enough shekels to buy at my store *rubs hands*");
          }//49 brackets
          else{
              allowedUsers.push(message.author.username);
      };
      if(command === "buy"){
          if(!allowedUsers.includes(message.author.username)){
              return message.channel.send("You did not roll 49 or above so you cannot use this command.");
          }
          else{
  
              message.channel.send("here " + objectStore);
          };
      };
  </code></pre>
  
  <p>the command above ^ doesnt work for me</p>