my Game Of Thrones Bot on http://m.me/gotoraven , https://www.facebook.com/gotoraven/
Back-end AWS EC2 Front-end FB Messenger
Overview
JS will interact with Facebook Graph API to handle request and response. It is designed to handle minimum load. It calls a Python file every time it receives something. This Python file writes a JSON file (output). JS just sends the entire JSON file as a response to FB Graph.
Every request is passed on from bot.js to parent.py. Python does computation and writes request ready to be sent in JSON (gres.json).
Pattern matching conversation happens.
Rules
- CSV has 2 columns. First column defines pattern. Second Column defines possible response.
- Pattern is specified between * (asterisk)
- Multiple patterns are separated by _ (underscore)
- You can set a "DefaultResponse" row in CSV which will be the default response.
Check out simple CSV file to understand rules. Advance section below has link to more elaborate discussion.
Note: please be sure not to include an empty Pattern(**
) to Match as default response. But specify a DefaultResponse separately. Otherwise multiple patterns will never be matched.
Read [Actions Architecture in NatOS] (https://github.com/ruchir594/NatOS/tree/master/ActionsA) to understand role of ActionsA in this repo.