src/bot.js
/*
   * Helper method which takes care of constructing the response url
   * and sending the message to Hangouts Chat.
   */
Helper method which takes care of constructing the response url
and sending the message to Hangouts Chat.
Helper method which takes care of constructing the response url and sending the message to Hangouts Chat .
sendMessage(envelope, ...strings) {
    let data = {
        text: strings[0] || '',
        thread: envelope.message.thread
    };
    if (this.isPubSub) {
      this.chatPromise.then((chat) => 
        chat.spaces.messages.create({
            parent: envelope.message.space.name,
            requestBody: data
        }));
    } else {
      envelope.message.httpRes.json(data);
    }
  }
sendMessage ( envelope , ... strings ) { let data = { text : strings [ 0 ] || '' , thread : envelope . message . thread } ; if ( this . isPubSub ) { this . chatPromise . then ( ( chat ) => chat . spaces . messages . create ( { parent : envelope . message . space . name , requestBody : data } ) ) ; } else { envelope . message . httpRes . json ( data ) ; } }
Helper method which takes care of constructing the response url
 and sending the message to Hangouts Chat.
Helper method which takes care of constructing the response url and sending the message to Hangouts Chat .
// Post message as HTTP response