src/bot.js
/*
   * Invoked when Event is received from Hangouts Chat.
   */
Invoked when Event is received from Hangouts Chat.
Invoked when Event is received from Hangouts Chat .
onEventReceived(event, res) {
    if (event.type != 'MESSAGE') {
      this.robot.logger.info('Only MESSAGE event supported now !');
      return;
    }
    let message = event.message;
    let sender = message.sender;
    let userId = sender.name;
    let userOptions = sender;
    let user = new User(userId, userOptions);
    let hangoutsChatTextMessage = new HangoutsChatTextMessage(
      user,
      message.argumentText,
      message.name,
      message.space,
      message.thread,
      message.createTime,
      res);
    this.robot.receive(hangoutsChatTextMessage);
  }
onEventReceived ( event , res ) { if ( event . type != 'MESSAGE' ) { this . robot . logger . info ( 'Only MESSAGE event supported now !' ) ; return ; } let message = event . message ; let sender = message . sender ; let userId = sender . name ; let userOptions = sender ; let user = new User ( userId , userOptions ) ; let hangoutsChatTextMessage = new HangoutsChatTextMessage ( user , message . argumentText , message . name , message . space , message . thread , message . createTime , res ) ; this . robot . receive ( hangoutsChatTextMessage ) ; }
Invoked when Event is received from Hangouts Chat.
Invoked when Event is received from Hangouts Chat .
// TODO(kavimehta): Create and allow for additional message types // Construct TextMessage and User objects in the Hubot world // Pass the message to the Hubot bot