There is Node.js SDK with an npm module for Wit.ai app that we need to install:
>> npm install --save node-wit
In the GitHub repository of the SDK, there are a few examples, and one of them is the usage of the API with the Messenger. What we can do is grab that example and use it as a base for our app. The link to the examples is https://github.com/wit-ai/node-wit/tree/master/examples.
On the server in the fb_messages folder, create bot.js and fb_messages.js files:
Let's start from the fb_message.js file. We will create a simple function that will get the id of the recipient for parameters and the text ...