Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: rebrand chat bot to chat app #477

Merged
merged 1 commit into from
Aug 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ Codelab tutorials combine detailed explanation, coding exercises, and documented
- [BigQuery + Sheets + Slides](http://g.co/codelabs/bigquery-sheets-slides)
- [Docs Add-on + Cloud Natural Language API](http://g.co/codelabs/nlp-docs)
- [Gmail Add-ons](http://g.co/codelabs/gmail-add-ons)
- [Hangouts Chat Bots](http://g.co/codelabs/chat-apps-script)
- [Google Chat Apps](https://developers.google.com/codelabs/chat-apps-script)

## Clone using the `clasp` command-line tool

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// To learn how to use this script, refer to the documentation:
// https://developers.google.com/apps-script/samples/chat-bots/schedule-meetings
// https://developers.google.com/apps-script/samples/chat-apps/schedule-meetings

/*
Copyright 2022 Google LLC
Expand All @@ -18,24 +18,24 @@ limitations under the License.
*/

// Application constants
const BOTNAME = 'Chat Meeting Scheduler';
const APPNAME = 'Chat Meeting Scheduler';
const SLASHCOMMAND = {
HELP: 1, // /help
DIALOG: 2, // /schedule_Meeting
};

/**
* Responds to an ADDED_TO_SPACE event in Google Chat.
* Called when the bot is added to a space. The bot can either be directly added to the space
* or added by a @mention. If the bot is added by a @mention, the event object includes a message property.
* Returns a Message object, which is usually a welcome message informing users about the bot.
* Called when the Chat app is added to a space. The Chat app can either be directly added to the space
* or added by a @mention. If the Chat app is added by a @mention, the event object includes a message property.
* Returns a Message object, which is usually a welcome message informing users about the Chat app.
*
* @param {Object} event The event object from Google Chat
*/
function onAddToSpace(event) {
let message = '';

// Personalizes the message depending on how the bot is called.
// Personalizes the message depending on how the Chat app is called.
if (event.space.singleUserBotDm) {
message = `Hi ${event.user.displayName}!`;
} else {
Expand All @@ -53,8 +53,8 @@ function onAddToSpace(event) {

/**
* Responds to a MESSAGE event triggered in Chat.
* Called when the bot is already in the space and the user invokes it via @mention or / command.
* Returns a message object containing the bot's response. For this bot, the response is either the
* Called when the Chat app is already in the space and the user invokes it via @mention or / command.
* Returns a message object containing the Chat app's response. For this Chat app, the response is either the
* help text or the dialog to schedule a meeting.
*
* @param {object} event The event object from Google Chat
Expand Down Expand Up @@ -176,15 +176,15 @@ function onCardClick(event) {
}

/**
* Responds with help text about this chat bot.
* Responds with help text about this Chat app.
* @return {string} The help text as seen below
*/
function getHelpTextResponse_() {
const help = `*${BOTNAME}* lets you quickly create meetings from Google Chat. Here\'s a list of all its commands:
const help = `*${APPNAME}* lets you quickly create meetings from Google Chat. Here\'s a list of all its commands:
\`/schedule_Meeting\` Opens a dialog with editable, preset parameters to create a meeting event
\`/help\` Displays this help message

Learn more about creating Google Chat bots at https://developers.google.com/chat.`
Learn more about creating Google Chat apps at https://developers.google.com/chat.`

return { 'text': help }
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"exceptionLogging": "STACKDRIVER",
"runtimeVersion": "V8",
"chat": {
"addToSpaceFallbackMessage": "Thank you for adding this Chat Bot!"
"addToSpaceFallbackMessage": "Thank you for adding this Chat App!"
}
}
Loading