تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
يوضّح هذا الدليل كيفية استخدام طريقة
delete()
في المورد Reaction لواجهة برمجة التطبيقات Google Chat API لحذف تفاعل من
رسالة، مثل 👍 و🚲 و🌞. لا يؤدي حذف تفاعل إلى حذف الرسالة.
يمثّل
Reaction المرجع
رمز إيموجي يمكن للمستخدمين استخدامه للتفاعل مع رسالة، مثل 👍 و🚲 و🌞.
أنشئ بيانات اعتماد معرِّف عميل OAuth لتطبيق على جهاز كمبيوتر. لتشغيل النموذج في هذا الدليل، احفظ بيانات الاعتماد كملف JSON باسم credentials.json في دليلك المحلي.
للحصول على إرشادات، أكمل خطوات إعداد بيئتك في هذا
البدء السريع.
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 الخاص بالمساحة
يمكنك الحصول على المعرّف من خلال استدعاء الطريقة
ListSpaces()
أو من عنوان URL الخاص بالمساحة.
MESSAGE_NAME: المعرّف من name الخاص بالرسالة
يمكنك الحصول على المعرّف من نص الرد الذي يتم إرجاعه بعد إنشاء رسالة بشكل غير متزامن باستخدام Chat API، أو باستخدام الاسم المخصّص الذي تم تعيينه للرسالة عند إنشائها.
REACTION_NAME: المعرّف من name الخاص بالتفاعل
يمكنك الحصول على المعرّف من خلال استدعاء الطريقة
ListReactions()، أو من نص الاستجابة الذي يتم عرضه بعد إنشاء تفاعل
بشكل غير متزامن باستخدام Chat API.
إذا كانت الاستجابة ناجحة، سيكون نص الاستجابة فارغًا، ما يشير إلى أنّه تم حذف التفاعل.
تاريخ التعديل الأخير: 2025-07-25 (حسب التوقيت العالمي المتفَّق عليه)
[[["يسهُل فهم المحتوى.","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-07-25 (حسب التوقيت العالمي المتفَّق عليه)"],[[["This guide explains how to delete reactions (emojis like 👍, 🚲, 🌞) from Google Chat messages using the `delete()` method."],["Deleting a reaction does not delete the original message itself."],["You'll need a Google Workspace account and Node.js to use the Google Chat API for deleting reactions."],["The guide provides a code sample and instructions to set up your environment and authenticate for using the API."],["To successfully delete a reaction, you need to provide the specific name of the reaction resource in your API request."]]],["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"]]