https://github.com/vrann/magebot
Magento implementation of chat bot for Facebook Messanger
https://github.com/vrann/magebot
Last synced: about 1 month ago
JSON representation
Magento implementation of chat bot for Facebook Messanger
- Host: GitHub
- URL: https://github.com/vrann/magebot
- Owner: vrann
- Created: 2016-09-07T16:53:15.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-02-17T19:49:39.000Z (over 8 years ago)
- Last Synced: 2025-04-19T03:45:43.229Z (about 1 month ago)
- Language: PHP
- Size: 15.6 KB
- Stars: 12
- Watchers: 5
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Vrann Magebot
**Vrann Magebot** is an extension which implements simple Chat Bot for Facebook Messenger backed by Magento.
It configures Magento to read messages from the RabbitMQ with the text from Facebook Messenger. Messages should be written to RabbitMQ by https://github.com/vrann/http-rabbitmq-writer installed on public web endpoint and registered for webhook in Facebook.
While processing message, Magebot invokes handler which generates response to the message and writes it to the RabbitMQ. https://github.com/vrann/http-rabbitmq-writer will read messages from the RabbitMQ and send them to the Facebook.
## Presentation
[http://www.slideshare.net/vrann/mage-titans-usa-2016-magentofacebookrabbitmq](http://www.slideshare.net/vrann/mage-titans-usa-2016-magentofacebookrabbitmq)## Installation
1. Install https://github.com/vrann/http-rabbitmq-writer on public endpoint. Install RabbitMQ. Register callback.php to listen messages from the Facebook Messenger. Start response.php in daemon mode, to send responses back to the Facebook.
2. Install magebot extension on Magento:
```
composer require vrann/magechatbot
```
3. Start RabbitMQ consumer on Magento which will listen the queue with the messages from Facebook
```
bin/magento queue:consumers:start basic.consumer
```## Testing
Invoke vrann/magebot API through the Web API:
```
curl -XPOST -H "Content-Type: application/json" -d '{
"messageText": {
"object": "page",
"entry": [
{
"id": "287630798278680",
"time": 1471371304751,
"messaging": [
{
"sender": {
"id":"1011665925607547"
},
"recipient": {
"id":"287630798278680"
},
"timestamp":1471371209420,
"message": {
"mid": "mid.1471371209330:af0fa0dd167d847914",
"seq": 12,
"text": "Hi!"
}
}
]
}
]
}
}' http://{magento.url}/rest/V1/facebook-bot-message
```