slack-api 1.1.6 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -1
- data/README.md +4 -0
- data/lib/generators/tasks/generate.rb +1 -1
- data/lib/generators/templates/method.rb.erb +1 -0
- data/lib/slack/endpoint/api.rb +1 -0
- data/lib/slack/endpoint/auth.rb +1 -0
- data/lib/slack/endpoint/channels.rb +16 -0
- data/lib/slack/endpoint/chat.rb +11 -2
- data/lib/slack/endpoint/emoji.rb +1 -0
- data/lib/slack/endpoint/files.rb +4 -0
- data/lib/slack/endpoint/groups.rb +18 -0
- data/lib/slack/endpoint/im.rb +7 -0
- data/lib/slack/endpoint/mpim.rb +90 -0
- data/lib/slack/endpoint/oauth.rb +1 -0
- data/lib/slack/endpoint/pins.rb +64 -0
- data/lib/slack/endpoint/presence.rb +1 -0
- data/lib/slack/endpoint/reactions.rb +94 -0
- data/lib/slack/endpoint/search.rb +3 -0
- data/lib/slack/endpoint/stars.rb +41 -0
- data/lib/slack/endpoint/team.rb +25 -0
- data/lib/slack/endpoint/users.rb +7 -0
- data/lib/slack/endpoint.rb +6 -0
- data/lib/slack/version.rb +1 -1
- data/lib/slack.rb +2 -2
- metadata +6 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 56820829530b95e9d0e96bcabe76c6300f6d94ee
|
4
|
+
data.tar.gz: fde611640ede2148a8415911649dc8f73e0266ba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6215be33d787b12fe2e91d63ac5cb32efd9ce9c41d3b2806d0e646e8b3ff87f970f5b6050ccb952a98b970b0cbade7af3aab012478dbe37e3b8e2e1fbc9cee89
|
7
|
+
data.tar.gz: e62a20d71ed0fc36d900a0ba2cd0e37d6e5077356a3cb62603140853044125a85882544caf22e7bd2dbef9c3d17dbd905e177732923d3bdbb00af1540e171e7b
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -32,6 +32,10 @@ end
|
|
32
32
|
Slack.auth_test
|
33
33
|
```
|
34
34
|
|
35
|
+
### RTM
|
36
|
+
|
37
|
+
[Slack Bot Real Time Messaging API Integration in Ruby Tutorial](http://code.dblock.org/2015/04/28/slack-bot-real-time-messaging-api-integration-tutorial.html) thanks @dblock
|
38
|
+
|
35
39
|
## Contributing
|
36
40
|
|
37
41
|
1. Fork it ( http://github.com/aki017/slack-ruby-gem/fork )
|
@@ -20,7 +20,7 @@ namespace :api do
|
|
20
20
|
schema_path = File.expand_path "lib/generators/schema.json", root
|
21
21
|
schema = JSON.parse(File.read(schema_path))
|
22
22
|
|
23
|
-
data = Dir.glob(jsons).each_with_object({}) do |path, result|
|
23
|
+
data = Dir.glob(jsons).sort.each_with_object({}) do |path, result|
|
24
24
|
name = File.basename(path, ".json")
|
25
25
|
prefix, name = name.split(".")
|
26
26
|
next if prefix == "rtm"
|
@@ -22,6 +22,7 @@ module Slack
|
|
22
22
|
<% data["args"].reject{|k, v| k=="token"}.select{|k,v| v["required"]}.each do |arg_name, arg_v| %>
|
23
23
|
throw ArgumentError.new("Required arguments :<%= arg_name %> missing") if options[:<%= arg_name %>].nil?
|
24
24
|
<% end %>
|
25
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
25
26
|
post("<%= group %>.<%= name %>", options)
|
26
27
|
end
|
27
28
|
|
data/lib/slack/endpoint/api.rb
CHANGED
@@ -14,6 +14,7 @@ module Slack
|
|
14
14
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/api.test.md
|
15
15
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/api.test.json
|
16
16
|
def api_test(options={})
|
17
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
17
18
|
post("api.test", options)
|
18
19
|
end
|
19
20
|
|
data/lib/slack/endpoint/auth.rb
CHANGED
@@ -10,6 +10,7 @@ module Slack
|
|
10
10
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/auth.test.md
|
11
11
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/auth.test.json
|
12
12
|
def auth_test(options={})
|
13
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
13
14
|
post("auth.test", options)
|
14
15
|
end
|
15
16
|
|
@@ -13,6 +13,7 @@ module Slack
|
|
13
13
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/channels.archive.json
|
14
14
|
def channels_archive(options={})
|
15
15
|
throw ArgumentError.new("Required arguments :channel missing") if options[:channel].nil?
|
16
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
16
17
|
post("channels.archive", options)
|
17
18
|
end
|
18
19
|
|
@@ -26,6 +27,7 @@ module Slack
|
|
26
27
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/channels.create.json
|
27
28
|
def channels_create(options={})
|
28
29
|
throw ArgumentError.new("Required arguments :name missing") if options[:name].nil?
|
30
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
29
31
|
post("channels.create", options)
|
30
32
|
end
|
31
33
|
|
@@ -44,11 +46,14 @@ module Slack
|
|
44
46
|
# Include messages with latest or oldest timestamp in results.
|
45
47
|
# @option options [Object] :count
|
46
48
|
# Number of messages to return, between 1 and 1000.
|
49
|
+
# @option options [Object] :unreads
|
50
|
+
# Include unread_count_display in the output?
|
47
51
|
# @see https://api.slack.com/methods/channels.history
|
48
52
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/channels.history.md
|
49
53
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/channels.history.json
|
50
54
|
def channels_history(options={})
|
51
55
|
throw ArgumentError.new("Required arguments :channel missing") if options[:channel].nil?
|
56
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
52
57
|
post("channels.history", options)
|
53
58
|
end
|
54
59
|
|
@@ -62,6 +67,7 @@ module Slack
|
|
62
67
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/channels.info.json
|
63
68
|
def channels_info(options={})
|
64
69
|
throw ArgumentError.new("Required arguments :channel missing") if options[:channel].nil?
|
70
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
65
71
|
post("channels.info", options)
|
66
72
|
end
|
67
73
|
|
@@ -78,6 +84,7 @@ module Slack
|
|
78
84
|
def channels_invite(options={})
|
79
85
|
throw ArgumentError.new("Required arguments :channel missing") if options[:channel].nil?
|
80
86
|
throw ArgumentError.new("Required arguments :user missing") if options[:user].nil?
|
87
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
81
88
|
post("channels.invite", options)
|
82
89
|
end
|
83
90
|
|
@@ -92,6 +99,7 @@ module Slack
|
|
92
99
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/channels.join.json
|
93
100
|
def channels_join(options={})
|
94
101
|
throw ArgumentError.new("Required arguments :name missing") if options[:name].nil?
|
102
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
95
103
|
post("channels.join", options)
|
96
104
|
end
|
97
105
|
|
@@ -108,6 +116,7 @@ module Slack
|
|
108
116
|
def channels_kick(options={})
|
109
117
|
throw ArgumentError.new("Required arguments :channel missing") if options[:channel].nil?
|
110
118
|
throw ArgumentError.new("Required arguments :user missing") if options[:user].nil?
|
119
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
111
120
|
post("channels.kick", options)
|
112
121
|
end
|
113
122
|
|
@@ -121,6 +130,7 @@ module Slack
|
|
121
130
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/channels.leave.json
|
122
131
|
def channels_leave(options={})
|
123
132
|
throw ArgumentError.new("Required arguments :channel missing") if options[:channel].nil?
|
133
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
124
134
|
post("channels.leave", options)
|
125
135
|
end
|
126
136
|
|
@@ -135,6 +145,7 @@ module Slack
|
|
135
145
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/channels.list.md
|
136
146
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/channels.list.json
|
137
147
|
def channels_list(options={})
|
148
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
138
149
|
post("channels.list", options)
|
139
150
|
end
|
140
151
|
|
@@ -151,6 +162,7 @@ module Slack
|
|
151
162
|
def channels_mark(options={})
|
152
163
|
throw ArgumentError.new("Required arguments :channel missing") if options[:channel].nil?
|
153
164
|
throw ArgumentError.new("Required arguments :ts missing") if options[:ts].nil?
|
165
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
154
166
|
post("channels.mark", options)
|
155
167
|
end
|
156
168
|
|
@@ -167,6 +179,7 @@ module Slack
|
|
167
179
|
def channels_rename(options={})
|
168
180
|
throw ArgumentError.new("Required arguments :channel missing") if options[:channel].nil?
|
169
181
|
throw ArgumentError.new("Required arguments :name missing") if options[:name].nil?
|
182
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
170
183
|
post("channels.rename", options)
|
171
184
|
end
|
172
185
|
|
@@ -183,6 +196,7 @@ module Slack
|
|
183
196
|
def channels_setPurpose(options={})
|
184
197
|
throw ArgumentError.new("Required arguments :channel missing") if options[:channel].nil?
|
185
198
|
throw ArgumentError.new("Required arguments :purpose missing") if options[:purpose].nil?
|
199
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
186
200
|
post("channels.setPurpose", options)
|
187
201
|
end
|
188
202
|
|
@@ -199,6 +213,7 @@ module Slack
|
|
199
213
|
def channels_setTopic(options={})
|
200
214
|
throw ArgumentError.new("Required arguments :channel missing") if options[:channel].nil?
|
201
215
|
throw ArgumentError.new("Required arguments :topic missing") if options[:topic].nil?
|
216
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
202
217
|
post("channels.setTopic", options)
|
203
218
|
end
|
204
219
|
|
@@ -212,6 +227,7 @@ module Slack
|
|
212
227
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/channels.unarchive.json
|
213
228
|
def channels_unarchive(options={})
|
214
229
|
throw ArgumentError.new("Required arguments :channel missing") if options[:channel].nil?
|
230
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
215
231
|
post("channels.unarchive", options)
|
216
232
|
end
|
217
233
|
|
data/lib/slack/endpoint/chat.rb
CHANGED
@@ -16,14 +16,15 @@ module Slack
|
|
16
16
|
def chat_delete(options={})
|
17
17
|
throw ArgumentError.new("Required arguments :ts missing") if options[:ts].nil?
|
18
18
|
throw ArgumentError.new("Required arguments :channel missing") if options[:channel].nil?
|
19
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
19
20
|
post("chat.delete", options)
|
20
21
|
end
|
21
22
|
|
22
23
|
#
|
23
|
-
# This method posts a message to a channel.
|
24
|
+
# This method posts a message to a public channel, private group, or IM channel.
|
24
25
|
#
|
25
26
|
# @option options [Object] :channel
|
26
|
-
# Channel
|
27
|
+
# Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name. See below for more details.
|
27
28
|
# @option options [Object] :text
|
28
29
|
# Text of the message to send. See below for an explanation of formatting.
|
29
30
|
# @option options [Object] :username
|
@@ -50,6 +51,7 @@ module Slack
|
|
50
51
|
def chat_postMessage(options={})
|
51
52
|
throw ArgumentError.new("Required arguments :channel missing") if options[:channel].nil?
|
52
53
|
throw ArgumentError.new("Required arguments :text missing") if options[:text].nil?
|
54
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
53
55
|
post("chat.postMessage", options)
|
54
56
|
end
|
55
57
|
|
@@ -62,6 +64,12 @@ module Slack
|
|
62
64
|
# Channel containing the message to be updated.
|
63
65
|
# @option options [Object] :text
|
64
66
|
# New text for the message, using the default formatting rules.
|
67
|
+
# @option options [Object] :attachments
|
68
|
+
# Structured message attachments.
|
69
|
+
# @option options [Object] :parse
|
70
|
+
# Change how messages are treated. See below.
|
71
|
+
# @option options [Object] :link_names
|
72
|
+
# Find and link channel names and usernames.
|
65
73
|
# @see https://api.slack.com/methods/chat.update
|
66
74
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/chat.update.md
|
67
75
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/chat.update.json
|
@@ -69,6 +77,7 @@ module Slack
|
|
69
77
|
throw ArgumentError.new("Required arguments :ts missing") if options[:ts].nil?
|
70
78
|
throw ArgumentError.new("Required arguments :channel missing") if options[:channel].nil?
|
71
79
|
throw ArgumentError.new("Required arguments :text missing") if options[:text].nil?
|
80
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
72
81
|
post("chat.update", options)
|
73
82
|
end
|
74
83
|
|
data/lib/slack/endpoint/emoji.rb
CHANGED
@@ -10,6 +10,7 @@ module Slack
|
|
10
10
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/emoji.list.md
|
11
11
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/emoji.list.json
|
12
12
|
def emoji_list(options={})
|
13
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
13
14
|
post("emoji.list", options)
|
14
15
|
end
|
15
16
|
|
data/lib/slack/endpoint/files.rb
CHANGED
@@ -13,6 +13,7 @@ module Slack
|
|
13
13
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/files.delete.json
|
14
14
|
def files_delete(options={})
|
15
15
|
throw ArgumentError.new("Required arguments :file missing") if options[:file].nil?
|
16
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
16
17
|
post("files.delete", options)
|
17
18
|
end
|
18
19
|
|
@@ -30,6 +31,7 @@ module Slack
|
|
30
31
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/files.info.json
|
31
32
|
def files_info(options={})
|
32
33
|
throw ArgumentError.new("Required arguments :file missing") if options[:file].nil?
|
34
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
33
35
|
post("files.info", options)
|
34
36
|
end
|
35
37
|
|
@@ -64,6 +66,7 @@ module Slack
|
|
64
66
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/files.list.md
|
65
67
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/files.list.json
|
66
68
|
def files_list(options={})
|
69
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
67
70
|
post("files.list", options)
|
68
71
|
end
|
69
72
|
|
@@ -88,6 +91,7 @@ module Slack
|
|
88
91
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/files.upload.md
|
89
92
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/files.upload.json
|
90
93
|
def files_upload(options={})
|
94
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
91
95
|
post("files.upload", options)
|
92
96
|
end
|
93
97
|
|
@@ -13,6 +13,7 @@ module Slack
|
|
13
13
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/groups.archive.json
|
14
14
|
def groups_archive(options={})
|
15
15
|
throw ArgumentError.new("Required arguments :channel missing") if options[:channel].nil?
|
16
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
16
17
|
post("groups.archive", options)
|
17
18
|
end
|
18
19
|
|
@@ -26,6 +27,7 @@ module Slack
|
|
26
27
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/groups.close.json
|
27
28
|
def groups_close(options={})
|
28
29
|
throw ArgumentError.new("Required arguments :channel missing") if options[:channel].nil?
|
30
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
29
31
|
post("groups.close", options)
|
30
32
|
end
|
31
33
|
|
@@ -39,6 +41,7 @@ module Slack
|
|
39
41
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/groups.create.json
|
40
42
|
def groups_create(options={})
|
41
43
|
throw ArgumentError.new("Required arguments :name missing") if options[:name].nil?
|
44
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
42
45
|
post("groups.create", options)
|
43
46
|
end
|
44
47
|
|
@@ -52,6 +55,7 @@ module Slack
|
|
52
55
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/groups.createChild.json
|
53
56
|
def groups_createChild(options={})
|
54
57
|
throw ArgumentError.new("Required arguments :channel missing") if options[:channel].nil?
|
58
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
55
59
|
post("groups.createChild", options)
|
56
60
|
end
|
57
61
|
|
@@ -70,11 +74,14 @@ module Slack
|
|
70
74
|
# Include messages with latest or oldest timestamp in results.
|
71
75
|
# @option options [Object] :count
|
72
76
|
# Number of messages to return, between 1 and 1000.
|
77
|
+
# @option options [Object] :unreads
|
78
|
+
# Include unread_count_display in the output?
|
73
79
|
# @see https://api.slack.com/methods/groups.history
|
74
80
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/groups.history.md
|
75
81
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/groups.history.json
|
76
82
|
def groups_history(options={})
|
77
83
|
throw ArgumentError.new("Required arguments :channel missing") if options[:channel].nil?
|
84
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
78
85
|
post("groups.history", options)
|
79
86
|
end
|
80
87
|
|
@@ -88,6 +95,7 @@ module Slack
|
|
88
95
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/groups.info.json
|
89
96
|
def groups_info(options={})
|
90
97
|
throw ArgumentError.new("Required arguments :channel missing") if options[:channel].nil?
|
98
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
91
99
|
post("groups.info", options)
|
92
100
|
end
|
93
101
|
|
@@ -104,6 +112,7 @@ module Slack
|
|
104
112
|
def groups_invite(options={})
|
105
113
|
throw ArgumentError.new("Required arguments :channel missing") if options[:channel].nil?
|
106
114
|
throw ArgumentError.new("Required arguments :user missing") if options[:user].nil?
|
115
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
107
116
|
post("groups.invite", options)
|
108
117
|
end
|
109
118
|
|
@@ -120,6 +129,7 @@ module Slack
|
|
120
129
|
def groups_kick(options={})
|
121
130
|
throw ArgumentError.new("Required arguments :channel missing") if options[:channel].nil?
|
122
131
|
throw ArgumentError.new("Required arguments :user missing") if options[:user].nil?
|
132
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
123
133
|
post("groups.kick", options)
|
124
134
|
end
|
125
135
|
|
@@ -133,6 +143,7 @@ module Slack
|
|
133
143
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/groups.leave.json
|
134
144
|
def groups_leave(options={})
|
135
145
|
throw ArgumentError.new("Required arguments :channel missing") if options[:channel].nil?
|
146
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
136
147
|
post("groups.leave", options)
|
137
148
|
end
|
138
149
|
|
@@ -146,6 +157,7 @@ module Slack
|
|
146
157
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/groups.list.md
|
147
158
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/groups.list.json
|
148
159
|
def groups_list(options={})
|
160
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
149
161
|
post("groups.list", options)
|
150
162
|
end
|
151
163
|
|
@@ -162,6 +174,7 @@ module Slack
|
|
162
174
|
def groups_mark(options={})
|
163
175
|
throw ArgumentError.new("Required arguments :channel missing") if options[:channel].nil?
|
164
176
|
throw ArgumentError.new("Required arguments :ts missing") if options[:ts].nil?
|
177
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
165
178
|
post("groups.mark", options)
|
166
179
|
end
|
167
180
|
|
@@ -175,6 +188,7 @@ module Slack
|
|
175
188
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/groups.open.json
|
176
189
|
def groups_open(options={})
|
177
190
|
throw ArgumentError.new("Required arguments :channel missing") if options[:channel].nil?
|
191
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
178
192
|
post("groups.open", options)
|
179
193
|
end
|
180
194
|
|
@@ -191,6 +205,7 @@ module Slack
|
|
191
205
|
def groups_rename(options={})
|
192
206
|
throw ArgumentError.new("Required arguments :channel missing") if options[:channel].nil?
|
193
207
|
throw ArgumentError.new("Required arguments :name missing") if options[:name].nil?
|
208
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
194
209
|
post("groups.rename", options)
|
195
210
|
end
|
196
211
|
|
@@ -207,6 +222,7 @@ module Slack
|
|
207
222
|
def groups_setPurpose(options={})
|
208
223
|
throw ArgumentError.new("Required arguments :channel missing") if options[:channel].nil?
|
209
224
|
throw ArgumentError.new("Required arguments :purpose missing") if options[:purpose].nil?
|
225
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
210
226
|
post("groups.setPurpose", options)
|
211
227
|
end
|
212
228
|
|
@@ -223,6 +239,7 @@ module Slack
|
|
223
239
|
def groups_setTopic(options={})
|
224
240
|
throw ArgumentError.new("Required arguments :channel missing") if options[:channel].nil?
|
225
241
|
throw ArgumentError.new("Required arguments :topic missing") if options[:topic].nil?
|
242
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
226
243
|
post("groups.setTopic", options)
|
227
244
|
end
|
228
245
|
|
@@ -236,6 +253,7 @@ module Slack
|
|
236
253
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/groups.unarchive.json
|
237
254
|
def groups_unarchive(options={})
|
238
255
|
throw ArgumentError.new("Required arguments :channel missing") if options[:channel].nil?
|
256
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
239
257
|
post("groups.unarchive", options)
|
240
258
|
end
|
241
259
|
|
data/lib/slack/endpoint/im.rb
CHANGED
@@ -13,6 +13,7 @@ module Slack
|
|
13
13
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/im.close.json
|
14
14
|
def im_close(options={})
|
15
15
|
throw ArgumentError.new("Required arguments :channel missing") if options[:channel].nil?
|
16
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
16
17
|
post("im.close", options)
|
17
18
|
end
|
18
19
|
|
@@ -31,11 +32,14 @@ module Slack
|
|
31
32
|
# Include messages with latest or oldest timestamp in results.
|
32
33
|
# @option options [Object] :count
|
33
34
|
# Number of messages to return, between 1 and 1000.
|
35
|
+
# @option options [Object] :unreads
|
36
|
+
# Include unread_count_display in the output?
|
34
37
|
# @see https://api.slack.com/methods/im.history
|
35
38
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/im.history.md
|
36
39
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/im.history.json
|
37
40
|
def im_history(options={})
|
38
41
|
throw ArgumentError.new("Required arguments :channel missing") if options[:channel].nil?
|
42
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
39
43
|
post("im.history", options)
|
40
44
|
end
|
41
45
|
|
@@ -46,6 +50,7 @@ module Slack
|
|
46
50
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/im.list.md
|
47
51
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/im.list.json
|
48
52
|
def im_list(options={})
|
53
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
49
54
|
post("im.list", options)
|
50
55
|
end
|
51
56
|
|
@@ -62,6 +67,7 @@ module Slack
|
|
62
67
|
def im_mark(options={})
|
63
68
|
throw ArgumentError.new("Required arguments :channel missing") if options[:channel].nil?
|
64
69
|
throw ArgumentError.new("Required arguments :ts missing") if options[:ts].nil?
|
70
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
65
71
|
post("im.mark", options)
|
66
72
|
end
|
67
73
|
|
@@ -75,6 +81,7 @@ module Slack
|
|
75
81
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/im.open.json
|
76
82
|
def im_open(options={})
|
77
83
|
throw ArgumentError.new("Required arguments :user missing") if options[:user].nil?
|
84
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
78
85
|
post("im.open", options)
|
79
86
|
end
|
80
87
|
|
@@ -0,0 +1,90 @@
|
|
1
|
+
# This file was auto-generated by lib/generators/tasks/generate.rb
|
2
|
+
|
3
|
+
module Slack
|
4
|
+
module Endpoint
|
5
|
+
module Mpim
|
6
|
+
#
|
7
|
+
# This method closes a multiparty direct message channel.
|
8
|
+
#
|
9
|
+
# @option options [Object] :channel
|
10
|
+
# MPIM to close.
|
11
|
+
# @see https://api.slack.com/methods/mpim.close
|
12
|
+
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/mpim.close.md
|
13
|
+
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/mpim.close.json
|
14
|
+
def mpim_close(options={})
|
15
|
+
throw ArgumentError.new("Required arguments :channel missing") if options[:channel].nil?
|
16
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
17
|
+
post("mpim.close", options)
|
18
|
+
end
|
19
|
+
|
20
|
+
#
|
21
|
+
# This method returns a portion of messages/events from the specified multiparty direct message channel.
|
22
|
+
# To read the entire history for a multiparty direct message, call the method with no latest or
|
23
|
+
# oldest arguments, and then continue paging using the instructions below.
|
24
|
+
#
|
25
|
+
# @option options [Object] :channel
|
26
|
+
# Multiparty direct message to fetch history for.
|
27
|
+
# @option options [Object] :latest
|
28
|
+
# End of time range of messages to include in results.
|
29
|
+
# @option options [Object] :oldest
|
30
|
+
# Start of time range of messages to include in results.
|
31
|
+
# @option options [Object] :inclusive
|
32
|
+
# Include messages with latest or oldest timestamp in results.
|
33
|
+
# @option options [Object] :count
|
34
|
+
# Number of messages to return, between 1 and 1000.
|
35
|
+
# @option options [Object] :unreads
|
36
|
+
# Include unread_count_display in the output?
|
37
|
+
# @see https://api.slack.com/methods/mpim.history
|
38
|
+
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/mpim.history.md
|
39
|
+
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/mpim.history.json
|
40
|
+
def mpim_history(options={})
|
41
|
+
throw ArgumentError.new("Required arguments :channel missing") if options[:channel].nil?
|
42
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
43
|
+
post("mpim.history", options)
|
44
|
+
end
|
45
|
+
|
46
|
+
#
|
47
|
+
# This method returns a list of all multiparty direct message channels that the user has.
|
48
|
+
#
|
49
|
+
# @see https://api.slack.com/methods/mpim.list
|
50
|
+
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/mpim.list.md
|
51
|
+
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/mpim.list.json
|
52
|
+
def mpim_list(options={})
|
53
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
54
|
+
post("mpim.list", options)
|
55
|
+
end
|
56
|
+
|
57
|
+
#
|
58
|
+
# This method moves the read cursor in a multiparty direct message channel.
|
59
|
+
#
|
60
|
+
# @option options [Object] :channel
|
61
|
+
# multiparty direct message channel to set reading cursor in.
|
62
|
+
# @option options [Object] :ts
|
63
|
+
# Timestamp of the most recently seen message.
|
64
|
+
# @see https://api.slack.com/methods/mpim.mark
|
65
|
+
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/mpim.mark.md
|
66
|
+
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/mpim.mark.json
|
67
|
+
def mpim_mark(options={})
|
68
|
+
throw ArgumentError.new("Required arguments :channel missing") if options[:channel].nil?
|
69
|
+
throw ArgumentError.new("Required arguments :ts missing") if options[:ts].nil?
|
70
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
71
|
+
post("mpim.mark", options)
|
72
|
+
end
|
73
|
+
|
74
|
+
#
|
75
|
+
# This method opens a multiparty direct message.
|
76
|
+
#
|
77
|
+
# @option options [Object] :users
|
78
|
+
# Comma separated lists of users. The ordering of the users is preserved whenever a MPIM group is returned.
|
79
|
+
# @see https://api.slack.com/methods/mpim.open
|
80
|
+
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/mpim.open.md
|
81
|
+
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/mpim.open.json
|
82
|
+
def mpim_open(options={})
|
83
|
+
throw ArgumentError.new("Required arguments :users missing") if options[:users].nil?
|
84
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
85
|
+
post("mpim.open", options)
|
86
|
+
end
|
87
|
+
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|
data/lib/slack/endpoint/oauth.rb
CHANGED
@@ -22,6 +22,7 @@ module Slack
|
|
22
22
|
throw ArgumentError.new("Required arguments :client_id missing") if options[:client_id].nil?
|
23
23
|
throw ArgumentError.new("Required arguments :client_secret missing") if options[:client_secret].nil?
|
24
24
|
throw ArgumentError.new("Required arguments :code missing") if options[:code].nil?
|
25
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
25
26
|
post("oauth.access", options)
|
26
27
|
end
|
27
28
|
|
@@ -0,0 +1,64 @@
|
|
1
|
+
# This file was auto-generated by lib/generators/tasks/generate.rb
|
2
|
+
|
3
|
+
module Slack
|
4
|
+
module Endpoint
|
5
|
+
module Pins
|
6
|
+
#
|
7
|
+
# This method pins an item (file, file comment, channel message, or group message) to a particular channel.
|
8
|
+
# The channel argument is required and one of file, file_comment, or timestamp must also be specified.
|
9
|
+
#
|
10
|
+
# @option options [Object] :channel
|
11
|
+
# Channel to pin the item in.
|
12
|
+
# @option options [Object] :file
|
13
|
+
# File to pin.
|
14
|
+
# @option options [Object] :file_comment
|
15
|
+
# File comment to pin.
|
16
|
+
# @option options [Object] :timestamp
|
17
|
+
# Timestamp of the message to pin.
|
18
|
+
# @see https://api.slack.com/methods/pins.add
|
19
|
+
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/pins.add.md
|
20
|
+
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/pins.add.json
|
21
|
+
def pins_add(options={})
|
22
|
+
throw ArgumentError.new("Required arguments :channel missing") if options[:channel].nil?
|
23
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
24
|
+
post("pins.add", options)
|
25
|
+
end
|
26
|
+
|
27
|
+
#
|
28
|
+
# This method lists the items pinned to a channel.
|
29
|
+
#
|
30
|
+
# @option options [Object] :channel
|
31
|
+
# Channel to get pinned items for.
|
32
|
+
# @see https://api.slack.com/methods/pins.list
|
33
|
+
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/pins.list.md
|
34
|
+
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/pins.list.json
|
35
|
+
def pins_list(options={})
|
36
|
+
throw ArgumentError.new("Required arguments :channel missing") if options[:channel].nil?
|
37
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
38
|
+
post("pins.list", options)
|
39
|
+
end
|
40
|
+
|
41
|
+
#
|
42
|
+
# This method un-pins an item (file, file comment, channel message, or group message) from a channel.
|
43
|
+
# The channel argument is required and one of file, file_comment, or timestamp must also be specified.
|
44
|
+
#
|
45
|
+
# @option options [Object] :channel
|
46
|
+
# Channel where the item is pinned to.
|
47
|
+
# @option options [Object] :file
|
48
|
+
# File to un-pin.
|
49
|
+
# @option options [Object] :file_comment
|
50
|
+
# File comment to un-pin.
|
51
|
+
# @option options [Object] :timestamp
|
52
|
+
# Timestamp of the message to un-pin.
|
53
|
+
# @see https://api.slack.com/methods/pins.remove
|
54
|
+
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/pins.remove.md
|
55
|
+
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/pins.remove.json
|
56
|
+
def pins_remove(options={})
|
57
|
+
throw ArgumentError.new("Required arguments :channel missing") if options[:channel].nil?
|
58
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
59
|
+
post("pins.remove", options)
|
60
|
+
end
|
61
|
+
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
@@ -13,6 +13,7 @@ module Slack
|
|
13
13
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/presence.set.json
|
14
14
|
def presence_set(options={})
|
15
15
|
throw ArgumentError.new("Required arguments :presence missing") if options[:presence].nil?
|
16
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
16
17
|
post("presence.set", options)
|
17
18
|
end
|
18
19
|
|
@@ -0,0 +1,94 @@
|
|
1
|
+
# This file was auto-generated by lib/generators/tasks/generate.rb
|
2
|
+
|
3
|
+
module Slack
|
4
|
+
module Endpoint
|
5
|
+
module Reactions
|
6
|
+
#
|
7
|
+
# This method adds a reaction (emoji) to an item (file, file comment, channel message, group message, or direct message).
|
8
|
+
# One of file, file_comment, or the combination of channel and timestamp must be specified.
|
9
|
+
#
|
10
|
+
# @option options [Object] :name
|
11
|
+
# Reaction (emoji) name.
|
12
|
+
# @option options [Object] :file
|
13
|
+
# File to add reaction to.
|
14
|
+
# @option options [Object] :file_comment
|
15
|
+
# File comment to add reaction to.
|
16
|
+
# @option options [Object] :channel
|
17
|
+
# Channel where the message to add reaction to was posted.
|
18
|
+
# @option options [Object] :timestamp
|
19
|
+
# Timestamp of the message to add reaction to.
|
20
|
+
# @see https://api.slack.com/methods/reactions.add
|
21
|
+
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/reactions.add.md
|
22
|
+
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/reactions.add.json
|
23
|
+
def reactions_add(options={})
|
24
|
+
throw ArgumentError.new("Required arguments :name missing") if options[:name].nil?
|
25
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
26
|
+
post("reactions.add", options)
|
27
|
+
end
|
28
|
+
|
29
|
+
#
|
30
|
+
# This method returns a list of all reactions for a single item (file, file comment, channel message, group message, or direct message).
|
31
|
+
#
|
32
|
+
# @option options [Object] :file
|
33
|
+
# File to get reactions for.
|
34
|
+
# @option options [Object] :file_comment
|
35
|
+
# File comment to get reactions for.
|
36
|
+
# @option options [Object] :channel
|
37
|
+
# Channel where the message to get reactions for was posted.
|
38
|
+
# @option options [Object] :timestamp
|
39
|
+
# Timestamp of the message to get reactions for.
|
40
|
+
# @option options [Object] :full
|
41
|
+
# If true always return the complete reaction list.
|
42
|
+
# @see https://api.slack.com/methods/reactions.get
|
43
|
+
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/reactions.get.md
|
44
|
+
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/reactions.get.json
|
45
|
+
def reactions_get(options={})
|
46
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
47
|
+
post("reactions.get", options)
|
48
|
+
end
|
49
|
+
|
50
|
+
#
|
51
|
+
# This method returns a list of all items (file, file comment, channel message, group message, or direct message) reacted to by a user.
|
52
|
+
#
|
53
|
+
# @option options [Object] :user
|
54
|
+
# Show reactions made by this user. Defaults to the authed user.
|
55
|
+
# @option options [Object] :full
|
56
|
+
# If true always return the complete reaction list.
|
57
|
+
# @option options [Object] :count
|
58
|
+
# Number of items to return per page.
|
59
|
+
# @option options [Object] :page
|
60
|
+
# Page number of results to return.
|
61
|
+
# @see https://api.slack.com/methods/reactions.list
|
62
|
+
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/reactions.list.md
|
63
|
+
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/reactions.list.json
|
64
|
+
def reactions_list(options={})
|
65
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
66
|
+
post("reactions.list", options)
|
67
|
+
end
|
68
|
+
|
69
|
+
#
|
70
|
+
# This method removes a reaction (emoji) from an item (file, file comment, channel message, group message, or direct message).
|
71
|
+
# One of file, file_comment, or the combination of channel and timestamp must be specified.
|
72
|
+
#
|
73
|
+
# @option options [Object] :name
|
74
|
+
# Reaction (emoji) name.
|
75
|
+
# @option options [Object] :file
|
76
|
+
# File to remove reaction from.
|
77
|
+
# @option options [Object] :file_comment
|
78
|
+
# File comment to remove reaction from.
|
79
|
+
# @option options [Object] :channel
|
80
|
+
# Channel where the message to remove reaction from was posted.
|
81
|
+
# @option options [Object] :timestamp
|
82
|
+
# Timestamp of the message to remove reaction from.
|
83
|
+
# @see https://api.slack.com/methods/reactions.remove
|
84
|
+
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/reactions.remove.md
|
85
|
+
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/reactions.remove.json
|
86
|
+
def reactions_remove(options={})
|
87
|
+
throw ArgumentError.new("Required arguments :name missing") if options[:name].nil?
|
88
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
89
|
+
post("reactions.remove", options)
|
90
|
+
end
|
91
|
+
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|
@@ -23,6 +23,7 @@ module Slack
|
|
23
23
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/search.all.json
|
24
24
|
def search_all(options={})
|
25
25
|
throw ArgumentError.new("Required arguments :query missing") if options[:query].nil?
|
26
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
26
27
|
post("search.all", options)
|
27
28
|
end
|
28
29
|
|
@@ -46,6 +47,7 @@ module Slack
|
|
46
47
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/search.files.json
|
47
48
|
def search_files(options={})
|
48
49
|
throw ArgumentError.new("Required arguments :query missing") if options[:query].nil?
|
50
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
49
51
|
post("search.files", options)
|
50
52
|
end
|
51
53
|
|
@@ -69,6 +71,7 @@ module Slack
|
|
69
71
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/search.messages.json
|
70
72
|
def search_messages(options={})
|
71
73
|
throw ArgumentError.new("Required arguments :query missing") if options[:query].nil?
|
74
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
72
75
|
post("search.messages", options)
|
73
76
|
end
|
74
77
|
|
data/lib/slack/endpoint/stars.rb
CHANGED
@@ -3,6 +3,26 @@
|
|
3
3
|
module Slack
|
4
4
|
module Endpoint
|
5
5
|
module Stars
|
6
|
+
#
|
7
|
+
# This method adds a star to an item (message, file, file comment, channel, private group, or DM) on behalf of the authenticated user.
|
8
|
+
# One of file, file_comment, channel, or the combination of channel and timestamp must be specified.
|
9
|
+
#
|
10
|
+
# @option options [Object] :file
|
11
|
+
# File to add star to.
|
12
|
+
# @option options [Object] :file_comment
|
13
|
+
# File comment to add star to.
|
14
|
+
# @option options [Object] :channel
|
15
|
+
# Channel to add star to, or channel where the message to add star to was posted (used with timestamp).
|
16
|
+
# @option options [Object] :timestamp
|
17
|
+
# Timestamp of the message to add star to.
|
18
|
+
# @see https://api.slack.com/methods/stars.add
|
19
|
+
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/stars.add.md
|
20
|
+
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/stars.add.json
|
21
|
+
def stars_add(options={})
|
22
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
23
|
+
post("stars.add", options)
|
24
|
+
end
|
25
|
+
|
6
26
|
#
|
7
27
|
# This method lists the items starred by a user.
|
8
28
|
#
|
@@ -16,9 +36,30 @@ module Slack
|
|
16
36
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/stars.list.md
|
17
37
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/stars.list.json
|
18
38
|
def stars_list(options={})
|
39
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
19
40
|
post("stars.list", options)
|
20
41
|
end
|
21
42
|
|
43
|
+
#
|
44
|
+
# This method removes a star from an item (message, file, file comment, channel, private group, or DM) on behalf of the authenticated user.
|
45
|
+
# One of file, file_comment, channel, or the combination of channel and timestamp must be specified.
|
46
|
+
#
|
47
|
+
# @option options [Object] :file
|
48
|
+
# File to remove star from.
|
49
|
+
# @option options [Object] :file_comment
|
50
|
+
# File comment to remove star from.
|
51
|
+
# @option options [Object] :channel
|
52
|
+
# Channel to remove star from, or channel where the message to remove star from was posted (used with timestamp).
|
53
|
+
# @option options [Object] :timestamp
|
54
|
+
# Timestamp of the message to remove star from.
|
55
|
+
# @see https://api.slack.com/methods/stars.remove
|
56
|
+
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/stars.remove.md
|
57
|
+
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/stars.remove.json
|
58
|
+
def stars_remove(options={})
|
59
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
60
|
+
post("stars.remove", options)
|
61
|
+
end
|
62
|
+
|
22
63
|
end
|
23
64
|
end
|
24
65
|
end
|
data/lib/slack/endpoint/team.rb
CHANGED
@@ -14,6 +14,7 @@ module Slack
|
|
14
14
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/team.accessLogs.md
|
15
15
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/team.accessLogs.json
|
16
16
|
def team_accessLogs(options={})
|
17
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
17
18
|
post("team.accessLogs", options)
|
18
19
|
end
|
19
20
|
|
@@ -24,9 +25,33 @@ module Slack
|
|
24
25
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/team.info.md
|
25
26
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/team.info.json
|
26
27
|
def team_info(options={})
|
28
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
27
29
|
post("team.info", options)
|
28
30
|
end
|
29
31
|
|
32
|
+
#
|
33
|
+
# This method lists the integration activity logs for a team, including when integrations are added, modified and removed. This method can only be called by Admins.
|
34
|
+
#
|
35
|
+
# @option options [Object] :service_id
|
36
|
+
# Filter logs to this service. Defaults to all logs.
|
37
|
+
# @option options [Object] :app_id
|
38
|
+
# Filter logs to this API application. Defaults to all logs.
|
39
|
+
# @option options [Object] :user
|
40
|
+
# Filter logs generated by this user’s actions. Defaults to all logs.
|
41
|
+
# @option options [Object] :change_type
|
42
|
+
# Filter logs with this change type. Defaults to all logs.
|
43
|
+
# @option options [Object] :count
|
44
|
+
# Number of items to return per page.
|
45
|
+
# @option options [Object] :page
|
46
|
+
# Page number of results to return.
|
47
|
+
# @see https://api.slack.com/methods/team.integrationLogs
|
48
|
+
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/team.integrationLogs.md
|
49
|
+
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/team.integrationLogs.json
|
50
|
+
def team_integrationLogs(options={})
|
51
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
52
|
+
post("team.integrationLogs", options)
|
53
|
+
end
|
54
|
+
|
30
55
|
end
|
31
56
|
end
|
32
57
|
end
|
data/lib/slack/endpoint/users.rb
CHANGED
@@ -14,6 +14,7 @@ module Slack
|
|
14
14
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/users.getPresence.json
|
15
15
|
def users_getPresence(options={})
|
16
16
|
throw ArgumentError.new("Required arguments :user missing") if options[:user].nil?
|
17
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
17
18
|
post("users.getPresence", options)
|
18
19
|
end
|
19
20
|
|
@@ -27,16 +28,20 @@ module Slack
|
|
27
28
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/users.info.json
|
28
29
|
def users_info(options={})
|
29
30
|
throw ArgumentError.new("Required arguments :user missing") if options[:user].nil?
|
31
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
30
32
|
post("users.info", options)
|
31
33
|
end
|
32
34
|
|
33
35
|
#
|
34
36
|
# This method returns a list of all users in the team. This includes deleted/deactivated users.
|
35
37
|
#
|
38
|
+
# @option options [Object] :presence
|
39
|
+
# Whether to include presence data in the output
|
36
40
|
# @see https://api.slack.com/methods/users.list
|
37
41
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/users.list.md
|
38
42
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/users.list.json
|
39
43
|
def users_list(options={})
|
44
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
40
45
|
post("users.list", options)
|
41
46
|
end
|
42
47
|
|
@@ -49,6 +54,7 @@ module Slack
|
|
49
54
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/users.setActive.md
|
50
55
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/users.setActive.json
|
51
56
|
def users_setActive(options={})
|
57
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
52
58
|
post("users.setActive", options)
|
53
59
|
end
|
54
60
|
|
@@ -63,6 +69,7 @@ module Slack
|
|
63
69
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/users.setPresence.json
|
64
70
|
def users_setPresence(options={})
|
65
71
|
throw ArgumentError.new("Required arguments :presence missing") if options[:presence].nil?
|
72
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
66
73
|
post("users.setPresence", options)
|
67
74
|
end
|
68
75
|
|
data/lib/slack/endpoint.rb
CHANGED
@@ -8,8 +8,11 @@ require_relative 'endpoint/emoji'
|
|
8
8
|
require_relative 'endpoint/files'
|
9
9
|
require_relative 'endpoint/groups'
|
10
10
|
require_relative 'endpoint/im'
|
11
|
+
require_relative 'endpoint/mpim'
|
11
12
|
require_relative 'endpoint/oauth'
|
13
|
+
require_relative 'endpoint/pins'
|
12
14
|
require_relative 'endpoint/presence'
|
15
|
+
require_relative 'endpoint/reactions'
|
13
16
|
require_relative 'endpoint/search'
|
14
17
|
require_relative 'endpoint/stars'
|
15
18
|
require_relative 'endpoint/team'
|
@@ -25,8 +28,11 @@ module Slack
|
|
25
28
|
include Files
|
26
29
|
include Groups
|
27
30
|
include Im
|
31
|
+
include Mpim
|
28
32
|
include Oauth
|
33
|
+
include Pins
|
29
34
|
include Presence
|
35
|
+
include Reactions
|
30
36
|
include Search
|
31
37
|
include Stars
|
32
38
|
include Team
|
data/lib/slack/version.rb
CHANGED
data/lib/slack.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: slack-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- aki017
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-11-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -282,8 +282,11 @@ files:
|
|
282
282
|
- lib/slack/endpoint/files.rb
|
283
283
|
- lib/slack/endpoint/groups.rb
|
284
284
|
- lib/slack/endpoint/im.rb
|
285
|
+
- lib/slack/endpoint/mpim.rb
|
285
286
|
- lib/slack/endpoint/oauth.rb
|
287
|
+
- lib/slack/endpoint/pins.rb
|
286
288
|
- lib/slack/endpoint/presence.rb
|
289
|
+
- lib/slack/endpoint/reactions.rb
|
287
290
|
- lib/slack/endpoint/search.rb
|
288
291
|
- lib/slack/endpoint/stars.rb
|
289
292
|
- lib/slack/endpoint/team.rb
|
@@ -337,7 +340,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
337
340
|
version: '0'
|
338
341
|
requirements: []
|
339
342
|
rubyforge_project:
|
340
|
-
rubygems_version: 2.2.
|
343
|
+
rubygems_version: 2.2.5
|
341
344
|
signing_key:
|
342
345
|
specification_version: 4
|
343
346
|
summary: A Ruby wrapper for the Slack API
|