https://github.com/5xruby/womany-chatbot-template
https://github.com/5xruby/womany-chatbot-template
Last synced: 12 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/5xruby/womany-chatbot-template
- Owner: 5xRuby
- Created: 2017-06-21T08:41:05.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-07-09T02:21:17.000Z (almost 9 years ago)
- Last Synced: 2025-12-12T21:35:36.603Z (4 months ago)
- Language: Ruby
- Size: 8.79 KB
- Stars: 1
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Womany Chatbot Template
===
This is a Rails Template for Womany events.
## Usage
```bash
rails new PROJECT_NAME -m https://raw.githubusercontent.com/5xRuby/womany-chatbot-template/master/rails_template.rb
```
### Setup
For development, add your Facebook Messenger `access_token` into `.env` file
```bash
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.
### Development
An example file is put in `app/bot/message.rb`
```ruby
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](https://github.com/jgorset/facebook-messenger) gem.