0

I am trying to set the bot to where it will tell users if the business is opened or closed if asked the questions in the intent.

I have training phrases such as: "when do you close, are you open tomorrow, what time do you open tomorrow morning, are you open now, what are your business hours."

I was thinking that there would need to be code in the Fulfillment section that lists the business hours/days so the bot will essentially "scan" it and then spit back the answer to a user. I can't seem to find a tutorial on something that seems to be so basic.

This bot is just a basic bot using Dialogflow Messenger Integration.

NRS
  • 13
  • 3

1 Answers1

0

Instead of using Fulfillment, you can create an Entity and then create an Intent that uses the entity you just created.

In your case, the entity I created is to have a synonym for the word "close", "open" and "business hours". You may try and create your own based on my sample entity below by following this creation of custom entities documentation. enter image description here

Next is to create an intent that uses the created entity on the above sample.

On my sample, I used the training phrases you provided on your post. This will automatically detect the entity we earlier defined because we used the words "open", "close", and "business hours" in the training phrases. enter image description here

Last is to configure the Responses and use the value of theentity we created as a response. enter image description here

You may refer to this creation of custom intent documentation for complete reference.

Below is the final Dialogflow Messenger Integration sample. enter image description here

Scott B
  • 2,516
  • 1
  • 8
  • 15
  • Hello! That was super helpful and I was able to expand it to some other areas like days of the week. If someone asks "are you open tomorrow at 6pm" and the business is closed, would you use the same logic? – NRS May 11 '22 at 18:02
  • @NRS For "are you open tomorrow at 6pm", I think it would be better to create a separate `intent` and an `entity` that you can configure the synonyms for the time. (Ex: 6pm --> No, 5pm --> Yes) something like this so you can get the answer "Yes" or "No" for the training phrase "are you open tomorrow at 6pm" and other related training phrases. Also, if you find my posted answer as helpful, you may upvote/accept it so that way others know that you've been (sufficiently) helped. – Scott B May 18 '22 at 07:51