Forum Discussion

DeveshT's avatar
DeveshT
Copper Contributor
Nov 19, 2024

Error : The bot is not part of the conversation roster. while sending message in channel through bot

We have a bot that can be installed in a Team as well as in personal scope. We are facing issue when bot is trying to send message in the channel where it is installed. It was working fine few days back but all of a sudden, it's throwing error:
 

> {"error":{"code":"BotNotInConversationRoster","message":"The bot is
> not part of the conversation roster."}} 
>     Details : 
>     teamId :19:3684c109f05f44efb4fb54a988d70286@thread.tacv2
>     Error: Operation returned an invalid status code 'Forbidden'
>     StackTrace: at Microsoft.Bot.Connector.Conversations.CreateConversationWithHttpMessagesAsync(ConversationParameters
> parameters, Dictionary`2 customHeaders, CancellationToken
> cancellationToken) at
> Microsoft.Bot.Connector.ConversationsExtensions.CreateConversationAsync(IConversations
> operations, ConversationParameters parameters, CancellationToken
> cancellationToken)

Below is my code:

    var channelData = new TeamsChannelData
                    {
                        Channel = new ChannelInfo(cId),
                        Team = new TeamInfo(cId),
                        Tenant = new TenantInfo(tenantId)
                    };
                    var conversationParameters = new ConversationParameters
                    {
                        IsGroup = true,
                        Bot = null,
                        ChannelData = channelData,
                        Members = null,
                        Activity = activity,
                    };
                    await connectorClient.Conversations.CreateConversationAsync(conversationParameters);

 
The bot is able to send direct message to users

Note: - I can confirm that the bot is part on the team, and it is installed within the team. Bot is able to send one-to-one message to the user. We are facing issues only when trying to send message in a channel.

2 Replies

  • @DeveshT-
    Thank you for your inquiry about your Teams app development issue!
    Our engineering team is actively working on this issue and we will revert with an update once we get the inputs/confirmation regarding the resolution of the issue.

    • DeveshT's avatar
      DeveshT
      Copper Contributor

      Sayali-MSFTFYI - I can confirm that this issue occurs every time we resubmit our manifest package with a new version. Reinstalling the app resolves the issue. It doesn't work for all our existing customers. For teams where the app works after a reinstall, updating the manifest breaks it again, even for those teams where it was previously fixed by the reinstall.

Resources