* Responds to a MESSAGE event in Hangouts Chat.
*
* @param {Object} event the event object from Hangouts Chat
*/
function onMessage(event) {
var name = "";
name = "You2";
} else {
name = event.user.displayName;
}
var ss = SpreadsheetApp.openById("시트ID");
var s1 = ss.getSheetByName("시트2");
var r1 = s1.getRange(2, 1, 3, 4);
var v1 = r1.getValues();
var message = name + " said "" + event.message.text + """;
message = message + v1.join(" ");
return { "text": message };
}
* Responds to an ADDED_TO_SPACE event in Hangouts Chat.
*
* @param {Object} event the event object from Hangouts Chat
*/
function onAddToSpace(event) {
var message = "";
message = "Thank you for adding me to a DM, " + event.user.displayName + "!";
} else {
message = "Thank you for adding me to " + event.space.displayName;
}
}
* Responds to a REMOVED_FROM_SPACE event in Hangouts Chat.
*
* @param {Object} event the event object from Hangouts Chat
*/
function onRemoveFromSpace(event) {
console.info("Bot removed from ", event.space.name);
}
댓글 달기