welcomebot | It a Source code for welcome bot | Bot library
kandi X-RAY | welcomebot Summary
kandi X-RAY | welcomebot Summary
It a Source code for welcome bot
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of welcomebot
welcomebot Key Features
welcomebot Examples and Code Snippets
Community Discussions
Trending Discussions on welcomebot
QUESTION
I am developing my first bot using the MS Bot Framework and although I understand the basics, I am a bit clueless as to how to organize my code. For eg. I am planning to have
- notifier
- welcome prompt
- very basic help response
I am using the Core template in Visual Studio and it comes with a Bots
folder which has classes ending with Bot
. Looking at some samples, it seemed to me that the bot handling logic needs to sit here. So, I decided to have 3 classes, all extending from ActivityHandler
each doing one of the above tasks. Say I have 3 classes,
ANSWER
Answered 2020-Jul-02 at 21:48ActivityHandler
implements IBot
, so it can be thought of like a bot. Having multiple activity handlers would be like having multiple bots. Activity handlers are already designed to route different activity types to different code, so if routing is your concern then you only need one activity handler.
I presume your notifier is for proactive messaging. Rather than having a separate activity handler for it, what normally works is to have a separate endpoint, which is usually api/notify
(as opposed to api/messages
). You can still have a separate activity handler for that if you want, or not even use an activity handler for that case (like in the sample). Note that different channels may have special considerations for proactive messages, but that's outside the scope of your question.
Welcome messages are very easy with activity handlers. You can just use OnMembersAddedAsync
in your one activity handler, and there's no need for a whole separate activity handler. Welcome messages are also channel-specific because they rely on conversation update activities, and not every channel has a well-defined way to know when a conversation starts before the user says anything. Here's a sample for if you're using Web Chat.
If you want multiple implementations of the same interface in your dependency injection then you'll need to identify them by the implementation rather than the interface, but keep in mind that you don't need to put them in dependency injection at all.
QUESTION
I'm using Dialogs and waterfallstep to organize the dialog logic, and
I want a HeroCard
with CardActions
as a welcome message. It works fine just sending a HeroCard
as a welcome message, but my problem is to direct to the right dialog using turnContext
when the user click on one of the options in the CardAction
.
Here's my code in Bots.WelcomeBot.cs
where I'm stuck. These two methods are after OnMembersAddedAsync
which works fine.
ANSWER
Answered 2019-Jul-24 at 14:29If you’re using WebChat or directline, the bot’s ConversationUpdate is sent when the conversation is created and the user sides’ ConversationUpdate is sent when they first send a message. When ConversationUpdate is initially sent, there isn’t enough information in the message to construct the dialog stack. The reason that this appears to work in the emulator, is that the emulator simulates a sort of pseudo DirectLine, but both conversationUpdates are resolved at the same time in the emulator, and this is not the case for how the actual service performs. (source: How to properly send a greeting message and common issues from customers)
Currently it is not possible to use the conversationUpdate
event for the scenario you describe. You can solve this by sending a custom event when the WebChat is fully loaded, however you can’t use the default iframe provided by the Bot Service.
Have a look at implementing the Web Chat v4.
Have a look at a sample which shows how to implement a welcome activity when the bot first starts:
- WebChat v4 (recommended)
- WebChat v3
QUESTION
I am trying to build a chatbot with nested dialogs which is supposed to gather information from the user and store it in Azure CosmosDB. The dialog worked fine until I implemented the Cosmos DB storage. Now, with the CosmosDB storage the dialog loops on the first task in the first dialog, instead of continuing. How can I solve this problem?
Beginning with the dialogs, and how it was before implementing CosmosDB storage. I basically followed the code in this sample 43.complex-dialog.
Then, implementing the storage I used this answer as a guide. I set up the cosmosDB storage in Startup.cs like this:
...ANSWER
Answered 2019-Jul-17 at 19:19For now, it should work if you remove the PartitionKey
parameter from CosmosDbStorageOptions
. You will likely need to delete your Container or use a different name, since yours is currently partitioned. Easiest to just delete your Container and let the bot make one for you.
There's currently a bug in all the Bot Builder SDKs around reading from partitioned databases when the partitionKey is supplied. Tracking the issue here
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install welcomebot
In config.js file keep ur bot token , prefix and owner id
and dont forget to edit in owner.json
Convert the repo into node.js
type npm install to install the files
after installation type node index.js
now ur bot is online
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page