If you've been thinking your chats have been a little too text-heavy, you can now decorate them with some animated animals. ![]() appsscript.Apparently at this week's big I/O conference, Google didn't show off all the fun features of the company's new multiplatform text and video chat service: Hangouts. Your manifest file should look similar to the following example. * Responds to an ADDED_TO_SPACE event in Google Chat. (You'll add handlers for the MESSAGE and CARD_CLICKED events later in this codelab.) Code.gs /** Replace the contents of the Code.gs file with the following code that defines handlers for the ADDED_TO_SPACE and REMOVE_FROM_SPACE events. In Apps Script, you define an onCardClick() function to respond to this event. CARD_CLICKED: This event occurs when the user clicks a button with a custom action assigned to it.In Apps Script, you define an onMessage() function to respond to this event. MESSAGE: This event occurs when a user messages the Chat app, either directly in a DM or as an in a space.In Apps Script, you define an onRemoveFromSpace() function to handle this event. This event does not post a response back to Google Chat. REMOVED_FROM_SPACE: This event occurs when a user removes the Chat app from a space or DM.In Apps Script, you define an onAddToSpace() function to handle this event. ADDED_TO_SPACE: This event occurs when a human user adds a Chat app to a space or a direct message (DM).Google Chat raises four events that your app can listen for: ![]() Google Chat calls the corresponding event handler defined in the Chat app's script.The action raises an event aimed at the Chat app in Google Chat.A user initiates an action, like adding a Chat app to a space, starting a direct message (DM) with a Chat app, or removing a Chat app from a space.The interaction between the user, the Chat app, and Google Chat typically follows this sequence: Most Apps Script interactions with Google Chat are event-driven. You might have to scroll down to see this template. To do so, go to the Apps Script Getting Started page, and click the Chat App template. You can also create a Google Chat app from a template. Rename the new script ‘Attendance Bot' and click Rename.At the top left, click Untitled project.In your browser, open the Google Apps Script editor.To start implementing your Chat app, create a new Google Apps Script script by doing the following: Create the handlers for Google Chat events To clone the GitHub repository for this codelab, run the following command: git clone ģ. This will unpack a root folder ( hangouts-chat-apps-script-codelab), which contains one folder for each step of this codelab. Download the codeĬlick the following link to download all the code for this codelab: The step-NN folders contain the desired end state of each step of this codelab. You can either download a ZIP file or clone the GitHub repository to see the code for each step in this sample. Using an account will result in an error when you attempt to enable the API. Warning: You must use a Google Workspace account to complete this codelab. Basic JavaScript skills-Google Apps Script only supports JavaScript.A Google Workspace account with access to Google Chat.Access to the internet and a web browser.How to define and react to custom actions for button clicks in cards.How to respond back to Google Chat with card-formatted responses.How to parse event objects sent from Google Chat.How to add handlers in events raised in Google Chat. ![]() By building Attendance Bot in Google Apps Script, you can easily access other Google services like Drive, Gmail, Calendar, Docs, Sheets, and much more. In this code lab, you learn how to create a Google Chat app-"Attendance Bot"-that sets vacation responders in Gmail and schedules meetings in Calendar. Google Chat apps bring services and resources right into Google Chat where users get information and can take action without leaving the conversation.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |