This is a Rails Template for Womany events.
rails new PROJECT_NAME -m https://raw.githubusercontent.com/5xRuby/womany-chatbot-template/master/rails_template.rb
For development, add your Facebook Messenger access_token
into .env
file
ACCESS_TOKEN=(YOUR_FAN_PAGE_ACCESS_TOKEN)
APP_SECRET=(YOUR_FACEBOOK_APP_SECRET)
# For first time setup, you may want to use `rake secret` to generate `VERIFY_TOKEN` for facebook.
VERIFY_TOKEN=
After setup Facebook Messenger, go to Facebook App and verify Messenger's Webhook and subscribe it.
An example file is put in app/bot/message.rb
include Facebook::Messenger
Bot.on :message do |message|
# TODO: Make bot replay something
message.reply(text: 'Hello, human!')
end
Add your code to handle the message and reply user.
More supported event can reference facebook-messenger gem.