Options to Show Agent Availability in a Teams Channel (Without Using Adaptive Cards)

lakshmi 816 Reputation points
2025-03-04T09:33:54.1066667+00:00

We have a functionality where a Teams group called "Agent Team" represents agents, with each channel acting as an individual agent. We need to display the real time agent status within the chatbot whether they are available, unavailable, or busy and ensure this status remains visible at all times.

I manually tried pinning a message, but it does not show at the top of the channel.

What are the available options for displaying the agent status in the chat bot within Teams

Azure AI Bot Service
Azure AI Bot Service
An Azure service that provides an integrated environment for bot development.
907 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Sayali-MSFT 3,691 Reputation points Microsoft External Staff
    2025-03-05T09:00:21.49+00:00

    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

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.