Bot Framework
37 TopicsError : 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.85Views0likes2CommentsSend Message as User/Bot Using Graph API Based on User's Email Existence in Microsoft Teams Channel
I'm working on a project that involves sending messages to a Microsoft Teams channel using the Microsoft Graph API. I have a specific requirement where: If a user's email exists in the teams channel, the message should be sent as a reply from that user. If the user's email doesn't exist in the channel, the message should be sent from a bot or a service account. I'm using user's token for authentication. Is there any way to achieve this conditional sending of messages using the Microsoft Graph API? Here is a rough outline of what I'm trying to accomplish: Check if the email exists in the teams channel. If it does, send the message as the user. If it doesn't, send the message as a bot or service account. Any guidance or examples on how to implement this would be greatly appreciated. Thank you!2.1KViews0likes4CommentsHow to get access token for Graph API in Teams bot-based message extension?
I'm developing a Teams bot-based message extension application using the Teams Toolkit in TypeScript. I need to retrieve all the replies for a message in the current channel. According to the documentation, I need to use the Graph API to get the replies. However, to use the Graph API, I need an access token. My questions are: How can I implement OAuth to get the token in a bot-based message extension? Are there any specific permissions or configurations needed in the Azure portal to enable this? Is there an alternative way to get the access token or retrieve the replies without using the Graph API?1.6KViews0likes5CommentsHow to deploy a Bot/Message extn app developed with Teams Toolkit (5.6) to a self-managed server?
I'm developing a Bot/Message Extension App for use in our organization. Using Teams Toolkit, I have created a project and using Typescript for it. Local testing is automatically supported from app registration without much consideration, so it seems very convenient. However, when I try to deploy this, I am a bit confused. Teams Toolkit seems to support deployment according to Azure Bot Service by default.(.dev) I can't use the Bot Service for a number of reasons and should consider running the bot on a self-managed host. First of all, is this possible? In this case, what steps should I take in Teams Toolkit, Azure portal, Teams development portal? If this is not possible with Teams Toolkit, how should I configure the bot's hosting? I have checked, we have to mention the endpoint URL but seems confuse to where it has to be mention.779Views0likes5CommentsUnable to invoke Task module in MS Teams botbuilder bot
Hi there, We are facing an issue while trying to invoke a task module in Microsoft Teams. We have create an adaptive card with a button that submit a task/fetch action. "actions": [{ "type": "Action.Submit", "title": "Test Fetch", "data": { "msteams": { "type": "task/fetch" }, "data": "toto" } }] When we click the button , the method on_teams_task_module_fetch() is triggered. A TaskModuleTasInfo is returned, but the popup is showing an error. class TaskModuleResponseFactory: @staticmethod def create_response(value: Union[str, TaskModuleTaskInfo]) -> TaskModuleResponse: if isinstance(value, TaskModuleTaskInfo): return TaskModuleResponse(task=TaskModuleContinueResponse(value=value)) return TaskModuleResponse(task=TaskModuleMessageResponse(value=value)) @staticmethod def to_task_module_response(task_info: TaskModuleTaskInfo): return TaskModuleResponseFactory.create_response(task_info) async def on_teams_task_module_fetch(self, turn_context: TurnContext, task_module_request: TaskModuleRequest): task_info = TaskModuleTaskInfo( width=900, height=900, title="Super Title", url="https://app.random-coffee.com", fallback_url="https://app.random-coffee.com", ) return TaskModuleResponseFactory.to_task_module_response(task_info) Could anyone provide insights on how to troubleshoot and fix this issue? Is there something I'm missing in the setup or response handling? Thank you in advance for your assistance! Ouad587Views0likes2CommentsonAdaptiveCardInvoke method isn't triggered on Bot Framework Emulator / JavaScript - Bot Framework S
For MS Teams chatbot on Bot Framework SDK, I was trying to invoke an event by onAdaptiveCardInvoke method by Adaptive Cards. I can do this on MS Teams but on Bot Framework Emulator, this method is not executed at all.Solved616Views0likes2CommentsUnit Test Teams Bot/Message Extension App created using Teams Toolkit
Hi, I have created a Teams Bot/Message Extension App using Teams Toolkit using VS Code. I want to unit test my bot. How can I do it, as I couldn't find any documentations for it. And also it is necessary to publish it to the Teams Store. Thanks.422Views0likes0CommentsHow to send dm even if the user has not installed the app in personal scope.
I am trying to build a bot which will have a few message extension to submit data and then I will make a request to my custom backend. I want to save the data and want to send dm to the user. I am planning to expose a route from my botbuilder restify server (built by teams toolkit) to send a dm to the user (from bot's account) because I could not find a way to send a dm without bot framework. The only problem is when I am trying to send a dm I am getting an error saying "Bot is not installed in user's personal scope", which is true because the app is only installed in a team. How can I tackle this problem? Basically I am building a feedback bot for companies so I want to proactively send dm message to all the employees and admins. What are different ways to do this thing. Feel free to ask about any other information if you need, thanks!Solved2.5KViews0likes13CommentsReply to message is not working as expected
const { MessageFactory, TeamsActivityHandler, BotFrameworkAdapter, TurnContext, teamsGetChannelId, TeamsInfo } = require('botbuilder'); const properties = { 'membersAdded': [{ 'id': '28:17a' }], 'type': 'conversationUpdate', 'timestamp': '2022-08-11T10:54:30.482Z', 'id': 'f:ce9c82ab7a6feabc', 'channelId': 'msteams', 'serviceUrl': 'https://smba.trafficmanager.net/in/', 'from': { 'id': '29:1YqsjLwgg-0A_V8tL5P3hIw', 'aadObjectId': 'a0858f3e-d57759' }, 'conversation': { 'isGroup': true, 'conversationType': 'channel', 'tenantId': '3272b84e1', 'id': '19:PZppMpIo1@thread.tacv2' }, 'recipient': { 'id': '28:17720bfc7ba', 'name': 'bot 1' }, 'channelData': { 'team': { 'aadGroupId': '9ffd4120579', 'name': 'Ayesha Testing', 'id': '19:PZp9pIo1@thread.tacv2' }, 'eventType': 'teamMemberAdded', 'tenant': { 'id': '3284e1' }, 'settings': { 'selectedChannel': { 'id': '19:PZ1@thread.tacv2' } } } }; const BotConnector = require('botframework-connector'); const adapter = new BotFrameworkAdapter({ appId: '', appPassword: '' }); BotConnector.MicrosoftAppCredentials.trustServiceUrl(properties.serviceUrl); const context = new TurnContext(adapter, properties); const teamsChannelId = '19:PZpplOG9xxoOHhanG9pIo1@thread.tacv2'; console.log(teamsChannelId); const activity = MessageFactory.text('This will be the first message in a new thread'); const [reference] = await TeamsInfo.sendMessageToTeamsChannel(context, activity, teamsChannelId, process.env.MicrosoftAppId); await context.adapter.continueConversationAsync( reference, async turnContext => { await turnContext.sendActivity(MessageFactory.text('This will be the first response to the new thread')); }); Expected: Actual : When I want to send a Reply to the message but it is sending as a new message. And I have to update that reply message that certain times. Can you please look into that? Also Is there a way to batch send or update messages to users in personal chat, otherwise data might be inconsistent for users.Solved2KViews0likes7CommentsInitiating a group chat
Hi, We are trying to initiate a group chat with members in Teams. We are using Postman to call the BotFramework REST API to start a group conversation. Here is the payload we are using { "type": "message", "isGroup": true, "members": [ { "id": "Some Id" }, { "id": "Some Id" } ], "tenantId": "Some Id", "topicName": "test" } When we tried to execute the request, we get the following error { "error": { "code": "BadSyntax", "message": "Incorrect conversation creation parameters" } } If we tried to initiate a conversation with only ONE member with the following payload, then everything works correctly { "type": "message", "isGroup": false, "members": [ { "id": "Some Id" } ], "tenantId": "Some Id", "topicName": "test" } Can anyone advise what the proper syntax to creating a group chat in Teams with the BotFramework REST API? Thank YouSolved1.8KViews0likes4Comments