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

slack-ruby-bot-boilerplate

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

slack-ruby-bot-boilerplate

  • 0.1.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

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

FAQs

Package last updated on 11 Feb 2019

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