|
1 |
| -# simple-slack-bot |
2 |
| -You can easily make Slack Bot!! |
| 1 | +# SimpleSlackBot |
| 2 | +[](https://travis-ci.org/kciter/simple-slack-bot) |
| 3 | + |
| 4 | +This library wrapping [slack-ruby-client](https://github.com/dblock/slack-ruby-client) library |
| 5 | + |
| 6 | +## Preview |
| 7 | +<img src="https://github.com/kciter/simple-slack-bot/raw/master/images/preview.gif" alt="Preview gif"> |
| 8 | + |
| 9 | +## Installation |
| 10 | +Add this line to your application's Gemfile: |
| 11 | +```ruby |
| 12 | +gem 'simple-slack-bot' |
| 13 | +``` |
| 14 | +And then execute: |
| 15 | +``` |
| 16 | +$ bundle |
| 17 | +``` |
| 18 | +Or install it yourself as: |
| 19 | +``` |
| 20 | +$ gem install simple-slack-bot |
| 21 | +``` |
| 22 | + |
| 23 | +## Simple Usage |
| 24 | +This is simple! |
| 25 | +```ruby |
| 26 | +require 'simple-slack-bot' |
| 27 | + |
| 28 | +bot = SlackBot::Client.new |
| 29 | + |
| 30 | +bot.configure do |config| |
| 31 | + config.join_message = 'Hello!' |
| 32 | + config.debug = true # |
| 33 | + config.token = 'YOUR SLACK BOT TOKEN' |
| 34 | +end |
| 35 | + |
| 36 | +bot.add_command /Hello/ do |data| |
| 37 | + bot.message(data['channel'], "Hello. <@#{data['user']}>!") |
| 38 | +end |
| 39 | + |
| 40 | +bot.start! |
| 41 | +``` |
| 42 | +Refer to the Slack event message for [data](https://api.slack.com/events/message) |
| 43 | + |
| 44 | +## License |
| 45 | +The MIT License (MIT) |
| 46 | + |
| 47 | +Copyright (c) 2016 Lee Sun-Hyoup |
| 48 | + |
| 49 | +Permission is hereby granted, free of charge, to any person obtaining a copy |
| 50 | +of this software and associated documentation files (the "Software"), to deal |
| 51 | +in the Software without restriction, including without limitation the rights |
| 52 | +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 53 | +copies of the Software, and to permit persons to whom the Software is |
| 54 | +furnished to do so, subject to the following conditions: |
| 55 | + |
| 56 | +The above copyright notice and this permission notice shall be included in all |
| 57 | +copies or substantial portions of the Software. |
| 58 | + |
| 59 | +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 60 | +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 61 | +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 62 | +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 63 | +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 64 | +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 65 | +SOFTWARE. |
0 commit comments