Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nunonamorado/sinatra-slack
Sintra extension with DSL for building Slack Apps
https://github.com/nunonamorado/sinatra-slack
ruby ruby-gem sinatra sinatra-applications slack slack-app slack-commands
Last synced: 15 days ago
JSON representation
Sintra extension with DSL for building Slack Apps
- Host: GitHub
- URL: https://github.com/nunonamorado/sinatra-slack
- Owner: nunonamorado
- License: mit
- Created: 2019-02-03T17:32:06.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-03-16T11:19:16.000Z (almost 2 years ago)
- Last Synced: 2024-11-15T18:08:50.166Z (about 2 months ago)
- Topics: ruby, ruby-gem, sinatra, sinatra-applications, slack, slack-app, slack-commands
- Language: Ruby
- Size: 79.1 KB
- Stars: 7
- Watchers: 2
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Sinatra::Slack
[![Gem Version](https://badge.fury.io/rb/sinatra-slack.svg)](https://badge.fury.io/rb/sinatra-slack)
[![Maintainability](https://api.codeclimate.com/v1/badges/37325817408caa0872e6/maintainability)](https://codeclimate.com/github/nunonamorado/sinatra-slack/maintainability)
[![Test Coverage](https://api.codeclimate.com/v1/badges/37325817408caa0872e6/test_coverage)](https://codeclimate.com/github/nunonamorado/sinatra-slack/test_coverage)> Note: WIP
Creating your first Slack Slash Command application has never been to easy. Combining `sinatra` and `sinatra-slack` DSL, you can quickly create a app that processes Slash Commands with ease.
## Installation
Add this line to your application's Gemfile:
```ruby
gem 'sinatra-slack'
```And then execute:
$ bundle
Or install it yourself as:
$ gem install sinatra-slack
## Dependencies
This gem currently requires you to use [Thin](https://github.com/macournoyer/thin).
## Example
Go to folder example for more information. Learn how to create a Slack App in https://api.slack.com
## Usage
``` ruby
require "sinatra/base"
require "sinatra/slack"class App < Sinatra::Base
register Sinatra::Slackconfigure :production, :development do
enable :loggingbefore { logger.info "Received: #{params}" }
endset :slack_secret, ENV['SLACK_SIGNING_SECRET']
commands_endpoint "/slack/commands"
actions_endpoint "/slack/actions"command "/command *sub_command :spot_name" do |sub_command, spot_name|
"Executed *command* command \n[subcommand]: #{sub_command} \n[args]: #{spot_name}"
end
end
```## TODO
- Adds specs;
- Update message helper to use the new [Block Kit](https://api.slack.com/reference/messaging/block-elements);
- Add more [Interactive Component Elements](https://api.slack.com/reference/messaging/interactive-components). Currently there is only support for *buttons* and *menu*.## Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/nunonamorado/sinatra-slack. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
## License
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).