Employee schedule bot using Dialog flow - artificial-intelligence

I want to make employee task schedule chat bot : for example employee A go to company X at 4pm, employee B go to company Y at 2pm. Chat bot should send task and reminder to employees, and employee A can see his tasks and not employee B tasks and the same apply for employee B.
Can you suggest how to make this chat bot using Dialogflow, and may be how to implement employee login (using username and password ) using Dialogflow. Many Thanks!

Note that the main focus of Dialogflow is Natural Language Processing - Dialogflow is an NLU platform that makes it easy to design and integrate a conversational user interface into your mobile app, web application, device, bot, interactive voice response system, and so on.
If you want your chatbot to function as a task reminder that sends a message to its users based on a schedule, you’ll have to create your own implementation for it. On your custom backend, you’ll have to send a detectIntent request to your Dialogflow agent based on the user’s respective schedules.
You may check the respective documentation for ES detectIntent and CX detectIntent.
By default, Dialogflow is built in such a way that it will not provide a response unless it receives a user query from the end-user or an event from a client app first. However, based on your desired use case, the Dialogflow agent would have to initiate the conversation by sending a task reminder to the user.
To initiate a conversation with the user, you can try the following:
If you are using a custom integration, you may use a custom event to initiate a conversation with the user.
You can initiate a conversation by sending a detectIntent request to your agent to trigger a custom event. This lets your agent trigger a page with the custom event and send a response to the user without any user query or input.
To create a Custom Event is Dialogflow ES, you can follow the steps as described in the Configure an intent for events section of the Events documentation. You can then invoke the event via API by filling the queryInput.event field in your detectIntent request body.
To create a Custom Event in Dialogflow CX, you can follow the steps below:
Inside your flow, select the page you want to add a custom event to then click the "Event handlers". If the "Event handlers" is not visible, click the “Add route type” button to add the Event handlers.
Click on the + sign beside “event handlers” field and select any event.
Tick the check box beside “Use custom event”.
Add the name of the custom event you want to use.
Add the desired response under “Agent says”
Click save.
You can then invoke the event via API by filling the queryInput.event field in your detectIntent request body.
You can use Dialogflow ES’s Client Libraries and APIs or Dialogflow CX’s Client Libraries and APIs to create your own implementation/integration.
If you wish to use built-in text-based integration, you can also utilize the Dialogflow ES Messenger / Dialogflow CX Messenger integration.
You can utilize Dialogflow Messenger’s HTML “intent” attribute [ES/CX] to set an event to trigger the first intent when the chat dialog is opened.
Here’s an example of how to add the custom event name as value for the “intent” attribute of Dialogflow Messenger’s HTML embed code:
Dialogflow ES Messenger
Dialogflow CX Messenger
There are also JavaScript functions [ES/CX] available in which you may either choose from rendering a simple text message or a custom payload as an initial response to your end users. You may consider using the showMinChat [ES/CX] function to display a minimal version of the message list upon page reload.
You may check the respective documentations for ES Integrations and CX Integrations for more details.
Moreover, note that Dialogflow does not have a built-in user login feature - it is up to your chatbot’s front-end to require the user to login. One possible way to add a login feature to your chatbot is by creating a custom front-end for your chatbot that provides a login interface.

Related

How send notification into ms teams user from custom tab

I'm designing a custom team tab using React that calls third party API, I need after executing the API successfully, user gets notified . What is the best way to achieve this? I used Bot in my project, but not sure how can I call it from my custom tab class. I'm aware of the existence of proactive messaging, is it the only way to do it? If it is, a pointer on how to implement it to a custom tab would be appreciated.
If you're wanting to message the user 1-1 (like in the personal app), then proactive messaging is definitely what you need (inside a Team, there are other options), and considering you have the bot already in place that's perfect. The only thing you might be missing are the details required to send the actual proactive message (the best time to get them is when the bot is first installed by the user). In particular, you need ConversationId and ServiceUrl.
With regards the concept of Proactive Messaging, basically once the bot is installed, and you have the required values, you can -send- the message from any backend code at all. That can include, for example, custom tab's backend api. You need to identify the user, which you can do using the Teams Context (it's not the safest way but it's the easiest), and then look up the values in your own backend store (e.g. database or whatever) to get the ConversationId and ServiceUrl, then just message the user in your backend.

Does the Commerce API allow you to receive a query (via Webhooks or REST) that lets you know when a payment has been detected?

I'm rebuilding the CoinbaseCommerceButton component from scratch, and in order to improve the end-user experience I want to allow the user to continue on using my app after a payment has been detected. Is there a way to do this?
There are currently two ways to do this.
1. CoinbaseCommerceButton
There is an onPaymentDetected callback as documented here. After the callback is triggered, you can safely remove the button from the DOM and allow the user to continue using your application.
2. Webhook Subscriptions
Detected payments can also be registered for via webhooks with the charge:pending event type. See here for a more detailed explanation of how this can be achieved.

Maintaining the state of conversation in Facebook Messenger

I am building a facebook messenger bot which needs to take multiple inputs from the user. One way of storing all the inputs is to store them in database. However, I found a field "metadata" in the Send API request. The description of this field is also very promising - "Custom string that will be re-delivered to webhook listeners". However, when I fill this field with user inputs, I don't get them back with the next call.I used the sample app provided by Facebook to do this test.
Has anyone found a use for metadata property? Is it working?

Send updates to a user using Socket.io and nodejs

I'm building an app using MEAN Stack (something like Facebook). So a user can login to my app using different browsers and I want for example, if there user will add a new message to the MongoDB, I want to update his messages in the other sessions. The same of he will remove a massage. At the same time, there maybe logged in different users from different browsers and I want to notify the user with his update in the other sessions.
Does Socket.io supports such an option? And what is the best way to do it?
Thanks.
Yes socket.io do support that. Here is an example made by socket.io themselves: https://github.com/socketio/socket.io/tree/master/examples/chat
You should be looking for socket.on() which are the listeners for an event on the server side and look into socket.emit() which are the senders of the events. the .emit()could be added into an function which are triggered on a button click for example.
Depending on you needs, if you're going to send the message to every user using your app then you could use this above code. But if you only wants to send to a specific list of persons you should look into something called Rooms (http://socket.io/docs/rooms-and-namespaces/#rooms).
This does exactly what it sounds like, it emits the messages to the specific room where users have been added to when they connect to your application.

Create custom paypal button with link direct after payment

I am trying to create a custom paypal button for selling digital goods, that will direct the buyer to a link that will allow him to download the file.
I've read a bit this paypal article about advanced html variables but I am not sure which I have to use to make it work: https://developer.paypal.com/webapps/developer/docs/classic/paypal-payments-standard/integration-guide/Appx_websitestandard_htmlvariables/
Obviously the download should only initiate based on the payment ID to prevent free downloads, or is that done automatically by paypal?
What I would recommend us utilizing Instant Payment Notification (IPN) to handle all your post-payment processing tasks like updating your database, sending out email notifications (including one with a download link), etc.
Instant Payment Notification (IPN) is a message service that notifies
you of events related to PayPal transactions. You can use IPN messages
to automate back-office and administrative functions, such as
fulfilling orders, tracking customers, and providing status and other
transaction-related information.
This will allow you to not only automate the procedures, but also correctly handle things like e-checks or any other type of payment that may originally be in a "pending" status. You wouldn't want to deliver the digital goods until that payment actually clears. With IPN you will get 1 notification that your script can handle when the payment comes through as pending, and you would get another one when the payment updates to Completed, or Failed, or whatever.
The IPN's happen in real-time so buyers won't have to wait on anything. Whatever you're doing within the script would happen instantly upon the transaction completing.

Resources