બની એક બોટ સેવા પ્રદાતા સાથે આ બોટ કાવ્ય મેઘ બોટ પ્લેટફોર્મ
Self, AIML, and scripting

Making my bot search duckduckgo

દ્વારા pranavlal પોસ્ટ Feb 25 2017, 4:49

Hi all,
I have created a public bot called cisobot. It answers questions on information security. I want it to search duckduck go if it does not know an answer. I have created the first version of this bot in a language called quorom which is similar to java. However, I am trying to move the bot to botlibre. Right now, if the bot does not something it says "unknown" when my program sees this response, it searches duckduckgo for a response. If that fails, the bot asks the user to talk about information security. How do I implement the search functionality in botlibre?


by admin posted Feb 25 2017, 7:13
To search duckduckgo you will want to create a Self script in your bot to access the duckduckgo web API.

See,
https://www.botlibre.com/forum-post?id=13020078

Using a published web API is recommended, if the website does not provide a web API it is also possible to use HTML scraping.

If you want the bot to perform this function when it does not know a good response, you can add a srai or redirect() command to your bot's default response.

To do this set your bot's default response to this template,

Template("{redirect ("search duckduckgo " + sentence)}")

Then in your script you have...

pattern "search duckduckgo *" answer searchDuckduckgo();

function searchDuckduckgo() {...}

Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 1803, today: 3, week: 4, month: 16

ને: 15590450
પોસ્ટ: Feb 25 2017, 4:49
જવાબો: 1
જોવાઈ: 1722, આજે: 3, સપ્તાહ: 7, મહિને: 20
0 0 0.0/5