https://github.com/jun85664396/facebook-messenger-bot-example
facebook messenger bot example for Ruby on Rails
https://github.com/jun85664396/facebook-messenger-bot-example
Last synced: about 1 year ago
JSON representation
facebook messenger bot example for Ruby on Rails
- Host: GitHub
- URL: https://github.com/jun85664396/facebook-messenger-bot-example
- Owner: jun85664396
- License: mit
- Created: 2016-04-15T03:00:26.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2016-04-17T09:13:41.000Z (about 10 years ago)
- Last Synced: 2025-03-20T00:03:51.059Z (about 1 year ago)
- Language: Ruby
- Homepage:
- Size: 22.5 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
#facebook-messenger-bot
A Ruby on Rails example for the Facebook Messenger Platform(Bot).
Requires Rails >= 4.2.0
##Installation
git clone https://github.com/jun85664396/facebook-messenger-bot
bundle install
##initialization
vim .env
ACCESS_TOKEN=
VERIFY_TOKEN=
##Usage

15 text = event["message"]["text"]
# Handle a text message from this sender
16 res = FacebookBot.new.send_text_message(sender, "reply: #{text}")
17 # res = FacebookBot.new.send_generic_message()
18 # { ret: true or false, body: response_body }
template example : https://developers.facebook.com/docs/messenger-platform/send-api-reference#examples