ইভেন্ট

নিম্নলিখিত উদাহরণগুলিতে, rbm_api_helper.js (পাইথনের জন্য ব্যবহার করা হয় না) অনুমান করে যে আপনি যে ফাইলটিতে কাজ করছেন সেটি প্রধান অ্যাপ ফোল্ডারের নীচে একটি ডিরেক্টরি। আপনার প্রকল্পের কনফিগারেশনের উপর নির্ভর করে আপনাকে অবস্থান সামঞ্জস্য করতে হতে পারে।

ঘটনা পড়ুন

ইভেন্টগুলি পড়ুন ব্যবহারকারীকে জানান যে এজেন্ট বার্তা পেয়েছেন এবং আস্থা প্রদান করুন যে RBM প্ল্যাটফর্ম তাদের বার্তা পৌঁছে দিয়েছে। নিম্নলিখিত কোডটি একটি ক্লায়েন্ট লাইব্রেরি সহ একটি ডিভাইসে একটি পঠিত ইভেন্ট পাঠায়।

Node.js

// Reference to RBM API helper
const rbmApiHelper = require('@google/rcsbusinessmessaging');

// Send the device an event to indicate that messageId has been read
rbmApiHelper.sendReadMessage('+12223334444', messageId);
এই কোডটি একটি RBM নমুনা এজেন্টের একটি উদ্ধৃতি।

জাভা

import com.google.rbm.RbmApiHelper;


// Create an instance of the RBM API helper
RbmApiHelper rbmApiHelper = new RbmApiHelper();

// Send the device an event to indicate that messageId has been read
rbmApiHelper.sendReadMessage(messageId, "+12223334444");
এই কোডটি একটি RBM নমুনা এজেন্টের একটি উদ্ধৃতি।

পাইথন

# Reference to RBM Python client helper and messaging object structure
from rcs_business_messaging import rbm_service

# Send the device an event to indicate that message_id was read
rbm_service.send_read_event('+12223334444', message_id)
এই কোডটি একটি RBM নমুনা এজেন্টের একটি উদ্ধৃতি।

সি#

using RCSBusinessMessaging;


// Create an instance of the RBM API helper
RbmApiHelper rbmApiHelper = new RbmApiHelper(credentialsFileLocation,
                                                 projectId);

// Send the device an event to indicate that messageId has been read
rbmApiHelper.SendReadMessage(messageId, "+12223334444");
এই কোডটি একটি RBM নমুনা এজেন্টের একটি উদ্ধৃতি।

টাইপিং ইভেন্ট

ইভেন্ট টাইপ করা ব্যবহারকারীকে জানাতে পারে যে আপনার এজেন্ট একটি বার্তা রচনা করছে। নিম্নলিখিত কোডটি একটি ক্লায়েন্ট লাইব্রেরি সহ একটি ডিভাইসে একটি টাইপিং ইভেন্ট পাঠায়।

Node.js

// Reference to RBM API helper
const rbmApiHelper = require('@google/rcsbusinessmessaging');

// Send the device an event to indicate that the agent is typing
rbmApiHelper.sendIsTypingMessage('+12223334444', function() {
    console.log('Typing event sent!');
});
এই কোডটি একটি RBM নমুনা এজেন্টের একটি উদ্ধৃতি।

জাভা

import com.google.rbm.RbmApiHelper;


// Create an instance of the RBM API helper
RbmApiHelper rbmApiHelper = new RbmApiHelper();

// Send the device an event to indicate that the agent is typing
rbmApiHelper.sendIsTypingMessage("+12223334444");
এই কোডটি একটি RBM নমুনা এজেন্টের একটি উদ্ধৃতি।

পাইথন

# Reference to RBM Python client helper and messaging object structure
from rcs_business_messaging import rbm_service

# Send the device an event to indicate that the agent is typing
rbm_service.send_is_typing_event('+12223334444')
এই কোডটি একটি RBM নমুনা এজেন্টের একটি উদ্ধৃতি।

সি#

using RCSBusinessMessaging;


// Create an instance of the RBM API helper
RbmApiHelper rbmApiHelper = new RbmApiHelper(credentialsFileLocation,
                                                 projectId);

// Send the device an event to indicate that the agent is typing
rbmApiHelper.SendIsTypingMessage(messageId, "+12223334444");
এই কোডটি একটি RBM নমুনা এজেন্টের একটি উদ্ধৃতি।