No commit activity in last 3 years
No release in over 3 years
Slack bot boilerplate for response on different events.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
>= 0
= 0.58.2
>= 0

Runtime

 Project Readme

Slack-Ruby-Bot-Boilerplate

A generic Slack bot framework written in Ruby on top of slack-ruby-client. It is slack-ruby-bot but without server, only commands parsing part.

Useful to Me?

Usage

A Minimal Bot

Gemfile

source 'https://rubygems.org'

gem 'slack-ruby-bot-boilerplate'

pongbot.rb

require 'slack_respondent'
require 'pong_command'

class PongBot 
  include SlackRespondent::Reactions
  
  def initialize
    on("app_mention", PongCommand)
  end

  def call(request)
    react(request["event"]["type"], request["event"])
  end

end

pong_command.rb

class PongCommand
  help do
    title 'candidate import'
    desc 'Import new candidate to HR app'
  end

  def self.call(client, data, _match)
    client.say(channel: data.channel, text: "Pong")
  end
end

After registering the bot, run with SLACK_API_TOKEN=... bundle exec ruby pongbot.rb. Have the bot join a channel and send it a ping.

A Production Bot

More Involved Examples

Commands and Operators