Skip to content

propelfuels/scsi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

scsi

Gem Version Code Climate security

A Ruby server for receiving Slack Slash Command and responding with Slack info.

Requirements

Getting Started

Install

$ gem install scsi

Optionally install Thin for more robustness.

Configure

Optionally, create a configuration file following the example below.

# Configure application logging
SCSI.logger = Logger.new(STDOUT)
SCSI.logger.level = Logger::DEBUG

SCSI::Config.setup do |c|
  # Optional: if any number of strings are set, it will require a matching
  #           "token" parameter in the incoming request (generated by Slack)
  c.tokens = [
    'sLaCkG3nEr4TeDt0KeN'
  ]
  # HTTP server (Sinatra) settings
  c.dump_errors = true
  c.logging = true
end

Run

In Slack, add a Slash Command configuration. Set the URL to wherever you're exposing the SCSI server at. (Hint: setup an SSL front; Slack requires your server to talk HTTPS. E.g., NGINX reverse proxy, Cloudflare.) Also, turn on the "Escape channels, users, and links" setting.

The minimum to start the SCSI server:

$ scsi-server start

Or, to use your configuration file:

$ scsi-server start -c config.rb

See help for more options:

$ scsi-server -h

Use

In any Slack channel, type your slash command; e.g., /slackinfo. You'll get a response like:

BOT 00:00 Only visible to you

SCSI: Slash Command Slack Info v0.0.0

channel_name
general

channel_id
C000AAAAA

About

SCSI: Slash Command Slack Info

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages