slack-api 1.1.4 → 1.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitmodules +1 -1
- data/lib/generators/templates/method.rb.erb +5 -3
- data/lib/slack/endpoint.rb +2 -0
- data/lib/slack/endpoint/api.rb +1 -1
- data/lib/slack/endpoint/auth.rb +1 -1
- data/lib/slack/endpoint/channels.rb +39 -32
- data/lib/slack/endpoint/chat.rb +10 -8
- data/lib/slack/endpoint/emoji.rb +1 -1
- data/lib/slack/endpoint/files.rb +38 -15
- data/lib/slack/endpoint/groups.rb +53 -35
- data/lib/slack/endpoint/im.rb +18 -14
- data/lib/slack/endpoint/oauth.rb +3 -2
- data/lib/slack/endpoint/search.rb +25 -13
- data/lib/slack/endpoint/stars.rb +6 -2
- data/lib/slack/endpoint/team.rb +32 -0
- data/lib/slack/endpoint/users.rb +12 -8
- data/lib/slack/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0b03c774ecc1d24801cf2b344799e9d8f7fdc5b0
|
4
|
+
data.tar.gz: 737388b7feb3824d9ab80227e62af24c85eddc6f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 98bb910766b186dca7b9c64dc83e3be66a05914ebbf1ef9fbbebf22b4448ab36d73f92362b3f522b45386c540a7ab5135a341b8b25c62f169b44403e3e42b031
|
7
|
+
data.tar.gz: 99ced9581ef70d927ebc61dbbfe038ed06657ab729b3b41b72fdb2c5f18027e28f0076dd59354f43ed00ab5c9a8b9efce57243b798cd612d227d36701e59e4c7
|
data/.gitmodules
CHANGED
@@ -5,9 +5,11 @@ module Slack
|
|
5
5
|
module <%= group.capitalize %>
|
6
6
|
<% names.each do |name, data| %>
|
7
7
|
#
|
8
|
-
|
8
|
+
<% data["desc"].lines.each do |l| %>
|
9
|
+
# <%= l.strip %>
|
10
|
+
<% end %>
|
9
11
|
#
|
10
|
-
<% data["args"].each do |arg_name, arg_v| %>
|
12
|
+
<% data["args"].reject{|k, v| k=="token"}.each do |arg_name, arg_v| %>
|
11
13
|
# @option options [<%= arg_v["type"] %>] :<%= arg_name %>
|
12
14
|
<% arg_v["desc"].lines.each do |l| %>
|
13
15
|
# <%= l.strip %>
|
@@ -17,7 +19,7 @@ module Slack
|
|
17
19
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/<%= group %>.<%= name %>.md
|
18
20
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/<%= group %>.<%= name %>.json
|
19
21
|
def <%= group %>_<%= name %>(options={})
|
20
|
-
<% data["args"].select{|k,v| v["required"]}.each do |arg_name, arg_v| %>
|
22
|
+
<% data["args"].reject{|k, v| k=="token"}.select{|k,v| v["required"]}.each do |arg_name, arg_v| %>
|
21
23
|
throw ArgumentError.new("Required arguments :<%= arg_name %> missing") if options[:<%= arg_name %>].nil?
|
22
24
|
<% end %>
|
23
25
|
post("<%= group %>.<%= name %>", options)
|
data/lib/slack/endpoint.rb
CHANGED
@@ -12,6 +12,7 @@ require_relative 'endpoint/oauth'
|
|
12
12
|
require_relative 'endpoint/presence'
|
13
13
|
require_relative 'endpoint/search'
|
14
14
|
require_relative 'endpoint/stars'
|
15
|
+
require_relative 'endpoint/team'
|
15
16
|
require_relative 'endpoint/users'
|
16
17
|
|
17
18
|
module Slack
|
@@ -28,6 +29,7 @@ module Slack
|
|
28
29
|
include Presence
|
29
30
|
include Search
|
30
31
|
include Stars
|
32
|
+
include Team
|
31
33
|
include Users
|
32
34
|
end
|
33
35
|
end
|
data/lib/slack/endpoint/api.rb
CHANGED
data/lib/slack/endpoint/auth.rb
CHANGED
@@ -4,7 +4,7 @@ module Slack
|
|
4
4
|
module Endpoint
|
5
5
|
module Auth
|
6
6
|
#
|
7
|
-
#
|
7
|
+
# This method checks authentication and tells you who you are.
|
8
8
|
#
|
9
9
|
# @see https://api.slack.com/methods/auth.test
|
10
10
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/auth.test.md
|
@@ -4,9 +4,9 @@ module Slack
|
|
4
4
|
module Endpoint
|
5
5
|
module Channels
|
6
6
|
#
|
7
|
-
#
|
7
|
+
# This method archives a channel.
|
8
8
|
#
|
9
|
-
# @option options [
|
9
|
+
# @option options [Object] :channel
|
10
10
|
# Channel to archive
|
11
11
|
# @see https://api.slack.com/methods/channels.archive
|
12
12
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/channels.archive.md
|
@@ -17,7 +17,7 @@ module Slack
|
|
17
17
|
end
|
18
18
|
|
19
19
|
#
|
20
|
-
#
|
20
|
+
# This method is used to create a channel.
|
21
21
|
#
|
22
22
|
# @option options [Object] :name
|
23
23
|
# Name of channel to create
|
@@ -30,14 +30,18 @@ module Slack
|
|
30
30
|
end
|
31
31
|
|
32
32
|
#
|
33
|
-
#
|
33
|
+
# This method returns a portion of messages/events from the specified channel.
|
34
|
+
# To read the entire history for a channel, call the method with no latest or
|
35
|
+
# oldest arguments, and then continue paging using the instructions below.
|
34
36
|
#
|
35
|
-
# @option options [
|
37
|
+
# @option options [Object] :channel
|
36
38
|
# Channel to fetch history for.
|
37
|
-
# @option options [
|
38
|
-
#
|
39
|
-
# @option options [
|
40
|
-
#
|
39
|
+
# @option options [Object] :latest
|
40
|
+
# End of time range of messages to include in results.
|
41
|
+
# @option options [Object] :oldest
|
42
|
+
# Start of time range of messages to include in results.
|
43
|
+
# @option options [Object] :inclusive
|
44
|
+
# Include messages with latest or oldest timestamp in results.
|
41
45
|
# @option options [Object] :count
|
42
46
|
# Number of messages to return, between 1 and 1000.
|
43
47
|
# @see https://api.slack.com/methods/channels.history
|
@@ -49,9 +53,9 @@ module Slack
|
|
49
53
|
end
|
50
54
|
|
51
55
|
#
|
52
|
-
#
|
56
|
+
# This method returns information about a team channel.
|
53
57
|
#
|
54
|
-
# @option options [
|
58
|
+
# @option options [Object] :channel
|
55
59
|
# Channel to get info on
|
56
60
|
# @see https://api.slack.com/methods/channels.info
|
57
61
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/channels.info.md
|
@@ -62,11 +66,11 @@ module Slack
|
|
62
66
|
end
|
63
67
|
|
64
68
|
#
|
65
|
-
#
|
69
|
+
# This method is used to invite a user to a channel. The calling user must be a member of the channel.
|
66
70
|
#
|
67
|
-
# @option options [
|
71
|
+
# @option options [Object] :channel
|
68
72
|
# Channel to invite user to.
|
69
|
-
# @option options [
|
73
|
+
# @option options [Object] :user
|
70
74
|
# User to invite to channel.
|
71
75
|
# @see https://api.slack.com/methods/channels.invite
|
72
76
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/channels.invite.md
|
@@ -78,7 +82,8 @@ module Slack
|
|
78
82
|
end
|
79
83
|
|
80
84
|
#
|
81
|
-
#
|
85
|
+
# This method is used to join a channel. If the channel does not exist, it is
|
86
|
+
# created.
|
82
87
|
#
|
83
88
|
# @option options [Object] :name
|
84
89
|
# Name of channel to join
|
@@ -91,11 +96,11 @@ module Slack
|
|
91
96
|
end
|
92
97
|
|
93
98
|
#
|
94
|
-
#
|
99
|
+
# This method allows a user to remove another member from a team channel.
|
95
100
|
#
|
96
|
-
# @option options [
|
101
|
+
# @option options [Object] :channel
|
97
102
|
# Channel to remove user from.
|
98
|
-
# @option options [
|
103
|
+
# @option options [Object] :user
|
99
104
|
# User to remove from channel.
|
100
105
|
# @see https://api.slack.com/methods/channels.kick
|
101
106
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/channels.kick.md
|
@@ -107,9 +112,9 @@ module Slack
|
|
107
112
|
end
|
108
113
|
|
109
114
|
#
|
110
|
-
#
|
115
|
+
# This method is used to leave a channel.
|
111
116
|
#
|
112
|
-
# @option options [
|
117
|
+
# @option options [Object] :channel
|
113
118
|
# Channel to leave
|
114
119
|
# @see https://api.slack.com/methods/channels.leave
|
115
120
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/channels.leave.md
|
@@ -120,7 +125,9 @@ module Slack
|
|
120
125
|
end
|
121
126
|
|
122
127
|
#
|
123
|
-
#
|
128
|
+
# This method returns a list of all channels in the team. This includes channels the caller is in, channels
|
129
|
+
# they are not currently in, and archived channels. The number of (non-deactivated) members in each channel
|
130
|
+
# is also returned.
|
124
131
|
#
|
125
132
|
# @option options [Object] :exclude_archived
|
126
133
|
# Don't return archived channels.
|
@@ -132,11 +139,11 @@ module Slack
|
|
132
139
|
end
|
133
140
|
|
134
141
|
#
|
135
|
-
#
|
142
|
+
# This method moves the read cursor in a channel.
|
136
143
|
#
|
137
|
-
# @option options [
|
144
|
+
# @option options [Object] :channel
|
138
145
|
# Channel to set reading cursor in.
|
139
|
-
# @option options [
|
146
|
+
# @option options [Object] :ts
|
140
147
|
# Timestamp of the most recently seen message.
|
141
148
|
# @see https://api.slack.com/methods/channels.mark
|
142
149
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/channels.mark.md
|
@@ -148,9 +155,9 @@ module Slack
|
|
148
155
|
end
|
149
156
|
|
150
157
|
#
|
151
|
-
#
|
158
|
+
# This method renames a team channel.
|
152
159
|
#
|
153
|
-
# @option options [
|
160
|
+
# @option options [Object] :channel
|
154
161
|
# Channel to rename
|
155
162
|
# @option options [Object] :name
|
156
163
|
# New name for channel.
|
@@ -164,9 +171,9 @@ module Slack
|
|
164
171
|
end
|
165
172
|
|
166
173
|
#
|
167
|
-
#
|
174
|
+
# This method is used to change the purpose of a channel. The calling user must be a member of the channel.
|
168
175
|
#
|
169
|
-
# @option options [
|
176
|
+
# @option options [Object] :channel
|
170
177
|
# Channel to set the purpose of
|
171
178
|
# @option options [Object] :purpose
|
172
179
|
# The new purpose
|
@@ -180,9 +187,9 @@ module Slack
|
|
180
187
|
end
|
181
188
|
|
182
189
|
#
|
183
|
-
#
|
190
|
+
# This method is used to change the topic of a channel. The calling user must be a member of the channel.
|
184
191
|
#
|
185
|
-
# @option options [
|
192
|
+
# @option options [Object] :channel
|
186
193
|
# Channel to set the topic of
|
187
194
|
# @option options [Object] :topic
|
188
195
|
# The new topic
|
@@ -196,9 +203,9 @@ module Slack
|
|
196
203
|
end
|
197
204
|
|
198
205
|
#
|
199
|
-
#
|
206
|
+
# This method unarchives a channel. The calling user is added to the channel.
|
200
207
|
#
|
201
|
-
# @option options [
|
208
|
+
# @option options [Object] :channel
|
202
209
|
# Channel to unarchive
|
203
210
|
# @see https://api.slack.com/methods/channels.unarchive
|
204
211
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/channels.unarchive.md
|
data/lib/slack/endpoint/chat.rb
CHANGED
@@ -4,11 +4,11 @@ module Slack
|
|
4
4
|
module Endpoint
|
5
5
|
module Chat
|
6
6
|
#
|
7
|
-
#
|
7
|
+
# This method deletes a message from a channel.
|
8
8
|
#
|
9
9
|
# @option options [Object] :ts
|
10
10
|
# Timestamp of the message to be deleted.
|
11
|
-
# @option options [
|
11
|
+
# @option options [Object] :channel
|
12
12
|
# Channel containing the message to be deleted.
|
13
13
|
# @see https://api.slack.com/methods/chat.delete
|
14
14
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/chat.delete.md
|
@@ -20,14 +20,16 @@ module Slack
|
|
20
20
|
end
|
21
21
|
|
22
22
|
#
|
23
|
-
#
|
23
|
+
# This method posts a message to a channel.
|
24
24
|
#
|
25
|
-
# @option options [
|
25
|
+
# @option options [Object] :channel
|
26
26
|
# Channel to send message to. Can be a public channel, private group or IM channel. Can be an encoded ID, or a name.
|
27
27
|
# @option options [Object] :text
|
28
28
|
# Text of the message to send. See below for an explanation of formatting.
|
29
29
|
# @option options [Object] :username
|
30
30
|
# Name of bot.
|
31
|
+
# @option options [Object] :as_user
|
32
|
+
# Pass true to post the message as the authed user, instead of as a bot
|
31
33
|
# @option options [Object] :parse
|
32
34
|
# Change how messages are treated. See below.
|
33
35
|
# @option options [Object] :link_names
|
@@ -41,7 +43,7 @@ module Slack
|
|
41
43
|
# @option options [Object] :icon_url
|
42
44
|
# URL to an image to use as the icon for this message
|
43
45
|
# @option options [Object] :icon_emoji
|
44
|
-
# emoji to use as the icon for this message. Overrides
|
46
|
+
# emoji to use as the icon for this message. Overrides icon_url.
|
45
47
|
# @see https://api.slack.com/methods/chat.postMessage
|
46
48
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/chat.postMessage.md
|
47
49
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/chat.postMessage.json
|
@@ -52,14 +54,14 @@ module Slack
|
|
52
54
|
end
|
53
55
|
|
54
56
|
#
|
55
|
-
#
|
57
|
+
# This method updates a message in a channel.
|
56
58
|
#
|
57
59
|
# @option options [Object] :ts
|
58
60
|
# Timestamp of the message to be updated.
|
59
|
-
# @option options [
|
61
|
+
# @option options [Object] :channel
|
60
62
|
# Channel containing the message to be updated.
|
61
63
|
# @option options [Object] :text
|
62
|
-
# New text for the message, using the
|
64
|
+
# New text for the message, using the default formatting rules.
|
63
65
|
# @see https://api.slack.com/methods/chat.update
|
64
66
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/chat.update.md
|
65
67
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/chat.update.json
|
data/lib/slack/endpoint/emoji.rb
CHANGED
@@ -4,7 +4,7 @@ module Slack
|
|
4
4
|
module Endpoint
|
5
5
|
module Emoji
|
6
6
|
#
|
7
|
-
#
|
7
|
+
# This method lists the custom emoji for a team.
|
8
8
|
#
|
9
9
|
# @see https://api.slack.com/methods/emoji.list
|
10
10
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/emoji.list.md
|
data/lib/slack/endpoint/files.rb
CHANGED
@@ -4,10 +4,27 @@ module Slack
|
|
4
4
|
module Endpoint
|
5
5
|
module Files
|
6
6
|
#
|
7
|
-
#
|
7
|
+
# This method deletes a file from your team.
|
8
8
|
#
|
9
|
-
# @option options [
|
9
|
+
# @option options [Object] :file
|
10
|
+
# ID of file to delete.
|
11
|
+
# @see https://api.slack.com/methods/files.delete
|
12
|
+
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/files.delete.md
|
13
|
+
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/files.delete.json
|
14
|
+
def files_delete(options={})
|
15
|
+
throw ArgumentError.new("Required arguments :file missing") if options[:file].nil?
|
16
|
+
post("files.delete", options)
|
17
|
+
end
|
18
|
+
|
19
|
+
#
|
20
|
+
# This method returns information about a file in your team.
|
21
|
+
#
|
22
|
+
# @option options [Object] :file
|
10
23
|
# File to fetch info for
|
24
|
+
# @option options [Object] :count
|
25
|
+
# Number of items to return per page.
|
26
|
+
# @option options [Object] :page
|
27
|
+
# Page number of results to return.
|
11
28
|
# @see https://api.slack.com/methods/files.info
|
12
29
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/files.info.md
|
13
30
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/files.info.json
|
@@ -17,9 +34,9 @@ module Slack
|
|
17
34
|
end
|
18
35
|
|
19
36
|
#
|
20
|
-
#
|
37
|
+
# This method returns a list of files within the team. It can be filtered and sliced in various ways.
|
21
38
|
#
|
22
|
-
# @option options [
|
39
|
+
# @option options [Object] :user
|
23
40
|
# Filter files created by a single user.
|
24
41
|
# @option options [Object] :ts_from
|
25
42
|
# Filter files created after this timestamp (inclusive).
|
@@ -28,15 +45,21 @@ module Slack
|
|
28
45
|
# @option options [Object] :types
|
29
46
|
# Filter files by type:
|
30
47
|
#
|
31
|
-
# * `all` - All files
|
32
|
-
# * `posts` - Posts
|
33
|
-
# * `snippets` - Snippets
|
34
|
-
# * `images` - Image files
|
35
|
-
# * `gdocs` - Google docs
|
36
|
-
# * `zips` - Zip files
|
37
|
-
# * `pdfs` - PDF files
|
38
48
|
#
|
39
|
-
#
|
49
|
+
# all - All files
|
50
|
+
# posts - Posts
|
51
|
+
# snippets - Snippets
|
52
|
+
# images - Image files
|
53
|
+
# gdocs - Google docs
|
54
|
+
# zips - Zip files
|
55
|
+
# pdfs - PDF files
|
56
|
+
#
|
57
|
+
#
|
58
|
+
# You can pass multiple values in the types argument, like types=posts,snippets.The default value is all, which does not filter the list.
|
59
|
+
# @option options [Object] :count
|
60
|
+
# Number of items to return per page.
|
61
|
+
# @option options [Object] :page
|
62
|
+
# Page number of results to return.
|
40
63
|
# @see https://api.slack.com/methods/files.list
|
41
64
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/files.list.md
|
42
65
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/files.list.json
|
@@ -45,10 +68,10 @@ module Slack
|
|
45
68
|
end
|
46
69
|
|
47
70
|
#
|
48
|
-
#
|
71
|
+
# This method allows you to create or upload an existing file.
|
49
72
|
#
|
50
73
|
# @option options [Object] :file
|
51
|
-
# File contents via
|
74
|
+
# File contents via multipart/form-data.
|
52
75
|
# @option options [Object] :content
|
53
76
|
# File contents via a POST var.
|
54
77
|
# @option options [Object] :filetype
|
@@ -59,7 +82,7 @@ module Slack
|
|
59
82
|
# Title of file.
|
60
83
|
# @option options [Object] :initial_comment
|
61
84
|
# Initial comment to add to file.
|
62
|
-
# @option options [
|
85
|
+
# @option options [Object] :channels
|
63
86
|
# Comma separated list of channels to share the file into.
|
64
87
|
# @see https://api.slack.com/methods/files.upload
|
65
88
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/files.upload.md
|
@@ -4,9 +4,9 @@ module Slack
|
|
4
4
|
module Endpoint
|
5
5
|
module Groups
|
6
6
|
#
|
7
|
-
#
|
7
|
+
# This method archives a private group.
|
8
8
|
#
|
9
|
-
# @option options [
|
9
|
+
# @option options [Object] :channel
|
10
10
|
# Private group to archive
|
11
11
|
# @see https://api.slack.com/methods/groups.archive
|
12
12
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/groups.archive.md
|
@@ -17,9 +17,9 @@ module Slack
|
|
17
17
|
end
|
18
18
|
|
19
19
|
#
|
20
|
-
#
|
20
|
+
# This method closes a private group.
|
21
21
|
#
|
22
|
-
# @option options [
|
22
|
+
# @option options [Object] :channel
|
23
23
|
# Group to open.
|
24
24
|
# @see https://api.slack.com/methods/groups.close
|
25
25
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/groups.close.md
|
@@ -30,7 +30,7 @@ module Slack
|
|
30
30
|
end
|
31
31
|
|
32
32
|
#
|
33
|
-
#
|
33
|
+
# This method creates a private group.
|
34
34
|
#
|
35
35
|
# @option options [Object] :name
|
36
36
|
# Name of group to create
|
@@ -43,9 +43,9 @@ module Slack
|
|
43
43
|
end
|
44
44
|
|
45
45
|
#
|
46
|
-
#
|
46
|
+
# This method takes an existing private group and performs the following steps:
|
47
47
|
#
|
48
|
-
# @option options [
|
48
|
+
# @option options [Object] :channel
|
49
49
|
# Group to clone and archive.
|
50
50
|
# @see https://api.slack.com/methods/groups.createChild
|
51
51
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/groups.createChild.md
|
@@ -56,14 +56,18 @@ module Slack
|
|
56
56
|
end
|
57
57
|
|
58
58
|
#
|
59
|
-
#
|
59
|
+
# This method returns a portion of messages/events from the specified private group.
|
60
|
+
# To read the entire history for a group, call the method with no latest or
|
61
|
+
# oldest arguments, and then continue paging using the instructions below.
|
60
62
|
#
|
61
|
-
# @option options [
|
63
|
+
# @option options [Object] :channel
|
62
64
|
# Group to fetch history for.
|
63
|
-
# @option options [
|
64
|
-
#
|
65
|
-
# @option options [
|
66
|
-
#
|
65
|
+
# @option options [Object] :latest
|
66
|
+
# End of time range of messages to include in results.
|
67
|
+
# @option options [Object] :oldest
|
68
|
+
# Start of time range of messages to include in results.
|
69
|
+
# @option options [Object] :inclusive
|
70
|
+
# Include messages with latest or oldest timestamp in results.
|
67
71
|
# @option options [Object] :count
|
68
72
|
# Number of messages to return, between 1 and 1000.
|
69
73
|
# @see https://api.slack.com/methods/groups.history
|
@@ -75,11 +79,24 @@ module Slack
|
|
75
79
|
end
|
76
80
|
|
77
81
|
#
|
78
|
-
#
|
82
|
+
# This method returns information about a private group.
|
79
83
|
#
|
80
|
-
# @option options [
|
84
|
+
# @option options [Object] :channel
|
85
|
+
# Group to get info on
|
86
|
+
# @see https://api.slack.com/methods/groups.info
|
87
|
+
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/groups.info.md
|
88
|
+
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/groups.info.json
|
89
|
+
def groups_info(options={})
|
90
|
+
throw ArgumentError.new("Required arguments :channel missing") if options[:channel].nil?
|
91
|
+
post("groups.info", options)
|
92
|
+
end
|
93
|
+
|
94
|
+
#
|
95
|
+
# This method is used to invite a user to a private group. The calling user must be a member of the group.
|
96
|
+
#
|
97
|
+
# @option options [Object] :channel
|
81
98
|
# Private group to invite user to.
|
82
|
-
# @option options [
|
99
|
+
# @option options [Object] :user
|
83
100
|
# User to invite.
|
84
101
|
# @see https://api.slack.com/methods/groups.invite
|
85
102
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/groups.invite.md
|
@@ -91,11 +108,11 @@ module Slack
|
|
91
108
|
end
|
92
109
|
|
93
110
|
#
|
94
|
-
#
|
111
|
+
# This method allows a user to remove another member from a private group.
|
95
112
|
#
|
96
|
-
# @option options [
|
113
|
+
# @option options [Object] :channel
|
97
114
|
# Group to remove user from.
|
98
|
-
# @option options [
|
115
|
+
# @option options [Object] :user
|
99
116
|
# User to remove from group.
|
100
117
|
# @see https://api.slack.com/methods/groups.kick
|
101
118
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/groups.kick.md
|
@@ -107,9 +124,9 @@ module Slack
|
|
107
124
|
end
|
108
125
|
|
109
126
|
#
|
110
|
-
#
|
127
|
+
# This method is used to leave a private group.
|
111
128
|
#
|
112
|
-
# @option options [
|
129
|
+
# @option options [Object] :channel
|
113
130
|
# Group to leave
|
114
131
|
# @see https://api.slack.com/methods/groups.leave
|
115
132
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/groups.leave.md
|
@@ -120,7 +137,8 @@ module Slack
|
|
120
137
|
end
|
121
138
|
|
122
139
|
#
|
123
|
-
#
|
140
|
+
# This method returns a list of groups in the team that the caller is in and archived groups that the caller was in.
|
141
|
+
# The list of (non-deactivated) members in each group is also returned.
|
124
142
|
#
|
125
143
|
# @option options [Object] :exclude_archived
|
126
144
|
# Don't return archived groups.
|
@@ -132,11 +150,11 @@ module Slack
|
|
132
150
|
end
|
133
151
|
|
134
152
|
#
|
135
|
-
#
|
153
|
+
# This method moves the read cursor in a private group.
|
136
154
|
#
|
137
|
-
# @option options [
|
155
|
+
# @option options [Object] :channel
|
138
156
|
# Group to set reading cursor in.
|
139
|
-
# @option options [
|
157
|
+
# @option options [Object] :ts
|
140
158
|
# Timestamp of the most recently seen message.
|
141
159
|
# @see https://api.slack.com/methods/groups.mark
|
142
160
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/groups.mark.md
|
@@ -148,9 +166,9 @@ module Slack
|
|
148
166
|
end
|
149
167
|
|
150
168
|
#
|
151
|
-
#
|
169
|
+
# This method opens a private group.
|
152
170
|
#
|
153
|
-
# @option options [
|
171
|
+
# @option options [Object] :channel
|
154
172
|
# Group to open.
|
155
173
|
# @see https://api.slack.com/methods/groups.open
|
156
174
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/groups.open.md
|
@@ -161,9 +179,9 @@ module Slack
|
|
161
179
|
end
|
162
180
|
|
163
181
|
#
|
164
|
-
#
|
182
|
+
# This method renames a private group.
|
165
183
|
#
|
166
|
-
# @option options [
|
184
|
+
# @option options [Object] :channel
|
167
185
|
# Group to rename
|
168
186
|
# @option options [Object] :name
|
169
187
|
# New name for group.
|
@@ -177,9 +195,9 @@ module Slack
|
|
177
195
|
end
|
178
196
|
|
179
197
|
#
|
180
|
-
#
|
198
|
+
# This method is used to change the purpose of a private group. The calling user must be a member of the private group.
|
181
199
|
#
|
182
|
-
# @option options [
|
200
|
+
# @option options [Object] :channel
|
183
201
|
# Private group to set the purpose of
|
184
202
|
# @option options [Object] :purpose
|
185
203
|
# The new purpose
|
@@ -193,9 +211,9 @@ module Slack
|
|
193
211
|
end
|
194
212
|
|
195
213
|
#
|
196
|
-
#
|
214
|
+
# This method is used to change the topic of a private group. The calling user must be a member of the private group.
|
197
215
|
#
|
198
|
-
# @option options [
|
216
|
+
# @option options [Object] :channel
|
199
217
|
# Private group to set the topic of
|
200
218
|
# @option options [Object] :topic
|
201
219
|
# The new topic
|
@@ -209,9 +227,9 @@ module Slack
|
|
209
227
|
end
|
210
228
|
|
211
229
|
#
|
212
|
-
#
|
230
|
+
# This method unarchives a private group.
|
213
231
|
#
|
214
|
-
# @option options [
|
232
|
+
# @option options [Object] :channel
|
215
233
|
# Group to unarchive
|
216
234
|
# @see https://api.slack.com/methods/groups.unarchive
|
217
235
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/groups.unarchive.md
|
data/lib/slack/endpoint/im.rb
CHANGED
@@ -4,9 +4,9 @@ module Slack
|
|
4
4
|
module Endpoint
|
5
5
|
module Im
|
6
6
|
#
|
7
|
-
#
|
7
|
+
# This method closes a direct message channel.
|
8
8
|
#
|
9
|
-
# @option options [
|
9
|
+
# @option options [Object] :channel
|
10
10
|
# Direct message channel to close.
|
11
11
|
# @see https://api.slack.com/methods/im.close
|
12
12
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/im.close.md
|
@@ -17,14 +17,18 @@ module Slack
|
|
17
17
|
end
|
18
18
|
|
19
19
|
#
|
20
|
-
#
|
20
|
+
# This method returns a portion of messages/events from the specified direct message channel.
|
21
|
+
# To read the entire history for a direct message channel, call the method with no latest or
|
22
|
+
# oldest arguments, and then continue paging using the instructions below.
|
21
23
|
#
|
22
|
-
# @option options [
|
24
|
+
# @option options [Object] :channel
|
23
25
|
# Direct message channel to fetch history for.
|
24
|
-
# @option options [
|
25
|
-
#
|
26
|
-
# @option options [
|
27
|
-
#
|
26
|
+
# @option options [Object] :latest
|
27
|
+
# End of time range of messages to include in results.
|
28
|
+
# @option options [Object] :oldest
|
29
|
+
# Start of time range of messages to include in results.
|
30
|
+
# @option options [Object] :inclusive
|
31
|
+
# Include messages with latest or oldest timestamp in results.
|
28
32
|
# @option options [Object] :count
|
29
33
|
# Number of messages to return, between 1 and 1000.
|
30
34
|
# @see https://api.slack.com/methods/im.history
|
@@ -36,7 +40,7 @@ module Slack
|
|
36
40
|
end
|
37
41
|
|
38
42
|
#
|
39
|
-
#
|
43
|
+
# This method returns a list of all im channels that the user has.
|
40
44
|
#
|
41
45
|
# @see https://api.slack.com/methods/im.list
|
42
46
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/im.list.md
|
@@ -46,11 +50,11 @@ module Slack
|
|
46
50
|
end
|
47
51
|
|
48
52
|
#
|
49
|
-
#
|
53
|
+
# This method moves the read cursor in a direct message channel.
|
50
54
|
#
|
51
|
-
# @option options [
|
55
|
+
# @option options [Object] :channel
|
52
56
|
# Direct message channel to set reading cursor in.
|
53
|
-
# @option options [
|
57
|
+
# @option options [Object] :ts
|
54
58
|
# Timestamp of the most recently seen message.
|
55
59
|
# @see https://api.slack.com/methods/im.mark
|
56
60
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/im.mark.md
|
@@ -62,9 +66,9 @@ module Slack
|
|
62
66
|
end
|
63
67
|
|
64
68
|
#
|
65
|
-
#
|
69
|
+
# This method opens a direct message channel with another member of your Slack team.
|
66
70
|
#
|
67
|
-
# @option options [
|
71
|
+
# @option options [Object] :user
|
68
72
|
# User to open a direct message channel with.
|
69
73
|
# @see https://api.slack.com/methods/im.open
|
70
74
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/im.open.md
|
data/lib/slack/endpoint/oauth.rb
CHANGED
@@ -4,14 +4,15 @@ module Slack
|
|
4
4
|
module Endpoint
|
5
5
|
module Oauth
|
6
6
|
#
|
7
|
-
#
|
7
|
+
# This method allows you to exchange a temporary OAuth code for an API access token.
|
8
|
+
# This is used as part of the OAuth authentication flow.
|
8
9
|
#
|
9
10
|
# @option options [Object] :client_id
|
10
11
|
# Issued when you created your application.
|
11
12
|
# @option options [Object] :client_secret
|
12
13
|
# Issued when you created your application.
|
13
14
|
# @option options [Object] :code
|
14
|
-
# The
|
15
|
+
# The code param returned via the OAuth callback.
|
15
16
|
# @option options [Object] :redirect_uri
|
16
17
|
# This must match the originally submitted URI (if one was sent).
|
17
18
|
# @see https://api.slack.com/methods/oauth.access
|
@@ -4,16 +4,20 @@ module Slack
|
|
4
4
|
module Endpoint
|
5
5
|
module Search
|
6
6
|
#
|
7
|
-
#
|
7
|
+
# This method allows to to search both messages and files in a single call.
|
8
8
|
#
|
9
9
|
# @option options [Object] :query
|
10
10
|
# Search query. May contains booleans, etc.
|
11
11
|
# @option options [Object] :sort
|
12
|
-
# Return matches sorted by either
|
12
|
+
# Return matches sorted by either score or timestamp.
|
13
13
|
# @option options [Object] :sort_dir
|
14
|
-
# Change sort direction to ascending (
|
14
|
+
# Change sort direction to ascending (asc) or descending (desc).
|
15
15
|
# @option options [Object] :highlight
|
16
|
-
# Pass a value of
|
16
|
+
# Pass a value of 1 to enable query highlight markers (see below).
|
17
|
+
# @option options [Object] :count
|
18
|
+
# Number of items to return per page.
|
19
|
+
# @option options [Object] :page
|
20
|
+
# Page number of results to return.
|
17
21
|
# @see https://api.slack.com/methods/search.all
|
18
22
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/search.all.md
|
19
23
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/search.all.json
|
@@ -23,16 +27,20 @@ module Slack
|
|
23
27
|
end
|
24
28
|
|
25
29
|
#
|
26
|
-
#
|
30
|
+
# This method returns files matching a search query.
|
27
31
|
#
|
28
32
|
# @option options [Object] :query
|
29
|
-
# Search query. May
|
33
|
+
# Search query. May contain booleans, etc.
|
30
34
|
# @option options [Object] :sort
|
31
|
-
# Return matches sorted by either
|
35
|
+
# Return matches sorted by either score or timestamp.
|
32
36
|
# @option options [Object] :sort_dir
|
33
|
-
# Change sort direction to ascending (
|
37
|
+
# Change sort direction to ascending (asc) or descending (desc).
|
34
38
|
# @option options [Object] :highlight
|
35
|
-
# Pass a value of
|
39
|
+
# Pass a value of 1 to enable query highlight markers (see below).
|
40
|
+
# @option options [Object] :count
|
41
|
+
# Number of items to return per page.
|
42
|
+
# @option options [Object] :page
|
43
|
+
# Page number of results to return.
|
36
44
|
# @see https://api.slack.com/methods/search.files
|
37
45
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/search.files.md
|
38
46
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/search.files.json
|
@@ -42,16 +50,20 @@ module Slack
|
|
42
50
|
end
|
43
51
|
|
44
52
|
#
|
45
|
-
#
|
53
|
+
# This method returns messages matching a search query.
|
46
54
|
#
|
47
55
|
# @option options [Object] :query
|
48
56
|
# Search query. May contains booleans, etc.
|
49
57
|
# @option options [Object] :sort
|
50
|
-
# Return matches sorted by either
|
58
|
+
# Return matches sorted by either score or timestamp.
|
51
59
|
# @option options [Object] :sort_dir
|
52
|
-
# Change sort direction to ascending (
|
60
|
+
# Change sort direction to ascending (asc) or descending (desc).
|
53
61
|
# @option options [Object] :highlight
|
54
|
-
# Pass a value of
|
62
|
+
# Pass a value of 1 to enable query highlight markers (see below).
|
63
|
+
# @option options [Object] :count
|
64
|
+
# Number of items to return per page.
|
65
|
+
# @option options [Object] :page
|
66
|
+
# Page number of results to return.
|
55
67
|
# @see https://api.slack.com/methods/search.messages
|
56
68
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/search.messages.md
|
57
69
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/search.messages.json
|
data/lib/slack/endpoint/stars.rb
CHANGED
@@ -4,10 +4,14 @@ module Slack
|
|
4
4
|
module Endpoint
|
5
5
|
module Stars
|
6
6
|
#
|
7
|
-
#
|
7
|
+
# This method lists the items starred by a user.
|
8
8
|
#
|
9
|
-
# @option options [
|
9
|
+
# @option options [Object] :user
|
10
10
|
# Show stars by this user. Defaults to the authed user.
|
11
|
+
# @option options [Object] :count
|
12
|
+
# Number of items to return per page.
|
13
|
+
# @option options [Object] :page
|
14
|
+
# Page number of results to return.
|
11
15
|
# @see https://api.slack.com/methods/stars.list
|
12
16
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/stars.list.md
|
13
17
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/stars.list.json
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# This file was auto-generated by lib/generators/tasks/generate.rb
|
2
|
+
|
3
|
+
module Slack
|
4
|
+
module Endpoint
|
5
|
+
module Team
|
6
|
+
#
|
7
|
+
# This method is used to get the access logs for users on a team.
|
8
|
+
#
|
9
|
+
# @option options [Object] :count
|
10
|
+
# Number of items to return per page.
|
11
|
+
# @option options [Object] :page
|
12
|
+
# Page number of results to return.
|
13
|
+
# @see https://api.slack.com/methods/team.accessLogs
|
14
|
+
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/team.accessLogs.md
|
15
|
+
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/team.accessLogs.json
|
16
|
+
def team_accessLogs(options={})
|
17
|
+
post("team.accessLogs", options)
|
18
|
+
end
|
19
|
+
|
20
|
+
#
|
21
|
+
# This method provides information about your team.
|
22
|
+
#
|
23
|
+
# @see https://api.slack.com/methods/team.info
|
24
|
+
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/team.info.md
|
25
|
+
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/team.info.json
|
26
|
+
def team_info(options={})
|
27
|
+
post("team.info", options)
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
data/lib/slack/endpoint/users.rb
CHANGED
@@ -4,9 +4,10 @@ module Slack
|
|
4
4
|
module Endpoint
|
5
5
|
module Users
|
6
6
|
#
|
7
|
-
#
|
7
|
+
# This method lets you find out information about a user's presence.
|
8
|
+
# Consult the presence documentation for more details.
|
8
9
|
#
|
9
|
-
# @option options [
|
10
|
+
# @option options [Object] :user
|
10
11
|
# User to get presence info on. Defaults to the authed user.
|
11
12
|
# @see https://api.slack.com/methods/users.getPresence
|
12
13
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/users.getPresence.md
|
@@ -17,9 +18,9 @@ module Slack
|
|
17
18
|
end
|
18
19
|
|
19
20
|
#
|
20
|
-
#
|
21
|
+
# This method returns information about a team member.
|
21
22
|
#
|
22
|
-
# @option options [
|
23
|
+
# @option options [Object] :user
|
23
24
|
# User to get info on
|
24
25
|
# @see https://api.slack.com/methods/users.info
|
25
26
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/users.info.md
|
@@ -30,7 +31,7 @@ module Slack
|
|
30
31
|
end
|
31
32
|
|
32
33
|
#
|
33
|
-
#
|
34
|
+
# This method returns a list of all users in the team. This includes deleted/deactivated users.
|
34
35
|
#
|
35
36
|
# @see https://api.slack.com/methods/users.list
|
36
37
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/users.list.md
|
@@ -40,7 +41,9 @@ module Slack
|
|
40
41
|
end
|
41
42
|
|
42
43
|
#
|
43
|
-
#
|
44
|
+
# This method lets the slack messaging server know that the authenticated user
|
45
|
+
# is currently active. Consult the presence documentation for
|
46
|
+
# more details.
|
44
47
|
#
|
45
48
|
# @see https://api.slack.com/methods/users.setActive
|
46
49
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/users.setActive.md
|
@@ -50,10 +53,11 @@ module Slack
|
|
50
53
|
end
|
51
54
|
|
52
55
|
#
|
53
|
-
#
|
56
|
+
# This method lets you set the calling user's manual presence.
|
57
|
+
# Consult the presence documentation for more details.
|
54
58
|
#
|
55
59
|
# @option options [Object] :presence
|
56
|
-
# Either
|
60
|
+
# Either auto or away
|
57
61
|
# @see https://api.slack.com/methods/users.setPresence
|
58
62
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/users.setPresence.md
|
59
63
|
# @see https://github.com/slackhq/slack-api-docs/blob/master/methods/users.setPresence.json
|
data/lib/slack/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: slack-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- aki017
|
@@ -286,6 +286,7 @@ files:
|
|
286
286
|
- lib/slack/endpoint/presence.rb
|
287
287
|
- lib/slack/endpoint/search.rb
|
288
288
|
- lib/slack/endpoint/stars.rb
|
289
|
+
- lib/slack/endpoint/team.rb
|
289
290
|
- lib/slack/endpoint/users.rb
|
290
291
|
- lib/slack/error.rb
|
291
292
|
- lib/slack/realtime/client.rb
|