Koleksiyonlar ile düzeninizi koruyun
İçeriği tercihlerinize göre kaydedin ve kategorilere ayırın.
Bu kılavuzda, Google Chat API'nin Reaction kaynağında delete() yönteminin nasıl kullanılacağı açıklanmaktadır. Bu yöntem, iletilerden tepki silmek için kullanılır (ör. 👍, 🚲 ve 🌞). Tepki silmek iletiyi silmez.
Reaction kaynağı, kullanıcıların mesajlara tepki vermek için kullanabileceği bir emojiyi (ör. 👍, 🚲 ve 🌞) temsil eder.
Masaüstü uygulaması için
OAuth istemci kimliği kimlik bilgileri oluşturun. Bu kılavuzdaki örneği çalıştırmak için kimlik bilgilerini credentials.json adlı bir JSON dosyası olarak yerel dizininize kaydedin.
Yardım için bu hızlı başlangıç kılavuzunda ortamınızı kurma adımlarını tamamlayın.
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);
Bu örneği çalıştırmak için aşağıdakileri değiştirin:
SPACE_NAME: Alanın name kimliği.
Kimliği, ListSpaces() yöntemini çağırarak veya alanın URL'sinden alabilirsiniz.
MESSAGE_NAME: İletinin name bölümündeki kimlik.
Kimliği, Chat API ile asenkron olarak mesaj oluşturduktan sonra döndürülen yanıt gövdesinden veya oluşturma sırasında mesaja atanan özel ad ile alabilirsiniz.
REACTION_NAME: Tepkinin name kimliği.
Kimliği, ListReactions() yöntemini çağırarak veya Chat API ile eşzamansız olarak tepki oluşturduktan sonra döndürülen yanıt gövdesinden alabilirsiniz.
Başarılı olursa yanıt gövdesi boş olur. Bu, tepkinin silindiğini gösterir.
[[["Anlaması kolay","easyToUnderstand","thumb-up"],["Sorunumu çözdü","solvedMyProblem","thumb-up"],["Diğer","otherUp","thumb-up"]],[["İhtiyacım olan bilgiler yok","missingTheInformationINeed","thumb-down"],["Çok karmaşık / çok fazla adım var","tooComplicatedTooManySteps","thumb-down"],["Güncel değil","outOfDate","thumb-down"],["Çeviri sorunu","translationIssue","thumb-down"],["Örnek veya kod sorunu","samplesCodeIssue","thumb-down"],["Diğer","otherDown","thumb-down"]],["Son güncelleme tarihi: 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,[]]