lib/bot.js
function Bot(flint) {
  EventEmitter.call(this);

  this.id = u.genUUID64();

  this.flint = flint;
  this.options = flint.options;

  this.debug = function(message) {
    message = util.format.apply(null, Array.prototype.slice.call(arguments));

    if(typeof flint.debugger === 'function') {
      flint.debugger(message, this.id);
    } else {
      _debug(message);
    }
  };

  //randomize distribution of when audit event should take place for this bot instance...
  this.auditTrigger = Math.floor((Math.random() * this.flint.auditDelay)) + 1;

  this.spark = this.flint.spark;
  this.batchDelay = this.flint.batchDelay;
  this.active = false;
  this.room = {};
  this.team = {};
  this.person = this.flint.person;
  this.membership = {};
  this.memberships = [];
  this.email = this.flint.email;
  this.isLocked = false;
  this.isModerator = false;
  this.isGroup = false;
  this.isDirect = false;
  this.isTeam = false;
  this.lastActivity = moment().utc().toDate();

  this.on('error', err => {
    if(err) {
      this.debug(err.stack);
    }
  });
}
function Bot(flint) {
  EventEmitter.call(this);

  this.id = u.genUUID64();

  this.flint = flint;
  this.options = flint.options;

  this.debug = function(message) {
    message = util.format.apply(null, Array.prototype.slice.call(arguments));

    if(typeof flint.debugger === 'function') {
      flint.debugger(message, this.id);
    } else {
      _debug(message);
    }
  };

  //randomize distribution of when audit event should take place for this bot instance...
  this.auditTrigger = Math.floor((Math.random() * this.flint.auditDelay)) + 1;

  this.spark = this.flint.spark;
  this.batchDelay = this.flint.batchDelay;
  this.active = false;
  this.room = {};
  this.team = {};
  this.person = this.flint.person;
  this.membership = {};
  this.memberships = [];
  this.email = this.flint.email;
  this.isLocked = false;
  this.isModerator = false;
  this.isGroup = false;
  this.isDirect = false;
  this.isTeam = false;
  this.lastActivity = moment().utc().toDate();

  this.on('error', err => {
    if(err) {
      this.debug(err.stack);
    }
  });
}
function Bot ( flint ) { EventEmitter . call ( this ) ; this . id = u . genUUID64 ( ) ; this . flint = flint ; this . options = flint . options ; this . debug = function ( message ) { message = util . format . apply ( null , Array . prototype . slice . call ( arguments ) ) ; if ( typeof flint . debugger === 'function' ) { flint . debugger ( message , this . id ) ; } else { _debug ( message ) ; } } ; //randomize distribution of when audit event should take place for this bot instance... this . auditTrigger = Math . floor ( ( Math . random ( ) * this . flint . auditDelay ) ) + 1 ; this . spark = this . flint . spark ; this . batchDelay = this . flint . batchDelay ; this . active = false ; this . room = { } ; this . team = { } ; this . person = this . flint . person ; this . membership = { } ; this . memberships = [ ] ; this . email = this . flint . email ; this . isLocked = false ; this . isModerator = false ; this . isGroup = false ; this . isDirect = false ; this . isTeam = false ; this . lastActivity = moment ( ) . utc ( ) . toDate ( ) ; this . on ( 'error' , err => { if ( err ) { this . debug ( err . stack ) ; } } ) ; }
Creates a Bot instance that is then attached to a Spark Room.

@constructor
@param {Object} flint - The flint object this Bot spawns under.
@property {string} id - Bot UUID
@property {boolean} active - Bot active state
@property {object} person - Bot Person Object
@property {string} email - Bot email
@property {object} team - Bot team object
@property {object} room - Bot room object
@property {object} membership - Bot membership object
@property {boolean} isLocked - If bot is locked
@property {boolean} isModerator - If bot is a moderator
@property {boolean} isGroup - If bot is in Group Room
@property {boolean} isDirect - If bot is in 1:1/Direct Room
@property {string} isDirectTo - Recipient Email if bot is in 1:1/Direct Room
@property {boolean} isTeam - If bot is in Team Room
@property {date} lastActivity - Last bot activity
Creates a Bot instance that is then attached to a Spark Room .