BotBuilder-Samples | Here you will find task | Bot library

 by   microsoft HTML Version: Templates License: MIT

kandi X-RAY | BotBuilder-Samples Summary

kandi X-RAY | BotBuilder-Samples Summary

BotBuilder-Samples is a HTML library typically used in Telecommunications, Media, Media, Entertainment, Automation, Bot, Framework applications. BotBuilder-Samples has no vulnerabilities, it has a Permissive License and it has medium support. However BotBuilder-Samples has 46 bugs. You can download it from GitHub.

This branch contains samples for the released version of the Microsoft Bot Framework V4 SDK for .NET, JS and Python. If you need samples for the Bot Framework V3 SDK, go here.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              BotBuilder-Samples has a medium active ecosystem.
              It has 4053 star(s) with 4804 fork(s). There are 238 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 144 open issues and 1407 have been closed. On average issues are closed in 102 days. There are 25 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of BotBuilder-Samples is Templates

            kandi-Quality Quality

              BotBuilder-Samples has 46 bugs (0 blocker, 0 critical, 10 major, 36 minor) and 127 code smells.

            kandi-Security Security

              BotBuilder-Samples has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              BotBuilder-Samples code analysis shows 0 unresolved vulnerabilities.
              There are 47 security hotspots that need review.

            kandi-License License

              BotBuilder-Samples is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              BotBuilder-Samples releases are available to install and integrate.
              Installation instructions are not available. Examples and code snippets are available.
              It has 15371 lines of code, 501 functions and 1305 files.
              It has medium code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed BotBuilder-Samples and discovered the below as its top functions. This is intended to give you an instant insight into BotBuilder-Samples implemented functionality, and help decide if they suit your requirements.
            • Display a message to the user
            • Creates and handles all of the choices .
            • Send a conversation to the end of the conversation
            • Produces an alert attachment to the user .
            • Create a new card command .
            • Send Turn error message
            • Response to create a new page
            • Creates an adaptive creative .
            • Read config file .
            • send the end error
            Get all kandi verified functions for this library.

            BotBuilder-Samples Key Features

            No Key Features are available at this moment for BotBuilder-Samples.

            BotBuilder-Samples Examples and Code Snippets

            No Code Snippets are available at this moment for BotBuilder-Samples.

            Community Discussions

            QUESTION

            Unable to get Twilio sms status callbacks when sending proactive message
            Asked 2022-Mar-09 at 16:51

            I'm trying to track the sms delivery status of the messages I send using the bot framework. I'm using Twilio, and sending proactive messages. Right now I'm trying to do so with twilio status callbacks

            This is similar to this question, I tried that approach but I couldn't get it to work. I've added my url on the TwiML app and it is not firing. I have double and triple checked, and I suspect this url is somehow ignored or not going through with my current set up. I don't get any callbacks on the proactive message nor on the replies the bot sends to the user. However the flow works fine and I can reply and get proper responses from the bot. Edit: calling this "approach 1"

            approach 2: I've also tried this doing some light modifications on Twilio adapter, to be able to add my callback just before create message. (I changed it so it uses a customized client wrapper that adds my callback url when creating the twilio resource) This does work, partially: when I reply a message from my bot, I get the status callbacks. But as the proactive message is sent using the default adapter, I don't get a callback on the initial message.

            approach 3: Finally, I also tried using the TwilioAdapter when sending the proactive message but for some reason as soon as I send an activity, the TurnContext is disposed, so I can't save the state or do any subsequent actions. This leads me to believe twilio adapter is not intended to be used this way (can't be used on proactive messages), but I'm willing to explore this path if necessary.

            Here is the modified Twilio Adapter:

            ...

            ANSWER

            Answered 2022-Mar-09 at 16:51

            I found a fix for this problem, around approach 3, by changing the overload I use for ContinueConversation. Replace this :

            Source https://stackoverflow.com/questions/71034954

            QUESTION

            Microsoft Teams App - Add Authentication and Authorization for Task/Fetch Card Action
            Asked 2022-Mar-04 at 21:04

            Located in the BotBuilder-Samples GitHub repo: https://github.com/microsoft/BotBuilder-Samples

            There is a sample app: 54.teams-task-module. This app demonstrates a task/fetch action with a Url to a Custom Form which is rendered by a Razor Page.

            https://github.com/microsoft/BotBuilder-Samples/tree/main/samples/csharp_dotnetcore/54.teams-task-module

            In the Bot, the OnTeamsTaskModuleFetchAsync method is overridden to return a TaskModuleResponse which tells the system to fetch the URL passed back to Teams in the response.

            https://github.com/microsoft/BotBuilder-Samples/blob/main/samples/csharp_dotnetcore/54.teams-task-module/Bots/TeamsTaskModuleBot.cs

            ...

            ANSWER

            Answered 2022-Jan-27 at 08:28

            To be clear on this, authentication -is- possible, but only for web pages (Adaptive Cards don't need it). This auth would rely on the standard SSO Teams offers for Task Modules as well as Tabs. See here for intro guidance: https://docs.microsoft.com/en-us/microsoftteams/platform/tabs/how-to/authentication/auth-aad-sso?tabs=dotnet, especially:

            The SSO API also works in task modules that embed web content.

            So really your question kind of becomes "how do I do SSO for web content in Teams". Here's a great video, which includes a link to text (blog) version of the content: https://devblogs.microsoft.com/microsoft365dev/lets-decode-single-sign-on-sso-in-microsoft-teams-tabs/. Here's a working sample, with both Node and DotNet backend options: https://adoption.microsoft.com/sample-solution-gallery/pnp-sp-dev-teams-sample-tab-sso. Note that the samples and docs generally focus on doing an OnBehalfOf (OBO) operation to call Graph, but the principle remains the same - you get a JWT token that you can pass back to your backend, which you can then validate. You can also, from the token, get user info for the logged in user.

            Source https://stackoverflow.com/questions/70871796

            QUESTION

            How to properly logout from Teams BotFramework OauthPrompt?
            Asked 2022-Feb-21 at 08:17

            I have a c# Teams bot that uses multiple Generic Oauth2 providers. As an example I have used this sample https://github.com/microsoft/BotBuilder-Samples/tree/main/samples/csharp_dotnetcore/46.teams-auth

            Also I have added Generic OAuth2 to Bot Registration in Azure. Everything works fine with single Oauth provider.

            User after logout process must be able to authenticate to another oauth2 provider. But I'm faced with problem that OauthPrompt caches previous credentials, and I don't know how to clear this cache and properly sign out user

            I've already tried different approaches to sign out user:

            • Using UserTokenClient
            ...

            ANSWER

            Answered 2022-Feb-21 at 08:17

            Found a problem. Bot was registered as a Singleton in services (services.AddSingleton <..>), аnd OauthPrompt dialog was added in waterfall step and didn't disposed. I have created different OauthPrompts for each Generic OAuth and added to dialog throught dialog constructor. And based user prompt choosed the right OauthPrompt

            Source https://stackoverflow.com/questions/71176457

            QUESTION

            Teams Bot Create Conversation In Controller
            Asked 2022-Jan-07 at 12:00

            I want to build a Teams bot that can send proactive messages, including creating conversations even if the user has never had a conversation with the bot.

            I followed the proactive sample and adapted it to send a notification as POST in the notify controller. I am able to continue a conversation, but when I try to create one, the user does not get any messages.

            Here is my code to create a conversation from the notify controller:

            ...

            ANSWER

            Answered 2022-Jan-06 at 18:15

            You can't start a conversation with a user that has never talked to your bot and when they did that you stored a conversation reference somewhere to use it when sending the proactive message.

            What the proactive sample does is precisely that, store in memory the references to the conversations.

            Teams assigns a user id that's unique to the bot-user relationship, so there's no way you can start a conversation even if you knew the user's active directory object id. Or at least not without using it to create the conversation reference.

            Following the Proactive Sample

            https://github.com/microsoft/BotBuilder-Samples/blob/95f2fa8440b4cf3f984c3f1cb82966b8b45d71e8/samples/csharp_dotnetcore/16.proactive-messages/Bots/ProactiveBot.cs#L26 That method is the one storing the conversation reference. Then the notify endpoint loops through the stored conversation references and send notifications. If your user didn't trigger that method ever, then the notify endpoint won't do anything with that user. I see that you modified the notify controller, but I'm not sure how you are getting the recipientId for a user that never talked to you.

            Talking to a user for the first time, Microsoft Graph Approach.

            To do that you'll need access to the Microsoft Graph API in the AAD tenant and use it to:

            1. Get the user
            2. Get the AppInstallationId if the user has installed your bot or potentially force the installation
            3. Use that to get the ChatId between the bot and that AppInstallation
            4. Use that ChatId to create the conversation reference for that user.
            5. Optionally store somewhere the reference to the user id and the conversation reference you created so you don't have to do all the previous steps for that user again.

            Check this project out: https://github.com/microsoft/microsoft-teams-apps-company-communicator

            Source https://stackoverflow.com/questions/70599634

            QUESTION

            Teams Bot - get credentials from Key Vault
            Asked 2022-Jan-04 at 12:46

            I have searched a bit but didn't found something which is helping me. I created a bot for teams and like described in all examples I am using the appsettings.json to store the ID and the password for the bot (MicrosoftAppId and MicrosoftAppPassword). These are both handled by the framework somehow. But now I want to use an Azure Key Vault to store the secret instead of having the appsettings file.

            So I found some examples explaining how to do this in BotFramework V3 with BotAuthentication Attribute and even something for BotFramework V4 here (working link for the linked example here). But even that example is old and does not exist anymore like that.

            How am I supposed to do this for a teams bot and c# dotnet 3.1?

            ...

            ANSWER

            Answered 2022-Jan-04 at 12:46

            You can use the following method to store the secret value

            Source https://stackoverflow.com/questions/70567008

            QUESTION

            How to authenticate to MS Teams from a chatbot in a dedicated tenant with Microsoft Bot Framework SDK v4?
            Asked 2021-Dec-28 at 08:42

            I have an authentication issue when sending requests to MS Teams from a corporate environment (with a dedicated tenant). I don't know if this is a bug or if I misuse the SDK. I already saw Teams samples provided by Microsoft but all of these run on public Azure without dedicated tenant, and I suspect my issue is somewhat related to using a dedicated tenant (having a dedicated tenant, with either a bug in SDK, either a misconfiguration somewhere in my code or in the bot manifest).

            The application I'm working on is very business specific, so I made a project to reproduce issue with minimal code in this github repository: msteams-bot-auth-issue. Using this sample project requires to have a Teams bot on a dedicated tenant (I obviously cannot publish my corporate tenant details).

            Basically, our application is splitted in two parts: one receives bot activities from MS Teams channel. Another processes them (first part forwards activities to the second one).

            We correctly receive activities from MS Teams. But we are unable to call an MS Teams API to get Teams members in conversation (HTTP 401 with response message { "message": "Authorization has been denied for this request." }).

            Interestingly, if I use Microsoft.Bot.Connector v4.7.3 (version we actually use in our application), behavior is a bit different from Microsoft.Bot.Connector v4.15.0: in v4.7.3, no access token is requested before request to get conversation members; in v4.15.0, access token is successfully obtained, and put in request to conversation members request, but we still get an HTTP 401 response. Because we get HTTP 401 and not HTTP 403, I suppose access token is not recognized by MS Teams.

            MS Teams response is always the same (HTTP 401 and error message), regardless an access token was included or not in request.

            Access token request is composed of two requests:

            • discovery (GET https://login.microsoftonline.com/common/discovery/instance?api-version=1.1&authorization_endpoint=https://login.microsoftonline.com/XXX/oauth2/authorize where XXX is our tenant name).
            • client credentials request (POST https://login.microsoftonline.com/XXX/oauth2/authorize where XXX is our tenant name).

            Response contains access token, logs are showing "GetTokenAsync: Acquired token using ADAL in 876" (logs emitted by Bot Framework SDK).

            Then actual conversation members request is sent with access token (with HTTP header Authorization: Bearer ...), and response is always HTTP 401.

            When I decode the JWT in https://jwt.io, I see these fields (among others):

            Interestingly, if a set scope parameter in MicrosoftAppCredentials class to AuthenticationConstants.ToChannelFromBotOAuthScope, nothing changes in the JWT. So maybe access rights are not correctly setup for our application.

            Maybe this is an issue with our application manifest, but I think we followed samples for MS Teams bots. permissions field in our manifest is set to [ "identity", "messageTeamMembers" ].

            There are lots of resources about Bot Framework and MS Teams, but I did not found any meaningful documentation for this scenario.

            This may be caused by a corporate proxy, but I don't think so (I cannot guarantee it).

            I precise this is an app to app authentication, also sometimes described as "regular bot scenario" (no user authentication involved here).

            ...

            ANSWER

            Answered 2021-Dec-28 at 08:42

            Thanks to @StevenKanberg comment, the issue is resolved and was related to a corporate proxy and to tenant restriction feature.

            Here are my observations:

            Even if we use a corporate MS Teams tenant, we must not authenticate to this tenant. I don't really understand why, but we have to authenticate to MS Teams directly. So when instantiating MicrosoftAppCredentials, argument ChannelAuthTenant must not be set (meaning default tenant "botframework.com" will be used). Curiously, authentication worked with our tenant id, but access token was not usable/recognized by MS Teams (error 401 returned by MS Teams). With default tenant, and without proper tenant restrictions feature configuration, we could not authenticate in the first place (also with a more explicit error returned by MS Teams regarding tenant).

            Source https://stackoverflow.com/questions/70333150

            QUESTION

            Adding Teams messaging extension to an existing Graph Api project
            Asked 2021-Nov-14 at 08:19

            I am developing a Teams application with AspNetCore and React with typescript. I would like to add the messaging extension functionality to my app. I have tested the available samples for Action based Messaging extension from here - https://github.com/microsoft/BotBuilder-Samples/tree/main/samples/csharp_dotnetcore/51.teams-messaging-extensions-action

            I could run this sample and successfully connect to the bot I created in my Azure resource group.

            Since I already have a Teams project created, I want to know if I can just add the code that makes the messaging extension work from this sample or do I need to have a separate project just for running the bot and messaging extension?

            Note- I do not have a Bot implementation in my original project.

            ...

            ANSWER

            Answered 2021-Nov-14 at 08:19

            It's definitely possible to combine them into the same project, you just need to make sure the endpoints all work correctly. The bot has, by convention, an endpoint at something like "/api/messages", but this is just a convention - you can use that or anything else you like, as long as you configure it properly in the Azure Bot registration so it knows what endpoint is for your bot, compared to the rest of the ASP.Net project.

            Source https://stackoverflow.com/questions/69945601

            QUESTION

            Teams: How to open Task Module from Adaptive Card in desktop app
            Asked 2021-Nov-09 at 13:03

            I am sending an adaptive card to teams with the bot framework. That is working fine. The card should contain an action that opens a task module like explained here.

            My code for the card looks like this:

            ...

            ANSWER

            Answered 2021-Oct-14 at 16:29

            This might relate to how the platform is reading your json - the "" characters for example might not be handled properly on the desktop. To solve this, rather leave the json conversion up to the platform and, for your example in C#, create a strong type instead. The example you link to does exactly that - see this line:

            Source https://stackoverflow.com/questions/69574024

            QUESTION

            How to deploy an Azure Bot
            Asked 2021-Sep-24 at 17:20

            I have created a simple Azure Bot from a Typescript template from this tutorial. I have tested it in the Bot Framework Emulator and now want to deploy it to Azure. I am trying to follow the instructions here. I get as far as the step "Deploy via ARM template with existing resource group" (I have already created a Resource Group).

            So I am trying to run this command from the command line:

            ...

            ANSWER

            Answered 2021-Sep-24 at 17:20

            I'm getting an error: az deployment: 'group' is not in the 'az deployment' command group. Sure enough when I look at the help for az deployment, there is no group command.

            What version is your AZ CLI?

            I am using 2.27.2 and I have it.

            Source https://stackoverflow.com/questions/69314202

            QUESTION

            Use AudioCard of Microsoft Bot with Microsoft Teams see bot UI shows "Go back to the main window to see this content."
            Asked 2021-Aug-29 at 14:00

            I can run this Teams Bot sample: https://github.com/microsoft/BotBuilder-Samples/tree/main/samples/csharp_dotnetcore/57.teams-conversation-bot

            When I need to add an AudioCard to play a mp3 song, I updated my code:

            ...

            ANSWER

            Answered 2021-Aug-29 at 14:00

            Recall that the "Bot Framework" is a general Bot creation framework from Microsoft, with Teams just being one particular implementation. As a result, some things are simply not supported in a Teams context. In this case, as per the docs over here:

            Source https://stackoverflow.com/questions/68973102

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install BotBuilder-Samples

            You can download it from GitHub.

            Support

            This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com. When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA. This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/microsoft/BotBuilder-Samples.git

          • CLI

            gh repo clone microsoft/BotBuilder-Samples

          • sshUrl

            git@github.com:microsoft/BotBuilder-Samples.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link