How to send a response to dialogflow later - dialogflow-es

I am using dialogflow by google to create a bot.
When my user ask my bot for a report with several parameters, I need to create the report and send him the link to download it.
The report is created in about 1 minute. When I send the response (JSON(fulfillmentText = "my url")) of the POST request of my webhook, dialogflow send me an error : time out.
So I need to send immediately the message "Please wait..." and then, when the report is created, send to my user a new message with the url of my report.
I am trying to use the API V2 but I cannot find in the documentation a way to send a message to a user when the POST request is already done.

This is not possible, the interactions with Dialogflow agents are intended to be conversational and must be initiated by the user. The timeout for your fulfillments response is five seconds.
It would probably be a better user experience anyway if you get an email address from the user and send them the link there, either by asking for it with the #sys.email system entity (be aware of privacy issues though) or by using account linking.

Related

How to use the Discord JS Client without logging in?

I have a service that listens for certain updates and then uses a Discord Bot to post a message on a channel. A random example: every time a team scores a goal, post a message in a channel. I got an email from Discord to reset my bot token because there were too many logins.
As you know, in order to use the Bot you use the client.login("XXX") method. So every time there is an update my service initializes the bot and then sends a message. My assumption is that it has to do with me calling client.login("XXX") for every update. Since my service runs serverless, I can not keep the service up.
Is there a way to make the bot post a message without having to use client.login("XXX")? Or can anyone suggest any strategy to make this logic work?
That is not possible as a bot cannot do any actions without being logged in, it sounds like channel webhooks would fit your needs better.
You simply generate a webhook link in a channel which you can then post messages to through a post request.
You can read more about webhooks here
And you can read more about the required paramters and how to format a POST request to the webhook here

What is the Get URL to fetch TEAM roster or user profile information?

Can someone please share the postman to fetch TEAM roster or user profile information. I am referring to https://learn.microsoft.com/en-us/microsoftteams/platform/bots/how-to/get-teams-context?tabs=json
The Url you need is this: [serviceUrl] + "/v3/conversations/{teamId}/members/"
and it is based on two variables: the "teamId" is obviously different per team. However, the first part of the address (called the ServiceUrl) can also vary between teams, based on where they might be hosted, and you need both.
It sounds like, from the link you sent, that you already have a bot? If so, your bot can retrieve both of these required parameters. One way is that, whenever a user sends a message to the bot, to get the ServiceUrl and TeamId that are sent in the incoming "activity" object that. However, if you want it even earlier than this (i.e. before a user even sends a message to the bot), have a look at the conversationUpdate event here which will fire right when the bot is first added to the conversation.
Does that help?

No user messages on Chatbase transcripts

I've been trying to take advantage of the Transcripts feature in Chatbase, but whenever I open a transcript all the user messages are shown as (No content).
The messages sent by the bot are all shown properly and the order of the messages is correct as well (both user and bot). On the messages report tab I can see the user messages so they are being sent across properly.
I'm sending all the messages using the generic message API, with the original text on the message field.
This has been happening consistently for me on all projects, so I'm probably doing something wrong..any ideas?
I work on Chatbase and would be happy to look into your issue. If you could please contact chatbase-support#google.com and provide the api key, the name of the bot, or the email address you used to create the account I will be happy to look into the issue for you.

What is the best way to implement a reply logic for a Chatbot

im a noob at making chatbots, and Im having some difficulties understanding how to make the bot reply back to queries and intents dynamically. My chatbot depends on replying back meaningful messages, more than fulfilling a request. Im was working with dialogflow but I thought Wit.ai would be more suitable, so I switched recently. But I still cant find how to train the bot to reply using RNN so it can first parse the intents, then reply back based on them. Any suggestions ?
Kuddos.
The request flow with wit.ai as follows,
First request is made by the user using the message provider(i.e, facebook messanger, slack, ect...), this request is received by the wit.ai. Then the all the required information is extracted by the wit.ai, then all the request parameters is sent to the webhook you specified in the wit.ai.
In the webhook you process the input parameters and respond to it according to it(e.g: user querying for restaurant search, wit provides the the name of the restaurant, you query data base using the name and prepares the response).
Then the prepared response is sent back to the wit.ai from webhook, then wit delivers your message to the respective user and message provider..
So you no need to train any rnn for responding the user.but if your business logic requires the rnn training you have to do it in the webhook (it's your web server).
You can refer to this link for more info: https://dialogflow.com/docs/fulfillment

Facebook Messenger Chatbot messages tagging (of sorts)

I have a Facebook Messenger bot (written in NodeJS) and a separate control panel where a user can manage the information that the bot is working with (like inventory stock, etc.). One of those things is a log of all conversations between the bot and a visitor. The control panel allows the admin users to send messages to visitors through the bot. There is an input box where they can type in a message and when they click 'Send', the message goes to the bot app, which then sends it back to the user through Send API.
Messages are logged into a database; those going to the bot (from the visitor) are logged when they're received, and those the bot responds with are logged through the 'echo' callback.
The problem with this is that the bot can reply to certain visitor commands (phrases) and tries to perform certain actions based on the input. I'm using Wit.ai for this, but due to the scope of the possible phrases and keywords, the default mode when someone sends a text message is to send it to Wit.ai for processing. However, if an admin user sends the visitor a message from the control panel, the visitor could want to respond to that message (instead of sending a bot command) and that response should not go to the Wit.ai for processing. And due to the sheer scope of possible variations of what can be said, coupled with the fact that they can actually use some of the keywords in the response as well, processing the intent with Wit.ai in that case is too uncertain.
I was wondering if there's a way to somehow identify/mark the source of the messages that the bot sends to the visitor, so when an echo callback comes, I can know if it's, say, from a regular bot routine or from a user-entered reply. Like some additional meta tags that could be sent with the message that would also get returned with the echo, but that doesn't pollute the message itself. Is something like that possible? Or is there a different way I can achieve the same result.
I don't wether that helps you, but Facebook just recently integrated a quite mysterious Tag feature for bots.
https://developers.facebook.com/docs/messenger-platform/send-api-reference/tags

Resources