An open API service indexing awesome lists of open source software.

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

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

![Example](https://i.imgur.com/YTMOYg6.gif)


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