با مجموعهها، منظم بمانید
ذخیره و دستهبندی محتوا براساس اولویتهای شما.
این راهنما نحوه استفاده از متد delete() را در منبع Reaction API چت Google برای حذف یک واکنش از یک پیام توضیح میدهد - مانند 👍، 🚲، و 🌞. حذف یک واکنش پیام را حذف نمی کند.
منبع Reaction نشاندهنده شکلکهایی است که افراد میتوانند از آن برای واکنش به پیامی مانند 👍، 🚲 و 🌞 استفاده کنند.
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-02-14 بهوقت ساعت هماهنگ جهانی.
[[["درک آسان","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-02-14 بهوقت ساعت هماهنگ جهانی."],[[["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"]]