title: Duplicate Status Error when Tweeting using Twitter API
body: <p>I am new to JavaScript and I am using Node.js and the Twitter API as a way to learn how to code. I am also using the Twit NPM package.  I am trying to create a "game" where a specific phrase has to be tweeted in order to begin. I have a function where if the specific phrase is not tweeted to the account, the account also replies to try again. </p>
  
  <p>Whether the phrase is met or not, this function works once. However, what if the same user tries to tweet a phrase again (matching the phrase or not)? How do I avoid getting a duplicate status error? I am not sure what the best approach is here as it is out of my knowledge scope. Here is a simplified version of the code that returns a duplicate status error after both <code>if</code> conditions have been met by the same user and then they try again to tweet:</p>
  
  <pre><code>var Twit          = require('twit');
  var T             = new Twit(config);
  
  // Start a stream for listening for @mentions
  var stream = T.stream('statuses/filter', { track: ['@someusername'] });
  stream.on('tweet', somePhrase);
  
  function somePhrase(tweet) {
  
    var request = tweet.text;
    var trigger = /(?:[^"']|^)(\bsome phrase\b)(?!["'])/ig;
    var name    = tweet.user.screen_name;
    var nameID  = tweet.id_str;
  
    // check to see if the tweet does not meet the request trigger
    if (request != trigger) {
  
      var reply   = '@' + name + "try again";
      var params  = { status: reply };
  
    }
    // check to see if the request matches the request trigger
    if (request.match(trigger)) {
  
      var question = "what do you want to know?";
      var params = {
          status: question + ' @' + name,
          in_reply_to_status_id: nameID
      };
    }
  
    T.post('statuses/update', params, function(err, data, response) {
      if (err !== undefined) {
        console.log(err);
      } else {
        console.log('Tweeted: ' + params.status);
      }
    })
  };
  </code></pre>
  
  <p>This is the error code that the API returns:</p>
  
  <pre><code>{ [Error: Status is a duplicate.]
    message: 'Status is a duplicate.',
    code: 187,
    allErrors: [ { code: 187, message: 'Status is a duplicate.' } ],
    twitterReply: { errors: [ [Object] ] },
    statusCode: 403 }
  </code></pre>