Send unprovoked messages using NodeJS - node.js

Is there a way to send messages to channels without being provoked? For example every few hours a skype chatbot might remind you to call your mom.
I'm using Microsoft's new Bot Framework and the NodeJS sdk.

Yes... All of the built in Bot classes have a beginDialog() method which can be used to initiate a bot originated conversation with the user. The basics-naturalLanguage example shows a sample of this using the TextBot class and there's also the testBot example which shows this in action for all of the bots. For the TestBot you have to look at the 'dialogs/run-async.js' file to see the actual call.

Related

How to create a bot in lex/azure that respond in slack threads?

I have created 2 chatbots using AWS lex and Azure bot framework each. I have integrated them with slack and they respond to the mentions in channels.
Currently, the bot responds as a new message however I want it to respond in the slack thread of the original message posted by the user. I tried to look for articles in various places but could not find anything helpful. Does anyone have any idea on how to achieve this or a reference to a GitHub repo for a sample?
Since you are able to post replies, I am assuming that you are using chat.postMessage API.
https://api.slack.com/methods/chat.postMessage
To send the reply as a thread, all you need to do is that add thread_ts argument in the api call.
(Provide original message's ts (timestamp) value to make this message a reply.)

Azure Bot Creation with Natural Language understanding(LUIS)

I am facing issues while building a Voice bot using nodejs in Microsoft Azure, Currently i have made some research and built a sample chatbot which works fine using nodejs.
I have tried MS portals for voice bot integration and unable to take it forward, need guidance and suggestions.
My idea is getting a number from Twilio, then put my azure bot's end point URL in the twilio number.
Once my twilio gets an incoming call it will route the request to the Azure bot which will respond with a greeting and ask for few inputs, then the recorded voice should be passed to the LUIS app for Natural Language understanding and give the required text which will be further handled by the Azure bot.
I am not sure whether this is good solution, please suggest
I am not able to see any sample code for nodejs. Steps for integration and a basic sample code is what i need as a basic to start with, Your inputs/suggestions on this is highly appreciated.
Using the Bot Framework SDK for Node.js, you can specify text to be spoken by your bot on a speech-enabled channel in either of the following ways:
Set the IMessage.speak property and send the message using the session.send() method
Send the message using the session.say() method (passing parameters that specify display text, speech text, and options)
Send the message using a built-in prompt (specifying options speak and retrySpeak).
Feel free to review the following documentation provided and sample code for more details.
Update
Also check out Connect a bot to Twilio.

send typing notification in MSBOT framework in node.js

I have developed a bot in Bot framework. Once user responds to the bot and bot is processing it, i need to show the typing indicator to the user in the meanwhile for every 2 seconds . It should be working across all conversations of the chat.
Easy as pie. Node.js bots send a typing indicator to the user by executing session.SendTyping();
If you want to see what this looks like in the framework, you can find the code here
Also, Microsoft has a documentation page that talks specifically about this.

How to transfer conversation from Bot to human agents? in ibm watson using node js

I have created watson chat bot which answers users FAQ's using Node js as a middle ware. but how can i transfer the conversation from bot to any human agent.
In this case, you need to know: Watson Conversation Service is one endpoint API, so, you can call the service and creates one condition in your backend for identifying if the user wants to be attended for one's Human Agents or anything that you want to do with yours application.
For example, you can see the Project by IBM Developer's inside Watson Developer Cloud called conversation-simple using Node.js.
You can simply create one #intent condition in your chatbot likes:
if bot recognizes #wantsHumanAgent
response: Do you want to talk with one Professional?
And creates one #entity with the values: yes or no, after it, try to create one child node with the condition:
if bot recognizes #yesOrNo:yes
response: Please wait! I'll pass you on to an attendant.
Or you can add the link for the user's talks with the Attendant too, like:
if bot recognizes #yesOrNo:yes
response: The link to talk with one Attendent is <a target="_blank" href="https://yourlink.com">Talk to one Professional!</a>.<br/><br/>
Obs.: You can add one custom code to creates your functions or do something in your application using this example as a base, and creates one custom code for what you want: Add in your chat one option to talk with Human Agents.
Note.: This is just some's suggestions to use based on good practices. You need to guide your user in your Virtual Assistant for one better Attendance.
See more examples to build with Watson Conversation Service.

Developing Chat Bot using Wit.aI

I am planning to develop a chatbot using Wit.ai for Android and iOS. I want to have a server where I have the Bot engine. The Bot Engine has several components like Exported application from Wit.ai, calls to weather API, date API etc. When the user sends a message, it is sent to the Wit and it returns back a response. For example, when the user says, "What's the weather in New York, the message is forwarded to Wit which further calls weather API to fetch weather and returns it back to the bot. Bot in turn forwards to app which acts as the presentation layer."
I am planning to use the following to achieve the above:
Heroku to act as the server.
Wit.ai as the NLP
Planning to integrate app with messenger
Since I am new to this kind of programming and architecting, my questions are very basic. Please bear with that. I have the following questions:
Can I have a program uploaded on Heroku which talks to Wit.ai and other APIs? If yes, can someone show a detailed tutorial to call Heroku from app, how to make a call from Heroku to other APIs?
I was advised by some to use Firebase which is Baas. Can I achieve more using that?
With regards,
Suresh
We use the heroku to getting the https url,and if we got that ,we can set up webhook url in developer.facebook.com .
To understand more,follow this tutorial.
Remember when you try to test after you set up all,u need to test ur own account(means cant test every facebook account yet.)
To be public ur messenger bot,u need to wait 5 business days at least.

Resources