Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does Facebook Messenger connect with Wit.ai Bot Engine?

In Facebook's documentation they refer to wit.ai Bot Engine, but I can't find anywhere online where its explained how to connect the Story that you build in Wit with your Facebook Messenger App?

like image 389
GarySabo Avatar asked May 13 '16 23:05

GarySabo


People also ask

Does Facebook Messenger have bots?

Four years after Mark Zuckerberg announced the arrival of Facebook Messenger bots, the technology has established its value for brands many times over.

How does Messenger bot work?

A Facebook Messenger bot is a chatbot that lives within Facebook Messenger, meaning it converses with some of the 1.3 billion people who use Facebook Messenger every month. Chatbots can be programmed to understand questions, provide answers, and execute tasks.


2 Answers

Wit.ai needs an input - user input. Sentence, phrase, word - to give you back the analysed results.

So first when you say "your Facebook Messenger app" - you need to make sure you are handling the messenger part by itself: have a code in your language of preference running on the server\your laptop which can receive the text which is sent to the messenger account on Facebook.

When you get that working, you will have to use one of Wit.ai libraries for the code language you are using to pass that phrase you receive from the user chatting through the messenger to Wit.ai "library" which will communicate it "to the wit.ai stories" you have and get the result from them.

For example for Python:

  • Library to handle FB Messenger chatting
  • Wit.ai library to pass the user input "to stories and get result"
like image 53
GeekSince1982 Avatar answered Dec 06 '22 12:12

GeekSince1982


You can integrate Wit to any messaging API. Using the Messenger Send/Receive API for example, you will be able to get and receive messages from/to Messenger users. Wit.ai can then parse the messages and predict the next response.

Here is an example in Node js: https://github.com/wit-ai/node-wit/blob/master/examples/messenger.js

like image 32
l5t Avatar answered Dec 06 '22 12:12

l5t