সেভ করা পৃষ্ঠা গুছিয়ে রাখতে 'সংগ্রহ' ব্যবহার করুন
আপনার পছন্দ অনুযায়ী কন্টেন্ট সেভ করুন ও সঠিক বিভাগে রাখুন।
এই নির্দেশিকাটি ব্যাখ্যা করে যে Google Chat API-এর Reaction রিসোর্সে create() পদ্ধতিটি কীভাবে ব্যবহার করতে হয় একটি বার্তায় প্রতিক্রিয়া যোগ করতে—যেমন 👍, 🚲, এবং 🌞।
Reaction রিসোর্স এমন একটি ইমোজিকে প্রতিনিধিত্ব করে যা লোকেরা 👍, 🚲, এবং 🌞 এর মতো মেসেজে প্রতিক্রিয়া জানাতে ব্যবহার করতে পারে।
একটি ডেস্কটপ অ্যাপ্লিকেশনের জন্য OAuth ক্লায়েন্ট আইডি শংসাপত্র তৈরি করুন । এই গাইডে নমুনা চালানোর জন্য, আপনার স্থানীয় ডিরেক্টরিতে credentials.json নামে একটি JSON ফাইল হিসাবে শংসাপত্রগুলি সংরক্ষণ করুন৷
নির্দেশনার জন্য, এই কুইকস্টার্টে আপনার পরিবেশ সেট আপ করার পদক্ষেপগুলি সম্পূর্ণ করুন৷
একটি বার্তার প্রতিক্রিয়া তৈরি করতে, আপনার অনুরোধে নিম্নলিখিতটি পাস করুন:
chat.messages.reactions.create , chat.messages.reactions বা chat.messages অনুমোদনের সুযোগ নির্দিষ্ট করুন।
CreateReaction() পদ্ধতিতে কল করুন, parent বার্তাটির রিসোর্স নাম হিসাবে প্রতিক্রিয়া জানাতে এবং reactionReaction একটি উদাহরণ হিসাবে যেখানে unicode ক্ষেত্রটি একটি ইউনিকোড স্ট্রিং দ্বারা উপস্থাপিত একটি আদর্শ ইমোজি।
নিম্নলিখিত উদাহরণটি 😀 ইমোজি সহ একটি বার্তায় প্রতিক্রিয়া জানায়:
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);
এই নমুনা চালানোর জন্য, নিম্নলিখিত প্রতিস্থাপন করুন:
SPACE_NAME : স্পেসের name থেকে আইডি। আপনি ListSpaces() পদ্ধতিতে কল করে বা স্পেস এর URL থেকে আইডি পেতে পারেন।
MESSAGE_NAME : বার্তাটির name থেকে আইডি। চ্যাট এপিআই-এর সাথে অ্যাসিঙ্ক্রোনাসভাবে একটি বার্তা তৈরি করার পরে বা তৈরির সময় বার্তাটির জন্য নির্ধারিত কাস্টম নামের সাথে আপনি ফিরে আসা প্রতিক্রিয়া বডি থেকে আইডি পেতে পারেন।
চ্যাট এপিআই Reaction একটি উদাহরণ প্রদান করে যা তৈরি করা প্রতিক্রিয়ার বিবরণ দেয়।
[[["সহজে বোঝা যায়","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-06-05 UTC-তে শেষবার আপডেট করা হয়েছে।"],[[["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."]]],["To add a reaction to a message using the Google Chat API, utilize the `CreateReaction()` method. Specify the message's resource name as the `parent` and provide a `Reaction` instance with a Unicode emoji string in the `unicode` field. Ensure you have the `chat.messages.reactions.create`, `chat.messages.reactions`, or `chat.messages` authorization scope. You must have a Google Workspace account, a configured Google Cloud project, and have set up the Node.js environment, including OAuth client ID credentials. The API returns the created `Reaction` details.\n"]]