BotFramework-WebChat | customizable web-based client | Bot library

 by   microsoft JavaScript Version: 4.16.0-main.20231117.ab8ab69 License: MIT

kandi X-RAY | BotFramework-WebChat Summary

kandi X-RAY | BotFramework-WebChat Summary

BotFramework-WebChat is a JavaScript library typically used in Automation, Bot, Nodejs applications. BotFramework-WebChat has no vulnerabilities, it has a Permissive License and it has medium support. However BotFramework-WebChat has 114 bugs. You can install using 'npm i dgrow-webchat' or download it from GitHub, npm.

A highly-customizable web-based client for Azure Bot Services.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              BotFramework-WebChat has a medium active ecosystem.
              It has 1409 star(s) with 1437 fork(s). There are 124 watchers for this library.
              There were 3 major release(s) in the last 6 months.
              There are 295 open issues and 2598 have been closed. On average issues are closed in 29 days. There are 40 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of BotFramework-WebChat is 4.16.0-main.20231117.ab8ab69

            kandi-Quality Quality

              BotFramework-WebChat has 114 bugs (0 blocker, 0 critical, 114 major, 0 minor) and 7 code smells.

            kandi-Security Security

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

            kandi-License License

              BotFramework-WebChat 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

              BotFramework-WebChat releases are available to install and integrate.
              Deployable package is available in npm.
              Installation instructions are not available. Examples and code snippets are available.
              BotFramework-WebChat saves you 7232 person hours of effort in developing the same functionality from scratch.
              It has 14956 lines of code, 0 functions and 1433 files.
              It has low code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed BotFramework-WebChat and discovered the below as its top functions. This is intended to give you an instant insight into BotFramework-WebChat implemented functionality, and help decide if they suit your requirements.
            • Creates a new representation of the audio payload .
            • Initiate mock token .
            • Play data from audio stream .
            • Creates a multi buffering of audio buffers .
            • Provides a Controlable event .
            • Create a task Queue
            • Create the default card action handler
            • Main function
            • Patch Reconnector .
            • Update the activities for a particular activity .
            Get all kandi verified functions for this library.

            BotFramework-WebChat Key Features

            No Key Features are available at this moment for BotFramework-WebChat.

            BotFramework-WebChat Examples and Code Snippets

            No Code Snippets are available at this moment for BotFramework-WebChat.

            Community Discussions

            QUESTION

            Microsoft Bot Framework, Set User State From Javascript
            Asked 2021-Mar-18 at 19:09

            I am attempting to proof of concept a simple support & ticketing bot using Microsoft Bot Framework v4 and Azure. I have successfully created a bot via the Bot Framework Composer and deployed it to Azure using a Web App Bot. I have configured and installed the BotFramework-WebChat component on my test site and successfully connected the bot to it. The BotFramework-WebChat component is installed via cdn.botframework.com. The test site is a single page application and the bot sits alongside this such that it can be accessed at the users convivence.

            Everything is working as expected. I would like however to post certain contextual information to the Bot depending on the current browser state. For example, if a user is looking at product ABC when they converse with the bot I'd like the bot to know this. To achieve it I'd like to update the user state on the bot channel, preferably via vanilla JavaScript when the main application state changes. I'd like to do this seamlessly in the background and I do not want to rely on additional frameworks such as React (the Microsoft Documentation references React heavily and I unfortunately have no understanding of the particular product so find it difficult/impossible to follow).

            My question is therefore in two parts. Is the above possible using the API provided by the BotFramwork-WebChat component and if so how would one go about doing so? If it is not possible I would also appreciate any assistance on alternative methods should such alternatives exist.

            ...

            ANSWER

            Answered 2021-Mar-02 at 14:11

            If you just want to capture information at the time the user renders the webchat session, you can do this by sending a custom event, which you'll also need to handle in your bot code. This specific code will not work if you are trying to create a single instance of the bot that persists across multiple pages, and you are wanting the page details sent every time, but the same concept should apply. This method sends the details only on the initial connection to the bot.

            First you need to send an event from your bot rendering via custom store. Here is how I did it.

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

            QUESTION

            how to disable/enable attachment button inside chatbox using javascript in C# bot framework
            Asked 2021-Mar-12 at 02:48

            I have created a Microsoft bot framework using this tutorial. I created a chatbot using this javascript. I need to Enable/Disable the attachment button based on the bot message. My condition is to Enable the attachment button when the bot sends a message to the user to submit the attachment.

            Html:

            ...

            ANSWER

            Answered 2021-Mar-12 at 02:48

            You can accomplish this by filtering the activities that pass thru Web Chat's store. As you can see below, I first query for the attachment button's elements - there are two, a hidden input field and the button.

            Next, I check if the activity has an attachment and if that attachment's contentType matches "application/vnd.microsoft.card.adaptive". If it does, then the attachment input & button is enabled. Otherwise, the attachment input & button is disabled for all other activities.

            The whole if statement is wrapped in a time out. This is necessary because the check on the contentType of the attachment will complete before the store has finished rendering the activity resulting in a persistently disabled button. Setting a time out of ~300 ms allows the store to complete its rendering action. You can adjust the time out, but less than ~50 ms and the above will start occurring. Longer than ~500 ms and it will start to be noticeable to users.

            Please note, isolating the input & button elements relies on attributes and classes defined by Web Chat. While it is unlikely to be an issue, it's possible those definitions could change in future releases resulting in breaking changes and requiring updates to your code.

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

            QUESTION

            Hide Text Sent via Post Activity Event
            Asked 2021-Feb-25 at 10:31

            I'm currently sending a text programmatically to my bot following the article on https://github.com/microsoft/BotFramework-WebChat/tree/master/samples/04.api/d.post-activity-event

            Everything is working fine but I want to hide the text being sent so that the user does not see it on the session. Is this possible to do?

            ...

            ANSWER

            Answered 2021-Feb-25 at 10:31

            Instead of initializing and using the useSendMessage hook, replace it with useSendPostBack. Using useSendPostBack will generate a postBack message activity which simply sends a value back to the bot without displaying it to the user. The value sent to the bot should be located in the value property of the associated activity.

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

            QUESTION

            Use styleOptions on Webchat Hosted via ReactJS
            Asked 2021-Feb-08 at 12:06

            Is there a way to use styleOptions when rendering the Web Chat when using ReactJS?

            I can see that it is supported as a hook as per https://github.com/microsoft/BotFramework-WebChat/blob/master/docs/HOOKS.md#usestyleoptions but there is no instructions to implement it.

            Thanks!

            ...

            ANSWER

            Answered 2021-Feb-08 at 12:06

            I was able to get it to work using the below code:

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

            QUESTION

            WebpackError: TypeError: Object(...) is not a function gatsbyjs build error (botframework-webchat)
            Asked 2020-Dec-24 at 10:32

            I'm trying to integrate botframework-webchat to a gatsby.js website, gatsby develop builds successfully, however when i run the production build using the command gatsby build, it throws the following error.

            ...

            ANSWER

            Answered 2020-Dec-24 at 08:57

            I've been aware of you have followed up the suggested link https://www.gatsbyjs.com/docs/debugging-html-builds/#fixing-third-party-modules to fix window issue.

            BUT it this way is likely to prevent webpack compile the commonjs web chat packages properly which ended up with the issue.

            I was also aware of the configuration the stage of build-html isn't called during dev that's why you wouldn't see the error as you yarn start // gatsby develop.

            However, the document also suggests another way to fix is to use code splitting technique by using loadable-component. Personally, I think this way is best for you project since the chat is supposed to be rendered at the client side only.

            Here's a few thing you would change:

            • Remove your configuration in gatsby-node:

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

            QUESTION

            Microsoft bot framework webchat hidden secret for direct line -- NODE JS
            Asked 2020-Oct-28 at 15:21

            I need to hide the secret for direct line channel using an HTML webchat, tried this solution but keeps getting me errors while fetching. I got the secret for direct line channel in Azure portal in process.env

            Index.js

            ...

            ANSWER

            Answered 2020-Oct-27 at 02:37

            The issue with your particular implementation is, while you have set up an API for generating and serving a token back to Web Chat, you are failing to actually call that endpoint. Instead of

            const res = await fetch('https://directline.botframework.com/v3/directline/tokens/generate', { method: 'POST' });

            you should have

            const res = await fetch('http://localhost:3978/directline/token', { method: 'POST' });

            It is this that will make the call to exchange the Direct Line secret for a token and, in turn, will return the token back to your Web Chat instance.

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

            QUESTION

            botframework v4 customize title and minimizable webchat
            Asked 2020-Sep-25 at 08:38

            I´m rendering my chat using this:

            ...

            ANSWER

            Answered 2020-Sep-25 at 08:38

            I think your best bet going forward is to use the samples provided by the webchat team. The minimizable webchat sample is a good example.

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

            QUESTION

            What happens between using renderMarkdown and actually writing to the DOM in ReactWebChat?
            Asked 2020-Sep-10 at 00:57

            We have recently switched over from WebChatV3 to V4. As an ongoing effort we're porting all our custom functionality to the new client. One of those functionalities is checking URLs for a specific domain and setting the target on the a tag to "_parent".

            To implement this we've added a dependency to markdown-it, since the ReactWebChat element can take it as an argument as described here: BotFramework-Webchat Middleware for renderMarkdown Instead of adding an emoji renderer, we've built a rule into it and passed it into ReactWebChat as per the example given in the answer above. That code looks like this:

            ...

            ANSWER

            Answered 2020-Sep-10 at 00:57

            Because Web Chat converts all cards to Adaptive Cards, you will need to solve this issue using Adaptive Cards. You can see here that the Adaptive Cards SDK that Web Chat is using converts all anchors to "_blank" after Markdown is applied.

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

            QUESTION

            Failed to connect (500) to bot framework using Direct Line
            Asked 2020-Sep-04 at 06:18

            We have a bot running in Azure (Web App Bot) that I'm trying to embed on a website. The bot is based of the Bot Builder V4 SDK Tamplate CoreBot v4.9.2. At first I used the iframe to embed the bod. This worked but didn't provide the features we need, so now im changing it to use DirectLine.

            My code on the webpage looks like this:

            ...

            ANSWER

            Answered 2020-Sep-03 at 01:02

            If the ib and ob values displayed by the *.bot endpoint are false this means the bot and the Direct Line app service extension are unable to connect to each other.

            Make sure you verify below things:

            1. Double check the code for using named pipes has been added to the bot.
            2. Confirm the bot is able to start up and run at all. Useful tools are Test in WebChat, connecting an additional channel, remote debugging, or logging.
            3. Restart the entire Azure App Service the bot is hosted within, to ensure a clean start up of all processes.

            Please check troubleshooting guide, it seems updated today. (still old date reflected some how, not sure why)

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

            QUESTION

            sending a message to bot: v3 directline.postActivity vs. v4 dispatch from webchat store
            Asked 2020-Sep-02 at 23:45

            We are migrating from BotFramework-Webchat v3 to v4. Usually we send a message from the chat through the directline object created from v3 BotChat using the directline.postActivity function. However in our v4 implementation there were issues with the behavior of messages shown in the chat window when posting activities like this.

            It seems that sending messages through the webchat redux store as shown in this example is the recommended approach.

            I am wondering what is the difference between these two usages? It seems something is different between v3 and v4 versions and I am having difficulty finding references in the documentation about this. Should directline.postActivity be avoided completely?

            ...

            ANSWER

            Answered 2020-Sep-02 at 23:45

            It isn't documented anywhere, but best practice is what is demonstrated via the samples, by use of the Web Chat redux store and its list of available actions.

            Essentially, Web Chat v4 is built on top of BotFramework-DirectlineJS which does use observables. Web Chat then translates the Direct Line observables into its own methods for consumption internally and by the user.

            As you noted, it is possible to use the Direct Line observables in Web Chat but it is neither the best method nor the best practice to do so. Primarily, because Web Chat wasn't specifically designed around their use, except internally. It can work, but it opens you up to potentially curious behavior.

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

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

            Vulnerabilities

            No vulnerabilities reported

            Install BotFramework-WebChat

            You can install using 'npm i dgrow-webchat' or download it from GitHub, npm.

            Support

            Starting from Web Chat 4.7.0, Direct Line Speech is supported, and it is the preferred way to provide an integrated speech functionality in Web Chat. We are working on closing feature gaps between Direct Line Speech and Web Speech API (includes Cognitive Services and browser-provided speech functionality).
            Find more information at:

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

            Find more libraries

            Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link