title: How to add Sleep in Node.js after executing command?
body: <p>Basically this is a chat bot for Twitch.tv. Currently, it replies to someone in the chat when they say "Hello". I'd like to add a Sleep for 2 seconds after the bot replies with hello, so it doesn't flood the chat. I have tried setTimeout/setInterval but those put the 2 second delay BEFORE it replies to the person. Cheers.</p>
  
  <pre><code>var tmi = require('tmi.js');
  
  process.setMaxListeners(0);
  
  var options = {
  options: {
      debug: true
  },
  connection: {
      cluster: "aws",
      reconnect: true
  },
  identity: {
      username: "",
      password: ""
  },
  channels: [""]
  };
  
  var client = new tmi.client(options);
  client.connect();
  
  client.on('chat', function(channel, user, message, self) {
  if(message === "Hello") {
      client.action("", "@" + user['display-name'] + ", Welcome!");
  }});
  </code></pre>