slack-ruby-client 0.9.0 → 0.9.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -8
- data/CHANGELOG.md +4 -0
- data/README.md +1 -1
- data/bin/commands.rb +1 -0
- data/bin/commands/api.rb +2 -2
- data/bin/commands/apps_permissions.rb +22 -0
- data/bin/commands/auth.rb +4 -4
- data/bin/commands/bots.rb +2 -2
- data/bin/commands/channels.rb +31 -31
- data/bin/commands/chat.rb +40 -23
- data/bin/commands/dnd.rb +8 -8
- data/bin/commands/emoji.rb +2 -2
- data/bin/commands/files.rb +17 -17
- data/bin/commands/files_comments.rb +6 -6
- data/bin/commands/groups.rb +36 -35
- data/bin/commands/im.rb +13 -13
- data/bin/commands/mpim.rb +11 -11
- data/bin/commands/oauth.rb +15 -2
- data/bin/commands/pins.rb +6 -6
- data/bin/commands/reactions.rb +13 -13
- data/bin/commands/reminders.rb +10 -10
- data/bin/commands/rtm.rb +10 -6
- data/bin/commands/search.rb +9 -9
- data/bin/commands/stars.rb +8 -8
- data/bin/commands/team.rb +10 -10
- data/bin/commands/team_profile.rb +2 -2
- data/bin/commands/usergroups.rb +16 -16
- data/bin/commands/usergroups_users.rb +4 -4
- data/bin/commands/users.rb +20 -18
- data/bin/commands/users_profile.rb +7 -7
- data/lib/slack/real_time/stores/starter.rb +20 -0
- data/lib/slack/real_time/stores/store.rb +20 -0
- data/lib/slack/version.rb +1 -1
- data/lib/slack/web/api/endpoints.rb +2 -0
- data/lib/slack/web/api/endpoints/api.rb +1 -1
- data/lib/slack/web/api/endpoints/apps_permissions.rb +35 -0
- data/lib/slack/web/api/endpoints/auth.rb +2 -2
- data/lib/slack/web/api/endpoints/bots.rb +1 -1
- data/lib/slack/web/api/endpoints/channels.rb +17 -18
- data/lib/slack/web/api/endpoints/chat.rb +67 -30
- data/lib/slack/web/api/endpoints/dnd.rb +4 -4
- data/lib/slack/web/api/endpoints/emoji.rb +1 -1
- data/lib/slack/web/api/endpoints/files.rb +16 -17
- data/lib/slack/web/api/endpoints/files_comments.rb +8 -8
- data/lib/slack/web/api/endpoints/groups.rb +21 -22
- data/lib/slack/web/api/endpoints/im.rb +8 -10
- data/lib/slack/web/api/endpoints/mpim.rb +7 -9
- data/lib/slack/web/api/endpoints/oauth.rb +23 -2
- data/lib/slack/web/api/endpoints/pins.rb +3 -5
- data/lib/slack/web/api/endpoints/reactions.rb +14 -16
- data/lib/slack/web/api/endpoints/reminders.rb +5 -5
- data/lib/slack/web/api/endpoints/rtm.rb +14 -6
- data/lib/slack/web/api/endpoints/search.rb +9 -9
- data/lib/slack/web/api/endpoints/stars.rb +7 -9
- data/lib/slack/web/api/endpoints/team.rb +8 -9
- data/lib/slack/web/api/endpoints/team_profile.rb +1 -1
- data/lib/slack/web/api/endpoints/usergroups.rb +17 -17
- data/lib/slack/web/api/endpoints/usergroups_users.rb +2 -2
- data/lib/slack/web/api/endpoints/users.rb +15 -15
- data/lib/slack/web/api/endpoints/users_profile.rb +8 -8
- data/lib/slack/web/api/patches/chat.3.update-attachments-support.patch +4 -3
- data/lib/slack/web/api/patches/chat.4.postEphemeral-attachments-support.patch +17 -0
- data/spec/integration/integration_spec.rb +1 -1
- data/spec/slack/web/api/endpoints/apps_permissions_spec.rb +15 -0
- data/spec/slack/web/api/endpoints/custom_specs/chat_spec.rb +37 -1
- data/spec/slack/web/api/endpoints/files_comments_spec.rb +8 -8
- data/spec/slack/web/api/endpoints/files_spec.rb +0 -5
- data/spec/slack/web/api/endpoints/oauth_spec.rb +11 -0
- metadata +7 -2
data/bin/commands/emoji.rb
CHANGED
@@ -2,8 +2,8 @@
|
|
2
2
|
|
3
3
|
desc 'Emoji methods.'
|
4
4
|
command 'emoji' do |g|
|
5
|
-
g.desc '
|
6
|
-
g.long_desc %(
|
5
|
+
g.desc 'Lists custom emoji for a team.'
|
6
|
+
g.long_desc %( Lists custom emoji for a team. )
|
7
7
|
g.command 'list' do |c|
|
8
8
|
c.action do |_global_options, options, _args|
|
9
9
|
puts JSON.dump($client.emoji_list(options))
|
data/bin/commands/files.rb
CHANGED
@@ -2,8 +2,8 @@
|
|
2
2
|
|
3
3
|
desc 'Get info on files uploaded to Slack, upload new files to Slack.'
|
4
4
|
command 'files' do |g|
|
5
|
-
g.desc '
|
6
|
-
g.long_desc %(
|
5
|
+
g.desc 'Deletes a file.'
|
6
|
+
g.long_desc %( Deletes a file. )
|
7
7
|
g.command 'delete' do |c|
|
8
8
|
c.flag 'file', desc: 'ID of file to delete.'
|
9
9
|
c.action do |_global_options, options, _args|
|
@@ -11,8 +11,8 @@ command 'files' do |g|
|
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
14
|
-
g.desc '
|
15
|
-
g.long_desc %(
|
14
|
+
g.desc 'Gets information about a team file.'
|
15
|
+
g.long_desc %( Gets information about a team file. )
|
16
16
|
g.command 'info' do |c|
|
17
17
|
c.flag 'file', desc: 'Specify a file by providing its ID.'
|
18
18
|
c.action do |_global_options, options, _args|
|
@@ -20,10 +20,9 @@ command 'files' do |g|
|
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
23
|
-
g.desc '
|
24
|
-
g.long_desc %(
|
23
|
+
g.desc 'Lists & filters team files.'
|
24
|
+
g.long_desc %( Lists & filters team files. )
|
25
25
|
g.command 'list' do |c|
|
26
|
-
c.flag 'user', desc: 'Filter files created by a single user.'
|
27
26
|
c.flag 'channel', desc: 'Filter files appearing in a specific channel, indicated by its ID.'
|
28
27
|
c.flag 'ts_from', desc: 'Filter files created after this timestamp (inclusive).'
|
29
28
|
c.flag 'ts_to', desc: 'Filter files created before this timestamp (inclusive).'
|
@@ -40,13 +39,14 @@ pdfs - PDF files
|
|
40
39
|
|
41
40
|
You can pass multiple values in the types argument, like types=spaces,snippets.The default value is all, which does not filter the list.
|
42
41
|
.'
|
42
|
+
c.flag 'user', desc: 'Filter files created by a single user.'
|
43
43
|
c.action do |_global_options, options, _args|
|
44
44
|
puts JSON.dump($client.files_list(options))
|
45
45
|
end
|
46
46
|
end
|
47
47
|
|
48
|
-
g.desc '
|
49
|
-
g.long_desc %(
|
48
|
+
g.desc 'Revokes public/external sharing access for a file'
|
49
|
+
g.long_desc %( Revokes public/external sharing access for a file )
|
50
50
|
g.command 'revokePublicURL' do |c|
|
51
51
|
c.flag 'file', desc: 'File to revoke.'
|
52
52
|
c.action do |_global_options, options, _args|
|
@@ -54,8 +54,8 @@ You can pass multiple values in the types argument, like types=spaces,snippets.T
|
|
54
54
|
end
|
55
55
|
end
|
56
56
|
|
57
|
-
g.desc '
|
58
|
-
g.long_desc %(
|
57
|
+
g.desc 'Enables a file for public/external sharing.'
|
58
|
+
g.long_desc %( Enables a file for public/external sharing. )
|
59
59
|
g.command 'sharedPublicURL' do |c|
|
60
60
|
c.flag 'file', desc: 'File to share.'
|
61
61
|
c.action do |_global_options, options, _args|
|
@@ -63,16 +63,16 @@ You can pass multiple values in the types argument, like types=spaces,snippets.T
|
|
63
63
|
end
|
64
64
|
end
|
65
65
|
|
66
|
-
g.desc '
|
67
|
-
g.long_desc %(
|
66
|
+
g.desc 'Uploads or creates a file.'
|
67
|
+
g.long_desc %( Uploads or creates a file. )
|
68
68
|
g.command 'upload' do |c|
|
69
|
-
c.flag '
|
69
|
+
c.flag 'channels', desc: 'Comma-separated list of channel names or IDs where the file will be shared.'
|
70
70
|
c.flag 'content', desc: 'File contents via a POST variable. If omitting this parameter, you must provide a file.'
|
71
|
-
c.flag '
|
71
|
+
c.flag 'file', desc: 'File contents via multipart/form-data. If omitting this parameter, you must submit content.'
|
72
72
|
c.flag 'filename', desc: 'Filename of file.'
|
73
|
-
c.flag '
|
73
|
+
c.flag 'filetype', desc: 'A file type identifier.'
|
74
74
|
c.flag 'initial_comment', desc: 'Initial comment to add to file.'
|
75
|
-
c.flag '
|
75
|
+
c.flag 'title', desc: 'Title of file.'
|
76
76
|
c.action do |_global_options, options, _args|
|
77
77
|
puts JSON.dump($client.files_upload(options))
|
78
78
|
end
|
@@ -5,15 +5,15 @@ command 'files_comments' do |g|
|
|
5
5
|
g.desc 'Add a comment to an existing file.'
|
6
6
|
g.long_desc %( Add a comment to an existing file. )
|
7
7
|
g.command 'add' do |c|
|
8
|
-
c.flag 'file', desc: 'File to add a comment to.'
|
9
8
|
c.flag 'comment', desc: 'Text of the comment to add.'
|
9
|
+
c.flag 'file', desc: 'File to add a comment to.'
|
10
10
|
c.action do |_global_options, options, _args|
|
11
11
|
puts JSON.dump($client.files_comments_add(options))
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
15
|
-
g.desc '
|
16
|
-
g.long_desc %(
|
15
|
+
g.desc 'Deletes an existing comment on a file.'
|
16
|
+
g.long_desc %( Deletes an existing comment on a file. )
|
17
17
|
g.command 'delete' do |c|
|
18
18
|
c.flag 'file', desc: 'File to delete a comment from.'
|
19
19
|
c.flag 'id', desc: 'The comment to delete.'
|
@@ -22,12 +22,12 @@ command 'files_comments' do |g|
|
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
25
|
-
g.desc 'Edit an existing
|
26
|
-
g.long_desc %( Edit an existing
|
25
|
+
g.desc 'Edit an existing file comment.'
|
26
|
+
g.long_desc %( Edit an existing file comment. )
|
27
27
|
g.command 'edit' do |c|
|
28
|
+
c.flag 'comment', desc: 'Text of the comment to edit.'
|
28
29
|
c.flag 'file', desc: 'File containing the comment to edit.'
|
29
30
|
c.flag 'id', desc: 'The comment to edit.'
|
30
|
-
c.flag 'comment', desc: 'Text of the comment to edit.'
|
31
31
|
c.action do |_global_options, options, _args|
|
32
32
|
puts JSON.dump($client.files_comments_edit(options))
|
33
33
|
end
|
data/bin/commands/groups.rb
CHANGED
@@ -2,8 +2,8 @@
|
|
2
2
|
|
3
3
|
desc "Get info on your team's private channels."
|
4
4
|
command 'groups' do |g|
|
5
|
-
g.desc '
|
6
|
-
g.long_desc %(
|
5
|
+
g.desc 'Archives a private channel.'
|
6
|
+
g.long_desc %( Archives a private channel. )
|
7
7
|
g.command 'archive' do |c|
|
8
8
|
c.flag 'channel', desc: 'Private channel to archive.'
|
9
9
|
c.action do |_global_options, options, _args|
|
@@ -11,8 +11,8 @@ command 'groups' do |g|
|
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
14
|
-
g.desc '
|
15
|
-
g.long_desc %(
|
14
|
+
g.desc 'Closes a private channel.'
|
15
|
+
g.long_desc %( Closes a private channel. )
|
16
16
|
g.command 'close' do |c|
|
17
17
|
c.flag 'channel', desc: 'Private channel to close.'
|
18
18
|
c.action do |_global_options, options, _args|
|
@@ -20,8 +20,8 @@ command 'groups' do |g|
|
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
23
|
-
g.desc '
|
24
|
-
g.long_desc %(
|
23
|
+
g.desc 'Creates a private channel.'
|
24
|
+
g.long_desc %( Creates a private channel. )
|
25
25
|
g.command 'create' do |c|
|
26
26
|
c.flag 'name', desc: 'Name of private channel to create.'
|
27
27
|
c.flag 'validate', desc: 'Whether to return errors on invalid channel name instead of modifying it to meet the specified criteria.'
|
@@ -30,8 +30,8 @@ command 'groups' do |g|
|
|
30
30
|
end
|
31
31
|
end
|
32
32
|
|
33
|
-
g.desc '
|
34
|
-
g.long_desc %(
|
33
|
+
g.desc 'Clones and archives a private channel.'
|
34
|
+
g.long_desc %( Clones and archives a private channel. )
|
35
35
|
g.command 'createChild' do |c|
|
36
36
|
c.flag 'channel', desc: 'Private channel to clone and archive.'
|
37
37
|
c.action do |_global_options, options, _args|
|
@@ -39,21 +39,21 @@ command 'groups' do |g|
|
|
39
39
|
end
|
40
40
|
end
|
41
41
|
|
42
|
-
g.desc '
|
43
|
-
g.long_desc %(
|
42
|
+
g.desc 'Fetches history of messages and events from a private channel.'
|
43
|
+
g.long_desc %( Fetches history of messages and events from a private channel. )
|
44
44
|
g.command 'history' do |c|
|
45
45
|
c.flag 'channel', desc: 'Private channel to fetch history for.'
|
46
|
+
c.flag 'inclusive', desc: 'Include messages with latest or oldest timestamp in results.'
|
46
47
|
c.flag 'latest', desc: 'End of time range of messages to include in results.'
|
47
48
|
c.flag 'oldest', desc: 'Start of time range of messages to include in results.'
|
48
|
-
c.flag 'inclusive', desc: 'Include messages with latest or oldest timestamp in results.'
|
49
49
|
c.flag 'unreads', desc: 'Include unread_count_display in the output?.'
|
50
50
|
c.action do |_global_options, options, _args|
|
51
51
|
puts JSON.dump($client.groups_history(options))
|
52
52
|
end
|
53
53
|
end
|
54
54
|
|
55
|
-
g.desc '
|
56
|
-
g.long_desc %(
|
55
|
+
g.desc 'Gets information about a private channel.'
|
56
|
+
g.long_desc %( Gets information about a private channel. )
|
57
57
|
g.command 'info' do |c|
|
58
58
|
c.flag 'channel', desc: 'Private channel to get info on.'
|
59
59
|
c.action do |_global_options, options, _args|
|
@@ -61,8 +61,8 @@ command 'groups' do |g|
|
|
61
61
|
end
|
62
62
|
end
|
63
63
|
|
64
|
-
g.desc '
|
65
|
-
g.long_desc %(
|
64
|
+
g.desc 'Invites a user to a private channel.'
|
65
|
+
g.long_desc %( Invites a user to a private channel. )
|
66
66
|
g.command 'invite' do |c|
|
67
67
|
c.flag 'channel', desc: 'Private channel to invite user to.'
|
68
68
|
c.flag 'user', desc: 'User to invite.'
|
@@ -71,8 +71,8 @@ command 'groups' do |g|
|
|
71
71
|
end
|
72
72
|
end
|
73
73
|
|
74
|
-
g.desc '
|
75
|
-
g.long_desc %(
|
74
|
+
g.desc 'Removes a user from a private channel.'
|
75
|
+
g.long_desc %( Removes a user from a private channel. )
|
76
76
|
g.command 'kick' do |c|
|
77
77
|
c.flag 'channel', desc: 'Private channel to remove user from.'
|
78
78
|
c.flag 'user', desc: 'User to remove from private channel.'
|
@@ -81,8 +81,8 @@ command 'groups' do |g|
|
|
81
81
|
end
|
82
82
|
end
|
83
83
|
|
84
|
-
g.desc '
|
85
|
-
g.long_desc %(
|
84
|
+
g.desc 'Leaves a private channel.'
|
85
|
+
g.long_desc %( Leaves a private channel. )
|
86
86
|
g.command 'leave' do |c|
|
87
87
|
c.flag 'channel', desc: 'Private channel to leave.'
|
88
88
|
c.action do |_global_options, options, _args|
|
@@ -90,17 +90,18 @@ command 'groups' do |g|
|
|
90
90
|
end
|
91
91
|
end
|
92
92
|
|
93
|
-
g.desc '
|
94
|
-
g.long_desc %(
|
93
|
+
g.desc 'Lists private channels that the calling user has access to.'
|
94
|
+
g.long_desc %( Lists private channels that the calling user has access to. )
|
95
95
|
g.command 'list' do |c|
|
96
96
|
c.flag 'exclude_archived', desc: "Don't return archived private channels."
|
97
|
+
c.flag 'exclude_members', desc: 'Exlude the members from each group.'
|
97
98
|
c.action do |_global_options, options, _args|
|
98
99
|
puts JSON.dump($client.groups_list(options))
|
99
100
|
end
|
100
101
|
end
|
101
102
|
|
102
|
-
g.desc '
|
103
|
-
g.long_desc %(
|
103
|
+
g.desc 'Sets the read cursor in a private channel.'
|
104
|
+
g.long_desc %( Sets the read cursor in a private channel. )
|
104
105
|
g.command 'mark' do |c|
|
105
106
|
c.flag 'channel', desc: 'Private channel to set reading cursor in.'
|
106
107
|
c.flag 'ts', desc: 'Timestamp of the most recently seen message.'
|
@@ -109,8 +110,8 @@ command 'groups' do |g|
|
|
109
110
|
end
|
110
111
|
end
|
111
112
|
|
112
|
-
g.desc '
|
113
|
-
g.long_desc %(
|
113
|
+
g.desc 'Opens a private channel.'
|
114
|
+
g.long_desc %( Opens a private channel. )
|
114
115
|
g.command 'open' do |c|
|
115
116
|
c.flag 'channel', desc: 'Private channel to open.'
|
116
117
|
c.action do |_global_options, options, _args|
|
@@ -118,8 +119,8 @@ command 'groups' do |g|
|
|
118
119
|
end
|
119
120
|
end
|
120
121
|
|
121
|
-
g.desc '
|
122
|
-
g.long_desc %(
|
122
|
+
g.desc 'Renames a private channel.'
|
123
|
+
g.long_desc %( Renames a private channel. )
|
123
124
|
g.command 'rename' do |c|
|
124
125
|
c.flag 'channel', desc: 'Private channel to rename.'
|
125
126
|
c.flag 'name', desc: 'New name for private channel.'
|
@@ -129,8 +130,8 @@ command 'groups' do |g|
|
|
129
130
|
end
|
130
131
|
end
|
131
132
|
|
132
|
-
g.desc '
|
133
|
-
g.long_desc %(
|
133
|
+
g.desc 'Retrieve a thread of messages posted to a private channel'
|
134
|
+
g.long_desc %( Retrieve a thread of messages posted to a private channel )
|
134
135
|
g.command 'replies' do |c|
|
135
136
|
c.flag 'channel', desc: 'Private channel to fetch thread from.'
|
136
137
|
c.flag 'thread_ts', desc: "Unique identifier of a thread's parent message."
|
@@ -139,8 +140,8 @@ command 'groups' do |g|
|
|
139
140
|
end
|
140
141
|
end
|
141
142
|
|
142
|
-
g.desc '
|
143
|
-
g.long_desc %(
|
143
|
+
g.desc 'Sets the purpose for a private channel.'
|
144
|
+
g.long_desc %( Sets the purpose for a private channel. )
|
144
145
|
g.command 'setPurpose' do |c|
|
145
146
|
c.flag 'channel', desc: 'Private channel to set the purpose of.'
|
146
147
|
c.flag 'purpose', desc: 'The new purpose.'
|
@@ -149,8 +150,8 @@ command 'groups' do |g|
|
|
149
150
|
end
|
150
151
|
end
|
151
152
|
|
152
|
-
g.desc '
|
153
|
-
g.long_desc %(
|
153
|
+
g.desc 'Sets the topic for a private channel.'
|
154
|
+
g.long_desc %( Sets the topic for a private channel. )
|
154
155
|
g.command 'setTopic' do |c|
|
155
156
|
c.flag 'channel', desc: 'Private channel to set the topic of.'
|
156
157
|
c.flag 'topic', desc: 'The new topic.'
|
@@ -159,8 +160,8 @@ command 'groups' do |g|
|
|
159
160
|
end
|
160
161
|
end
|
161
162
|
|
162
|
-
g.desc '
|
163
|
-
g.long_desc %(
|
163
|
+
g.desc 'Unarchives a private channel.'
|
164
|
+
g.long_desc %( Unarchives a private channel. )
|
164
165
|
g.command 'unarchive' do |c|
|
165
166
|
c.flag 'channel', desc: 'Private channel to unarchive.'
|
166
167
|
c.action do |_global_options, options, _args|
|
data/bin/commands/im.rb
CHANGED
@@ -2,8 +2,8 @@
|
|
2
2
|
|
3
3
|
desc 'Get info on your direct messages.'
|
4
4
|
command 'im' do |g|
|
5
|
-
g.desc '
|
6
|
-
g.long_desc %(
|
5
|
+
g.desc 'Close a direct message channel.'
|
6
|
+
g.long_desc %( Close a direct message channel. )
|
7
7
|
g.command 'close' do |c|
|
8
8
|
c.flag 'channel', desc: 'Direct message channel to close.'
|
9
9
|
c.action do |_global_options, options, _args|
|
@@ -11,29 +11,29 @@ command 'im' do |g|
|
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
14
|
-
g.desc '
|
15
|
-
g.long_desc %(
|
14
|
+
g.desc 'Fetches history of messages and events from direct message channel.'
|
15
|
+
g.long_desc %( Fetches history of messages and events from direct message channel. )
|
16
16
|
g.command 'history' do |c|
|
17
17
|
c.flag 'channel', desc: 'Direct message channel to fetch history for.'
|
18
|
+
c.flag 'inclusive', desc: 'Include messages with latest or oldest timestamp in results.'
|
18
19
|
c.flag 'latest', desc: 'End of time range of messages to include in results.'
|
19
20
|
c.flag 'oldest', desc: 'Start of time range of messages to include in results.'
|
20
|
-
c.flag 'inclusive', desc: 'Include messages with latest or oldest timestamp in results.'
|
21
21
|
c.flag 'unreads', desc: 'Include unread_count_display in the output?.'
|
22
22
|
c.action do |_global_options, options, _args|
|
23
23
|
puts JSON.dump($client.im_history(options))
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
27
|
-
g.desc '
|
28
|
-
g.long_desc %(
|
27
|
+
g.desc 'Lists direct message channels for the calling user.'
|
28
|
+
g.long_desc %( Lists direct message channels for the calling user. )
|
29
29
|
g.command 'list' do |c|
|
30
30
|
c.action do |_global_options, options, _args|
|
31
31
|
puts JSON.dump($client.im_list(options))
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
35
|
-
g.desc '
|
36
|
-
g.long_desc %(
|
35
|
+
g.desc 'Sets the read cursor in a direct message channel.'
|
36
|
+
g.long_desc %( Sets the read cursor in a direct message channel. )
|
37
37
|
g.command 'mark' do |c|
|
38
38
|
c.flag 'channel', desc: 'Direct message channel to set reading cursor in.'
|
39
39
|
c.flag 'ts', desc: 'Timestamp of the most recently seen message.'
|
@@ -42,8 +42,8 @@ command 'im' do |g|
|
|
42
42
|
end
|
43
43
|
end
|
44
44
|
|
45
|
-
g.desc '
|
46
|
-
g.long_desc %(
|
45
|
+
g.desc 'Opens a direct message channel.'
|
46
|
+
g.long_desc %( Opens a direct message channel. )
|
47
47
|
g.command 'open' do |c|
|
48
48
|
c.flag 'user', desc: 'User to open a direct message channel with.'
|
49
49
|
c.flag 'return_im', desc: 'Boolean, indicates you want the full IM channel definition in the response.'
|
@@ -52,8 +52,8 @@ command 'im' do |g|
|
|
52
52
|
end
|
53
53
|
end
|
54
54
|
|
55
|
-
g.desc '
|
56
|
-
g.long_desc %(
|
55
|
+
g.desc 'Retrieve a thread of messages posted to a direct message conversation'
|
56
|
+
g.long_desc %( Retrieve a thread of messages posted to a direct message conversation )
|
57
57
|
g.command 'replies' do |c|
|
58
58
|
c.flag 'channel', desc: 'Direct message channel to fetch thread from.'
|
59
59
|
c.flag 'thread_ts', desc: "Unique identifier of a thread's parent message."
|
data/bin/commands/mpim.rb
CHANGED
@@ -2,8 +2,8 @@
|
|
2
2
|
|
3
3
|
desc 'Get info on your multiparty direct messages.'
|
4
4
|
command 'mpim' do |g|
|
5
|
-
g.desc '
|
6
|
-
g.long_desc %(
|
5
|
+
g.desc 'Closes a multiparty direct message channel.'
|
6
|
+
g.long_desc %( Closes a multiparty direct message channel. )
|
7
7
|
g.command 'close' do |c|
|
8
8
|
c.flag 'channel', desc: 'MPIM to close.'
|
9
9
|
c.action do |_global_options, options, _args|
|
@@ -11,29 +11,29 @@ command 'mpim' do |g|
|
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
14
|
-
g.desc '
|
15
|
-
g.long_desc %(
|
14
|
+
g.desc 'Fetches history of messages and events from a multiparty direct message.'
|
15
|
+
g.long_desc %( Fetches history of messages and events from a multiparty direct message. )
|
16
16
|
g.command 'history' do |c|
|
17
17
|
c.flag 'channel', desc: 'Multiparty direct message to fetch history for.'
|
18
|
+
c.flag 'inclusive', desc: 'Include messages with latest or oldest timestamp in results.'
|
18
19
|
c.flag 'latest', desc: 'End of time range of messages to include in results.'
|
19
20
|
c.flag 'oldest', desc: 'Start of time range of messages to include in results.'
|
20
|
-
c.flag 'inclusive', desc: 'Include messages with latest or oldest timestamp in results.'
|
21
21
|
c.flag 'unreads', desc: 'Include unread_count_display in the output?.'
|
22
22
|
c.action do |_global_options, options, _args|
|
23
23
|
puts JSON.dump($client.mpim_history(options))
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
27
|
-
g.desc '
|
28
|
-
g.long_desc %(
|
27
|
+
g.desc 'Lists multiparty direct message channels for the calling user.'
|
28
|
+
g.long_desc %( Lists multiparty direct message channels for the calling user. )
|
29
29
|
g.command 'list' do |c|
|
30
30
|
c.action do |_global_options, options, _args|
|
31
31
|
puts JSON.dump($client.mpim_list(options))
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
35
|
-
g.desc '
|
36
|
-
g.long_desc %(
|
35
|
+
g.desc 'Sets the read cursor in a multiparty direct message channel.'
|
36
|
+
g.long_desc %( Sets the read cursor in a multiparty direct message channel. )
|
37
37
|
g.command 'mark' do |c|
|
38
38
|
c.flag 'channel', desc: 'multiparty direct message channel to set reading cursor in.'
|
39
39
|
c.flag 'ts', desc: 'Timestamp of the most recently seen message.'
|
@@ -51,8 +51,8 @@ command 'mpim' do |g|
|
|
51
51
|
end
|
52
52
|
end
|
53
53
|
|
54
|
-
g.desc '
|
55
|
-
g.long_desc %(
|
54
|
+
g.desc 'Retrieve a thread of messages posted to a direct message conversation from a multiparty direct message.'
|
55
|
+
g.long_desc %( Retrieve a thread of messages posted to a direct message conversation from a multiparty direct message. )
|
56
56
|
g.command 'replies' do |c|
|
57
57
|
c.flag 'channel', desc: 'Multiparty direct message channel to fetch thread from.'
|
58
58
|
c.flag 'thread_ts', desc: "Unique identifier of a thread's parent message."
|
data/bin/commands/oauth.rb
CHANGED
@@ -2,8 +2,8 @@
|
|
2
2
|
|
3
3
|
desc 'Oauth methods.'
|
4
4
|
command 'oauth' do |g|
|
5
|
-
g.desc '
|
6
|
-
g.long_desc %(
|
5
|
+
g.desc 'Exchanges a temporary OAuth code for an API token.'
|
6
|
+
g.long_desc %( Exchanges a temporary OAuth code for an API token. )
|
7
7
|
g.command 'access' do |c|
|
8
8
|
c.flag 'client_id', desc: 'Issued when you created your application.'
|
9
9
|
c.flag 'client_secret', desc: 'Issued when you created your application.'
|
@@ -13,4 +13,17 @@ command 'oauth' do |g|
|
|
13
13
|
puts JSON.dump($client.oauth_access(options))
|
14
14
|
end
|
15
15
|
end
|
16
|
+
|
17
|
+
g.desc 'Exchanges a temporary OAuth verifier code for a workspace token.'
|
18
|
+
g.long_desc %( Exchanges a temporary OAuth verifier code for a workspace token. )
|
19
|
+
g.command 'token' do |c|
|
20
|
+
c.flag 'client_id', desc: 'Issued when you created your application.'
|
21
|
+
c.flag 'client_secret', desc: 'Issued when you created your application.'
|
22
|
+
c.flag 'code', desc: 'The code param returned via the OAuth callback.'
|
23
|
+
c.flag 'redirect_uri', desc: 'This must match the originally submitted URI (if one was sent).'
|
24
|
+
c.flag 'single_channel', desc: 'Request the user to add your app only to a single channel.'
|
25
|
+
c.action do |_global_options, options, _args|
|
26
|
+
puts JSON.dump($client.oauth_token(options))
|
27
|
+
end
|
28
|
+
end
|
16
29
|
end
|