facebook-bot
Very easy Ruby on Rails client!! for Facebook Messenger Platform
Requires Rails >= 4.2.0
Installation
gem install 'facebook-bot'
Quickstart
#config/initializers/facebook_bot.rb
Facebook::Bot.config do |config|
config.access_token = <ACCESS_TOKEN>
config.validation_token = <VERIFY_TOKEN>
end
Example
#app/models/facebook_bot.rb
class FacebookBot
Facebook::Bot.on("message") do |event, sender|
sender.reply({ text: "Reply: #{event['message']['text']}" })
end
Facebook::Bot.on("delivery") do |event, sender|
#BlahBlah
end
Facebook::Bot.on("postback") do |event, sender|
#BlahBlah
end
end
license
MIT, see LICENSE.txt