Dialogflow Send message without user intent - javascript

Looking to find a way to make dialogflow send a message to the user every x minutes,
without any intent or user action required.
is there a way to do this? maybe making a custom event?
If someoneone could explain if this is possible that be great.
im also using nodejs for my bot.

No, this isn't possible. Dialogflow is designed for conversational exchanges.

Dialogflow is a NLP engine, It's designed to respond to the user input(either a text input, or an event request).
One way to do resolve this issue is, from the Client side run a thread that will send event request asynchronously after every x minutes, and the bot will reply with a message.
Visit https://dialogflow.com/docs/events/custom-events for more information.
Please reply if you need any more information/example on this.

As #Prisoner said it isn't possible to do with dialogflow itself but you can look into assistant push notifications where you can get permission from user to send notifications and if user allow then you can send notification periodically. You can find more in docs.

Related

Stop dialogflow from sending a response

Is there a way to stop dialogflow from replying any of the responses added in the dialogflow console using the nodejs SDK?
I have created a few intents, which have each their own responses. Now I want to add a sort of handover functionality through a fulfillment webhook.
Basically it should work like this: when the user asks for a human to chat, the API stores the session and any new call should check if the session is marked as "waiting for human". If it is, then no reply should be send by dialogflow any longer. In this way, the human can chat without interruptions. If the session is not marked, then a the regular responses should be sent. So here's the question: how can I avoid dialogflow from sending any of the responses without moving the responses to the API?
Thank you in advance

How to integrate a chatbot webhook with a web-based chat window?

I want to develop a web-based chat conversation. I have a Dialogflow webhook that is up and running and that can be easily integrated with, say, facebook messenger or whatsapp, thanks to the functionalities of Dialogflow itself.
Now, say I want to have a web-based chat plugin that I want to interact with said Dialogflow webhook. How does that work, in terms of setup? There are things I know I need, I would like your help to identify things that are still missing and to help me put them all together (conceptually).
I need something to make the chat conversation look pretty; I was hoping there would be some chat plugin online to style messages but the things I could find are always more complicated than that and have functionalities for you to set messages for the plugin to send automatically and things like that.
I need something that is triggered when the user sends a message; when the user sends a message I need to send it to Dialogflow in order to have it fulfilled. Can this be done directly from JS? Or do I have to send some request to my server, which will then call Dialogflow and return the user message?
Is this all I need? I am sorry if this question is too confusing or broad, I'll be glad to give further clarifications as needed.
I think you need this.
https://cloud.google.com/dialogflow/docs/quick/api#detect-intent-text-nodejs
When you use the API for interactions, your service interacts directly with the end-user. For each conversational turn, your service sends end-user expressions to Dialogflow by calling the detectIntent or streamingDetectIntent method of the Sessions type. Dialogflow responds with information about the matched intent, the action, the parameters, and the response defined for the intent. Your service performs actions as needed (for example, database queries or external API calls) and sends a message to the end-user.
It just API interaction with your chat client, you can design the way you want.

Is there any way to return a response from XMPP after sending a message?

When I send a message to a XMPP openfire user, I need a response of the particular user's activity. Like if he/she saw the message or not, typing a message for me or not etc. I am using Monitoring Service plugin of openfire, so I can get all chat history from there, i need to know about receiver activity about that particular message or conversation.
Now I am using strophe.js to handle all my requests and responses in my web page.
Is there any way with their plugins(like strophe) to make this..?
Can any one help me to solve this problem, i am new to XMPP openfire server.
thanks,
biswajit
XEP-0184: Message Delivery Receipts - http://xmpp.org/extensions/xep-0184.html
XEP-0085: Chat State Notifications - http://xmpp.org/extensions/xep-0085.html

It is possible to send a message to a specific user (selective push notification) using nowjs and node.js

I have a group a users, all connected to a single server, and I want to send a message from one user to another user, with the receiving user not having to accept any sort of a request from the originating message. So I am trying to use nowjs for this, where I would simply broadcast the msg meant for a specific user, and only the required user would accept it. In short I need to send something like a selective push notification. Do you think this approach of broadcasting is a good idea, as I think I will have max 300 users at once, and if not do have any others suggestions how I can implement this. Thanks in advance.

Implementing web chat, how do I get typing status?

Can someone illustrate how I can get typing status of the other party with JavaScript?
UPDATE
Can someone recommend a one-to-one open source chatting application, preferably written in PHP? I only found open source chatting rooms which are for chatting among all onliners, but I just need a one-to-one chatting.
Here are a list of PHP-based open-source instant messaging software.
Some of those might be relevant for you.
For example, if you had an text area #chat then you could use this code to attach the event:
document.getElementById('chat').addEventListener('keydown', FUNCTION HERE, false);
See http streaming and some ready solutions here: http://ajaxpatterns.org/HTTP_Streaming
this is how google talk does it. And there are ready php or c++ solutions
It was quie a discovery for me!
This is an update to reflect the significant change in the OP's question:
Google Chat and Facebook both use XMPP(jabber) servers, as do most companies I know of that have internal instant messaging.
The nice part about XMPP is that you get all of the "is typing" and other presence-based information without having to roll-your-own in javascript (bear in mind, you will still need to use javascript to pass XMPP requests back to the server, but XMPP has most of the features you'd need already built in).
Check out OpenFire. It's a great XMPP server, totally open source, and they have a web-based version of their Spark client that is pretty nice.
Or you could get a PHP library for XMPP (there are a few). But you'd still need to have the XMPP server running in the background for PHP to work with.
Here's a list of XMPP libraries for PHP from XMPP.org:
Eiffel
JAXL
Lightr
Missus
xmpphp
Or, if you want to keep things mostly browser-side, they also have a list of libraries for javascript:
dojox.xmpp
js.io
JSJaC
strophe.js
xmpp4gwt
xmpp4js
I made a small chat application a while ago, and the only way to do it is to frequently check for new entries in the chat database and fetch anything newer than the last displayed message. At the same time as all that, you can check to see if the user's input is empty. If it is, do nothing. If it isn't, enter a status code into the database beside that user's name. If anyone has that status in the database when you're fetching information about new messages and who is online, you should display the 'user is typing' message. I hope that makes sense...let me know if it isn't.
For User1: If you save the chat message on each key-press to the database, with a status: sent=false and update the last updated date.
For User2: you could pole periodically for the presence of a message where sent=false and use the last updated to update user is typing message. if the lastupdated date is more than a say ten seconds you could remove the message as that person may have stopped typing. This will allow User2 to see User1 typing, stopping and continueing again.
Ideally polling for this information will be part of an existing call to the database to reduce additional overhead.

Categories

Resources