message: adding timeout handler for custom handling for conversation timeout
diff: @@ -68,6 +68,10 @@ function Botkit(configuration) {
  this.capture_options = {};
  this.startTime = new Date();
  this.lastActive = new Date();
  + /** will be pointing to a callback which will be called after timeout,
  + * conversation will be not be ended and should be taken care by callback
  + */
  + this.timeOutHandler = null;
  this.collectResponse = function(key, value) {
  this.responses[key] = value;
  @@ -539,6 +543,10 @@ function Botkit(configuration) {
  return outbound;
  };
  + this.setTimeOutHandler = function (handler) {
  + this.timeOutHandler = handler;
  + }
  +
  this.tick = function() {
  var now = new Date();
  @@ -554,8 +562,12 @@ function Botkit(configuration) {
  (duration > this.task.timeLimit) && // timelimit is up
  (lastActive > this.task.timeLimit) // nobody has typed for 60 seconds at least
  ) {
  -
  - if (this.threads.timeout) {
  + // if timeoutHandler is set then call it, otherwise follow the normal flow
  + // this will not break others code, after the update
  + if (this.timeOutHandler != null || this.timeOutHandler != undefined) {
  + this.timeOutHandler (this);
  + }
  + else if (this.threads.timeout) {
  this.status = 'ending';
  this.gotoThread('timeout');
  } else {
  