Hello @lakshmi, You can send proactive messages to update the status. This ensures that the latest status is always visible in the channel. You can schedule these updates at regular intervals or trigger them based on certain events.
Example Code for Sending Proactive Messages
const { MicrosoftAppCredentials, ConnectorClient } = require('botframework-connector');
async function sendProactiveMessage(serviceUrl, conversationId, message) {
const appId = process.env.MicrosoftAppId;
const appPassword = process.env.MicrosoftAppPassword;
const appCredentials = new MicrosoftAppCredentials(appId, appPassword);
const connectorClient = new ConnectorClient(appCredentials, { baseUri: serviceUrl });
await connectorClient.conversations.sendToConversation(conversationId, {
type: 'message',
text: message
});
}
// Usage example
const serviceUrl = 'https://smba.trafficmanager.net/amer/';
const conversationId = 'conversation-id';
const message = 'Agent John Doe is now Available';
sendProactiveMessage(serviceUrl, conversationId, message);
Reference Document-https://learn.microsoft.com/en-us/azure/bot-service/bot-builder-howto-proactive-message?view=azure-bot-service-4.0&tabs=csharp