/lita-flowdock

Flowdock adapter for the lita.io chatbot

Primary LanguageRubyMIT LicenseMIT

lita-flowdock

Build Status Coverage Status

Welcome!

Lita is a chat service bot, similar to hubot, but written in ruby. lita-flowdock is an adapter to connect Lita to the Flowdock chat service.

Disclaimer

This code is heavily based on the awesome work by kenjij and jimmycuadra in the lita-slack adapter. Changes were made for the difference in the API's between the services.

Slack uses a bi-directional Websockets API for listening to and posting messages, whereas Flowdock uses a one-way Server-Sent Events stream for listening in real-time, and a REST API for posting messages.

Installation

Add lita-flowdock to your Lita instance's Gemfile:

gem "lita-flowdock"

For quick setup, see the Getting Started page.

Configuration

Required Attributes

  • api_token (String) - The bot's personal API token
  • Login to https://flowdock.com with the bot account
  • Get the personal API token from https://flowdock.com/account/tokens
  • organization (String) - The organization for the flowdock account
  • flows (Array) - Array of flows the bot should connect to, i.e. main

Optional Attributes

  • thread_responses (Symbol) - Respond to the original message in a Flowdock thread
  • default: :enabled
  • other values: :disabled

Example

lita_config.rb

Lita.configure do |config|
  config.robot.adapter = :flowdock
  config.robot.name = 'John_McClane'

  config.robot.adapters.flowdock.api_token = '210bf4d1ae890b20265313fdc907903c'
  config.robot.adapters.flowdock.organization = 'mycompany'
  config.robot.adapters.flowdock.flows = ['main', 'ops']
end

Using Chef cookbook attributes

default['lita']['adapters'] = ['flowdock']
default['lita']['adapter_config']['flowdock'] = {
  'api_token'     => ENV['FLOWDOCK_API_TOKEN'],
  'organization'  => 'mycompany',
  'flows'         => ['main', 'ops']
}

License

MIT