1
1
// To learn how to use this script, refer to the documentation:
2
- // https://developers.google.com/apps-script/samples/chat-bots /schedule-meetings
2
+ // https://developers.google.com/apps-script/samples/chat-apps /schedule-meetings
3
3
4
4
/*
5
5
Copyright 2022 Google LLC
@@ -18,24 +18,24 @@ limitations under the License.
18
18
*/
19
19
20
20
// Application constants
21
- const BOTNAME = 'Chat Meeting Scheduler' ;
21
+ const APPNAME = 'Chat Meeting Scheduler' ;
22
22
const SLASHCOMMAND = {
23
23
HELP : 1 , // /help
24
24
DIALOG : 2 , // /schedule_Meeting
25
25
} ;
26
26
27
27
/**
28
28
* Responds to an ADDED_TO_SPACE event in Google Chat.
29
- * Called when the bot is added to a space. The bot can either be directly added to the space
30
- * or added by a @mention. If the bot is added by a @mention, the event object includes a message property.
31
- * Returns a Message object, which is usually a welcome message informing users about the bot .
29
+ * Called when the Chat app is added to a space. The Chat app can either be directly added to the space
30
+ * or added by a @mention. If the Chat app is added by a @mention, the event object includes a message property.
31
+ * Returns a Message object, which is usually a welcome message informing users about the Chat app .
32
32
*
33
33
* @param {Object } event The event object from Google Chat
34
34
*/
35
35
function onAddToSpace ( event ) {
36
36
let message = '' ;
37
37
38
- // Personalizes the message depending on how the bot is called.
38
+ // Personalizes the message depending on how the Chat app is called.
39
39
if ( event . space . singleUserBotDm ) {
40
40
message = `Hi ${ event . user . displayName } !` ;
41
41
} else {
@@ -53,8 +53,8 @@ function onAddToSpace(event) {
53
53
54
54
/**
55
55
* Responds to a MESSAGE event triggered in Chat.
56
- * Called when the bot is already in the space and the user invokes it via @mention or / command.
57
- * Returns a message object containing the bot 's response. For this bot , the response is either the
56
+ * Called when the Chat app is already in the space and the user invokes it via @mention or / command.
57
+ * Returns a message object containing the Chat app 's response. For this Chat app , the response is either the
58
58
* help text or the dialog to schedule a meeting.
59
59
*
60
60
* @param {object } event The event object from Google Chat
@@ -176,15 +176,15 @@ function onCardClick(event) {
176
176
}
177
177
178
178
/**
179
- * Responds with help text about this chat bot .
179
+ * Responds with help text about this Chat app .
180
180
* @return {string } The help text as seen below
181
181
*/
182
182
function getHelpTextResponse_ ( ) {
183
- const help = `*${ BOTNAME } * lets you quickly create meetings from Google Chat. Here\'s a list of all its commands:
183
+ const help = `*${ APPNAME } * lets you quickly create meetings from Google Chat. Here\'s a list of all its commands:
184
184
\`/schedule_Meeting\` Opens a dialog with editable, preset parameters to create a meeting event
185
185
\`/help\` Displays this help message
186
186
187
- Learn more about creating Google Chat bots at https://developers.google.com/chat.`
187
+ Learn more about creating Google Chat apps at https://developers.google.com/chat.`
188
188
189
189
return { 'text' : help }
190
190
}
0 commit comments