import{createClientWithUserCredentials}from'./authentication-utils.js';constUSER_AUTH_OAUTH_SCOPES=['https://www.googleapis.com/auth/chat.messages.reactions'];// This sample shows how to delete a reaction to a message with user credentialasyncfunctionmain(){// Create a clientconstchatClient=awaitcreateClientWithUserCredentials(USER_AUTH_OAUTH_SCOPES);// Initialize request argument(s)constrequest={// Replace SPACE_NAME, MESSAGE_NAME, and REACTION_NAME herename:'spaces/SPACE_NAME/messages/MESSAGE_NAME/reactions/REACTION_NAME',};// Make the requestconstresponse=awaitchatClient.deleteReaction(request);// Handle the responseconsole.log(response);}main().catch(console.error);
このサンプルを実行するには、次の値を置き換えます。
SPACE_NAME: スペースの name からの ID。ID は、ListSpaces() メソッドを呼び出すか、スペースの URL から取得できます。
MESSAGE_NAME: メッセージの name からの ID。この ID は、Chat API を使用してメッセージを非同期で作成した後に返されるレスポンス本文から取得するか、作成時にメッセージに割り当てられたカスタム名から取得できます。
REACTION_NAME: リアクションの name からの ID。この ID は、ListReactions() メソッドを呼び出すか、Chat API で非同期的にリアクションを作成した後に返されるレスポンスの本文から取得できます。
[[["わかりやすい","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"]],["最終更新日 2025-09-10 UTC。"],[[["\u003cp\u003eThis guide explains how to delete reactions (emojis like 👍, 🚲, 🌞) from Google Chat messages using the \u003ccode\u003edelete()\u003c/code\u003e method.\u003c/p\u003e\n"],["\u003cp\u003eDeleting a reaction does not delete the original message itself.\u003c/p\u003e\n"],["\u003cp\u003eYou'll need a Google Workspace account and Node.js to use the Google Chat API for deleting reactions.\u003c/p\u003e\n"],["\u003cp\u003eThe guide provides a code sample and instructions to set up your environment and authenticate for using the API.\u003c/p\u003e\n"],["\u003cp\u003eTo successfully delete a reaction, you need to provide the specific name of the reaction resource in your API request.\u003c/p\u003e\n"]]],["This guide details deleting reactions from Google Chat messages using the `delete()` method on the `Reaction` resource. Key steps include setting up a Google Workspace account, enabling the Google Chat API, and installing the Node.js Cloud Client Library. To delete a reaction, specify the `chat.messages.reactions` or `chat.messages` scope, and call `DeleteReaction()`, providing the reaction's `name`. The guide includes a Node.js code sample that demonstrates the deletion, requiring the space, message, and reaction IDs. A successful deletion results in an empty response.\n"],null,[]]