slackify 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/README.md +24 -0
- data/lib/slackify/configuration.rb +1 -1
- data/lib/slackify/handlers/unhandled_handler.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a9eb0e55419a369b830a072f4755238a259368914b4acfb68c6f590f87c5622f
|
4
|
+
data.tar.gz: 1504168aaae4c0b69df9d56757abf8ee44792929146aaeb78e2b8c1726b096d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2055ad77d1a5a50f910f8371e45a13524ebb32ccacd519e35b2fc51aea82846ff986c5b5628891965efbb83d6807fc912419febff85cd46e25a7c3df22ec86da
|
7
|
+
data.tar.gz: da892b1e5f85dbe93b97649ceda4dbbc8bd6086205beb82a2b2b24554e9fc86695b78fef5d32f2e0e6331af62b02e4c781f55d4b09d00f0e0fafcfc43016d500
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -9,6 +9,7 @@ Slackify is a gem that allows to build slackbots on Rails using the [Event API](
|
|
9
9
|
* [Interactive messages](#handling-interactive-messages)
|
10
10
|
* [Slash Command](#handling-slash-commands)
|
11
11
|
* [Custom handler for event subtypes](#custom-handler-for-event-subtypes)
|
12
|
+
* [Custom unhandled handler](#custom-unhandled-handler)
|
12
13
|
* [Slack client](#slack-client)
|
13
14
|
* [Sending a simple message](#sending-a-simple-message)
|
14
15
|
* [Sending an interactive message](#sending-an-interactive-message)
|
@@ -96,6 +97,29 @@ Slackify.configuration.custom_event_subtype_handlers = {
|
|
96
97
|
|
97
98
|
In this example, all events of subtype `file_share` will be sent to the `ImageHandler` class.
|
98
99
|
|
100
|
+
### Custom unhandled handler
|
101
|
+
|
102
|
+
By default, the Slackify has a handler that will be called if there is no regex match for a plain text message. `Slackify::Handlers::UnhandledHandler#unhandled` is called and it replies to the user by saying "This command is not handled at the moment". You can update this in the configuration by specifying a handler class for `unhandled_handler` that responds to a class method named `unhandled`. If you do not wish to use any handler for unhandled message, you can call `remove_unhandled_handler`
|
103
|
+
|
104
|
+
```ruby
|
105
|
+
# config/application.rb
|
106
|
+
Slackify.configure do |config|
|
107
|
+
# ...
|
108
|
+
config.unhandled_handler = MyCustomHandlerClass # enables a custom unhandled handler
|
109
|
+
|
110
|
+
config.remove_unhandled_handler # removes the unhandled_handler
|
111
|
+
end
|
112
|
+
```
|
113
|
+
|
114
|
+
```ruby
|
115
|
+
# app/handlers/my_custom_handler_class.rb
|
116
|
+
class MyCustomHandlerClass
|
117
|
+
def self.unhandled(params)
|
118
|
+
# ...
|
119
|
+
end
|
120
|
+
end
|
121
|
+
```
|
122
|
+
|
99
123
|
## Slack client
|
100
124
|
In order to send messages, the [slack ruby client gem](https://github.com/slack-ruby/slack-ruby-client) was used. You can send plain text messages, images and interactive messages. Since the bot was envisioned being more repsonsive than proactive, the client was made available for handlers to call using the `slack_client` method. If you wish to send messages outside of handlers, you can get the slack client by calling `Slackify.configuration.slack_client`
|
101
125
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: slackify
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Leger
|
@@ -95,7 +95,8 @@ dependencies:
|
|
95
95
|
- - ">="
|
96
96
|
- !ruby/object:Gem::Version
|
97
97
|
version: '0'
|
98
|
-
description: Slackbot framework for Rails using the Events API
|
98
|
+
description: Slackbot framework for Rails using the Events API. Supports events, interactive
|
99
|
+
messages and slash commands.
|
99
100
|
email: hey@justinleger.ca
|
100
101
|
executables: []
|
101
102
|
extensions: []
|
@@ -141,5 +142,5 @@ rubyforge_project:
|
|
141
142
|
rubygems_version: 2.7.3
|
142
143
|
signing_key:
|
143
144
|
specification_version: 4
|
144
|
-
summary: Rails
|
145
|
+
summary: Slackbot framework for Rails using the Events API
|
145
146
|
test_files: []
|