Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

aboie

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aboie

  • 0.9.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Aboie

Aboie is a Framework for Facebook Messanger bots built with Ruby.

  • Parses incomming message json into the commonly required parts (Sender) and (Message)
  • Easily send text message responses via the Facebook Messanger API (Destination) & (Message)
  • Support for Rich Media messages. (TODO)

Why Aboie

Aboie is a french command when training dogs that means Speak or Bark.

Getting Started:

This assumes you have read the facebook docs https://developers.facebook.com/docs/messenger-platform, and have created an api key.

Installation:

Add

gem 'aboie

it

Configuration:

Create an initializer with the following

	 Aboie.configure do |config|
	   config.api_key = "messanger_api_key"
	 end

Parsing webhooks

Follow the instructions to setup an inbound webhook for the Messanger Api. Aboie can help you parse through the large object and make sense of it.

module Webhooks
  class FacebooksController < ActionController::Base
    include Webhooks::Facebook::Verifiable

    def create
      messages = Aboie.parse_payload(params)
      message = messages.first
      query = message[:text]
      response = Chat::Brain.ask(query)
      Aboie.send_text(message[:sender], response)
      render nothing: true, status: :ok
    end

  end
end

Aboie.parse_payload(params) will parse the array of potential messages, into a simple array containing a hash with {text: "Message", sender: "SenderId"} this data can be used to formulate a response and respond to the proper sender id, using Aboie's easy message sending capabilities via Aboie.send_text which takes a (sender_id, message) as outlined in the example.

Questions? Issues?

For issues, please submit a Github issue with steps on how to reproduce the problem.

Contributions

Contributions are welcome. Tests are encouraged.

To run tests / ensure your changes have not caused any regressions:

rspec

FAQs

Package last updated on 28 Apr 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc