import{createClientWithUserCredentials}from'./authentication-utils.js';constUSER_AUTH_OAUTH_SCOPES=['https://www.googleapis.com/auth/chat.messages.reactions.create'];// This sample shows how to create reaction to a message with user credentialasyncfunctionmain(){// Create a clientconstchatClient=awaitcreateClientWithUserCredentials(USER_AUTH_OAUTH_SCOPES);// Initialize request argument(s)constrequest={// Replace SPACE_NAME and MESSAGE_NAME here.parent:'spaces/SPACE_NAME/messages/MESSAGE_NAME',reaction:{// A standard emoji represented by a unicode string.emoji:{unicode:'😀'}}};// Make the requestconstresponse=awaitchatClient.createReaction(request);// Handle the responseconsole.log(response);}main().catch(console.error);
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2024-12-21 (世界標準時間)。"],[[["This guide demonstrates how to add emoji reactions (👍, 🚲, 🌞) to Google Chat messages using the `create()` method of the Google Chat API."],["It requires a Google Workspace account, a configured Google Cloud project with the Chat API enabled, and the Node.js Cloud Client Library."],["To add a reaction, call the `CreateReaction()` method, providing the message's resource name and the desired emoji's unicode representation."],["A sample Node.js code snippet is included, illustrating the process of creating a reaction using user credentials."],["You need to replace placeholders for space and message names within the code with your specific values to execute the sample successfully."]]],[]]