slack-ruby-client 0.16.0 → 0.17.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +11 -3
  3. data/LICENSE.md +1 -1
  4. data/README.md +8 -8
  5. data/bin/commands.rb +0 -1
  6. data/bin/commands/admin_analytics.rb +2 -1
  7. data/bin/commands/admin_conversations.rb +0 -10
  8. data/bin/commands/admin_teams.rb +1 -1
  9. data/bin/commands/channels.rb +0 -157
  10. data/bin/commands/chat.rb +8 -6
  11. data/bin/commands/conversations.rb +2 -2
  12. data/bin/commands/dnd.rb +2 -0
  13. data/bin/commands/groups.rb +0 -163
  14. data/bin/commands/im.rb +0 -62
  15. data/bin/commands/mpim.rb +0 -60
  16. data/lib/slack/events/request.rb +2 -2
  17. data/lib/slack/real_time/config.rb +3 -13
  18. data/lib/slack/version.rb +1 -1
  19. data/lib/slack/web/api/endpoints.rb +0 -2
  20. data/lib/slack/web/api/endpoints/admin_analytics.rb +3 -1
  21. data/lib/slack/web/api/endpoints/admin_conversations.rb +0 -14
  22. data/lib/slack/web/api/endpoints/admin_teams.rb +1 -1
  23. data/lib/slack/web/api/endpoints/channels.rb +0 -265
  24. data/lib/slack/web/api/endpoints/chat.rb +11 -7
  25. data/lib/slack/web/api/endpoints/conversations.rb +2 -2
  26. data/lib/slack/web/api/endpoints/dnd.rb +4 -0
  27. data/lib/slack/web/api/endpoints/groups.rb +0 -273
  28. data/lib/slack/web/api/endpoints/im.rb +0 -107
  29. data/lib/slack/web/api/endpoints/mpim.rb +0 -102
  30. data/lib/slack/web/api/errors.rb +14 -16
  31. data/lib/slack/web/api/patches/chat.1.patch +5 -6
  32. data/lib/slack/web/faraday/connection.rb +1 -1
  33. data/lib/slack/web/faraday/response/raise_error.rb +0 -4
  34. data/lib/slack/web/faraday/response/wrap_error.rb +11 -5
  35. data/lib/tasks/web.rake +4 -0
  36. data/spec/fixtures/slack/web/{groups_info.yml → conversations_info.yml} +4 -4
  37. data/spec/slack/events/request_spec.rb +6 -5
  38. data/spec/slack/real_time/concurrency/with_concurrency_spec.rb +10 -0
  39. data/spec/slack/real_time/concurrency/without_concurrency_spec.rb +10 -0
  40. data/spec/slack/real_time/rtm_connect_spec.rb +1 -1
  41. data/spec/slack/real_time/rtm_start_spec.rb +1 -1
  42. data/spec/slack/web/api/endpoints/admin_conversations_spec.rb +0 -5
  43. data/spec/slack/web/api/endpoints/custom_specs/conversations_spec.rb +13 -0
  44. data/spec/slack/web/api/endpoints/im_spec.rb +0 -31
  45. data/spec/slack/web/api/endpoints/mpim_spec.rb +0 -31
  46. data/spec/slack/web/client_spec.rb +15 -20
  47. metadata +10 -12
  48. data/spec/slack/web/api/endpoints/admin_conversations_whitelist_spec.rb +0 -32
  49. data/spec/slack/web/api/endpoints/custom_specs/channels_spec.rb +0 -13
  50. data/spec/slack/web/api/endpoints/custom_specs/groups_spec.rb +0 -13
  51. data/spec/slack/web/api/endpoints/views_spec.rb +0 -29
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 46bfdecfe74d4f64a551519516ce706fbd50d7e8f512df2f10cf991f4c3d153a
4
- data.tar.gz: 8f8330671c68f4937026b7bf211eb623a5a4f03ac704fb2465c5ad70833ce610
3
+ metadata.gz: 568ad92dd27f6edd04fc00905af2a928c9f03f2d08105637b9ffc9f01319eaa3
4
+ data.tar.gz: 579f9004c9b1b9e3608bb2b59e55f0d09f0dbcba6761ad8035e367d4b9f06f4f
5
5
  SHA512:
6
- metadata.gz: b4eca0d30990e29c93ec5e2063cdfb7c9cbc9e0f4c23fe566b64af1c23dd2bc3dc2690937b43f9fb771035425fde4d023c29180592b01513a2d8a3ac4731511b
7
- data.tar.gz: ca8c4a73812d77fe3b8bef823b2b7b1fa890c8efdab14a0bfa9094b5c171632f0ce33fb79493fc8444a21605397b63a38f4e890b1736afd74cfd14117a4dddcb
6
+ metadata.gz: ab4943fb7a0bf3e1a75141943ee97324dfded3c6e5d691fc1ffa939c43c82f105f4763fed7496f45a1bf1b2b119ffeefa272df484d0e46bcb6f000cbd0906a78
7
+ data.tar.gz: '0857c64cf4544b3c0b744662ba38f94daad70b38069334a7b59beb4cf0999a47c9ec19e225a899f01e9cfd6c2336823e26b97ba0fce1ebbd498585952fec305d'
data/CHANGELOG.md CHANGED
@@ -1,9 +1,17 @@
1
+ ### 0.17.0 (2021/03/07)
2
+
3
+ * [#370](https://github.com/slack-ruby/slack-ruby-client/pull/370): Removed deprecated `im_`, `mpim_`, `channels_`, and `groups_` methods - [@dblock](https://github.com/dblock).
4
+ * [#368](https://github.com/slack-ruby/slack-ruby-client/pull/368): Removed `admin_conversations_whitelist` and `admin_conversations_disconnectShared` - [@dblock](https://github.com/dblock).
5
+ * [#359](https://github.com/slack-ruby/slack-ruby-client/pull/359): Handle non-JSON 500 errors - [@agrobbin](https://github.com/agrobbin).
6
+ * [#360](https://github.com/slack-ruby/slack-ruby-client/pull/360): Remove faye-websocket from the concurrency detection error message - [@dblock](https://github.com/dblock).
7
+ * [#369](https://github.com/slack-ruby/slack-ruby-client/pull/369): Support rack requests in `Slack::Events::Request` - [@wedgex](https://github.com/wedgex).
8
+
1
9
  ### 0.16.0 (2021/01/24)
2
10
 
3
- * [#350](https://github.com/slack-ruby/slack-ruby-client/pull/350): Handle server errors such as timouts & non-json responses (see [Upgrading to 0.16.0](UPGRADING.md#upgrading-to--0160)) - [@ojab](https://github.com/ojab).
11
+ * [#350](https://github.com/slack-ruby/slack-ruby-client/pull/350): Handle server errors such as timeouts & non-JSON responses - [@ojab](https://github.com/ojab).
4
12
  * [#354](https://github.com/slack-ruby/slack-ruby-client/pull/354): Rewind body after checking request signature - [@sunny](https://github.com/sunny).
5
- * [#355](https://github.com/slack-ruby/slack-ruby-client/pull/355), [#357](https://github.com/slack-ruby/slack-ruby-client/pull/357): Removed celluloid and faye-websocket support - [@wasabigeek](https://github.com/wasabigeek).
6
- * [#356](https://github.com/slack-ruby/slack-ruby-client/pull/356): Added `admin_apps_clearResolution`, `admin_conversations_getCustomRetention`, `admin_conversations_removeCustomRetention`, `admin_conversations_setCustomRetention` and `admin_users_session_list` endpoints - [@dblock](https://github.com/dblock).
13
+ * [#355](https://github.com/slack-ruby/slack-ruby-client/pull/355), [#357](https://github.com/slack-ruby/slack-ruby-client/pull/357): Removed `celluloid-io` and `faye-websocket` support - [@wasabigeek](https://github.com/wasabigeek).
14
+ * [#356](https://github.com/slack-ruby/slack-ruby-client/pull/356): Added `admin_apps_clearResolution`, `admin_conversations_getCustomRetention`, `admin_conversations_removeCustomRetention`, `admin_conversations_setCustomRetention`, `admin_users_session_list` and `auth_teams_list` endpoints - [@dblock](https://github.com/dblock).
7
15
  * [#348](https://github.com/slack-ruby/slack-ruby-client/pull/348): Added `admin_conversations_archive`, `admin_conversations_convertToPrivate`, `admin_conversations_create`, `admin_conversations_delete`, `admin_conversations_disconnectShared`, `admin_conversations_getConversationPrefs`, `admin_conversations_getTeams`, `admin_conversations_invite`, `admin_conversations_rename`, `admin_conversations_search`, `admin_conversations_setConversationPrefs`, `admin_conversations_unarchive`, `admin_conversations_ekm_listOriginalConnectedChannelInfo`, `admin_users_session_invalidate`, `apps_event_authorizations_list`, `conversations_mark`, `workflows_stepCompleted`, `workflows_stepFailed` and `workflows_updateStep` endpoints - [@wasabigeek](https://github.com/wasabigeek).
8
16
 
9
17
  ### 0.15.1 (2020/9/3)
data/LICENSE.md CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2015-2019 Daniel Doubrovkine, Artsy and Contributors
3
+ Copyright (c) 2015-2021 Daniel Doubrovkine, Artsy and Contributors
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining
6
6
  a copy of this software and associated documentation files (the
data/README.md CHANGED
@@ -70,7 +70,7 @@ A Ruby client for the Slack [Web](https://api.slack.com/web), [RealTime Messagin
70
70
 
71
71
  ## Stable Release
72
72
 
73
- You're reading the documentation for the **stable** release of slack-ruby-client, 0.16.0. See [UPGRADING](UPGRADING.md) when upgrading from an older version.
73
+ You're reading the documentation for the **stable** release of slack-ruby-client, 0.17.0. See [UPGRADING](UPGRADING.md) when upgrading from an older version.
74
74
 
75
75
  ## Installation
76
76
 
@@ -150,10 +150,10 @@ See a fully working example in [examples/hi_web](examples/hi_web/hi.rb).
150
150
 
151
151
  ##### List Channels
152
152
 
153
- List channels with [channels_list](https://api.slack.com/methods/channels.list).
153
+ List channels with [conversations_list](https://api.slack.com/methods/conversations.list).
154
154
 
155
155
  ```ruby
156
- channels = client.channels_list.channels
156
+ channels = client.conversations_list.channels
157
157
 
158
158
  general_channel = channels.detect { |c| c.name == 'general' }
159
159
  ```
@@ -175,14 +175,14 @@ client.files_upload(
175
175
 
176
176
  ##### Get Channel Info
177
177
 
178
- You can use a channel ID or name (prefixed with `#`) in all functions that take a `:channel` argument. Lookup by name is not supported by the Slack API and the `channels_id` method called invokes `channels_list` in order to locate the channel ID.
178
+ You can use a channel ID or name (prefixed with `#`) in all functions that take a `:channel` argument. Lookup by name is not supported by the Slack API and the `channels_id` method called invokes `conversations_list` in order to locate the channel ID.
179
179
 
180
180
  ```ruby
181
- client.channels_info(channel: 'C04KB5X4D') # calls channels_info
181
+ client.conversations_info(channel: 'C04KB5X4D') # calls conversations_info
182
182
  ```
183
183
 
184
184
  ```ruby
185
- client.channels_info(channel: '#general') # calls channels_list followed by channels_info
185
+ client.conversations_info(channel: '#general') # calls conversations_list followed by conversations_info
186
186
  ```
187
187
 
188
188
  ##### Get User Info
@@ -243,7 +243,7 @@ adapter | Optional HTTP adapter to use, defaults to `Faraday.default
243
243
  You can also pass request options, including `timeout` and `open_timeout` into individual calls.
244
244
 
245
245
  ```ruby
246
- client.channels_list(request: { timeout: 180 })
246
+ client.conversations_list(request: { timeout: 180 })
247
247
  ```
248
248
 
249
249
  You can also control what proxy options are used by modifying the `http_proxy` environment variable per [Net::HTTP's documentation](https://docs.ruby-lang.org/en/2.0.0/Net/HTTP.html#class-Net::HTTP-label-Proxies).
@@ -646,6 +646,6 @@ See [CONTRIBUTING](CONTRIBUTING.md).
646
646
 
647
647
  ## Copyright and License
648
648
 
649
- Copyright (c) 2015-2019, [Daniel Doubrovkine](https://twitter.com/dblockdotorg), [Artsy](https://www.artsy.net) and [Contributors](CHANGELOG.md).
649
+ Copyright (c) 2015-2021, [Daniel Doubrovkine](https://twitter.com/dblockdotorg), [Artsy](https://www.artsy.net) and [Contributors](CHANGELOG.md).
650
650
 
651
651
  This project is licensed under the [MIT License](LICENSE.md).
data/bin/commands.rb CHANGED
@@ -10,7 +10,6 @@ require 'commands/admin_barriers'
10
10
  require 'commands/admin_conversations'
11
11
  require 'commands/admin_conversations_ekm'
12
12
  require 'commands/admin_conversations_restrictAccess'
13
- require 'commands/admin_conversations_whitelist'
14
13
  require 'commands/admin_emoji'
15
14
  require 'commands/admin_inviteRequests'
16
15
  require 'commands/admin_inviteRequests_approved'
@@ -6,8 +6,9 @@ command 'admin_analytics' do |g|
6
6
  g.desc 'Retrieve analytics data for a given date, presented as a compressed JSON file'
7
7
  g.long_desc %( Retrieve analytics data for a given date, presented as a compressed JSON file )
8
8
  g.command 'getFile' do |c|
9
- c.flag 'type', desc: 'The type of analytics to retrieve. The options are currently limited to member.'
9
+ c.flag 'type', desc: 'The type of analytics to retrieve. The options are currently limited to member (for grid member analytics) and public_channel (for public channel analytics).'
10
10
  c.flag 'date', desc: 'Date to retrieve the analytics data for, expressed as YYYY-MM-DD in UTC.'
11
+ c.flag 'metadata_only', desc: 'Retrieve metadata for the type of analytics indicated. Can be used only with type set to public_channel analytics. See detail below. Omit the date parameter when using this argument.'
11
12
  c.action do |_global_options, options, _args|
12
13
  puts JSON.dump($client.admin_analytics_getFile(options))
13
14
  end
@@ -43,16 +43,6 @@ command 'admin_conversations' do |g|
43
43
  end
44
44
  end
45
45
 
46
- g.desc 'Disconnect a connected channel from one or more workspaces.'
47
- g.long_desc %( Disconnect a connected channel from one or more workspaces. )
48
- g.command 'disconnectShared' do |c|
49
- c.flag 'channel_id', desc: 'The channel to be disconnected from some workspaces.'
50
- c.flag 'leaving_team_ids', desc: 'The team to be removed from the channel. Currently only a single team id can be specified.'
51
- c.action do |_global_options, options, _args|
52
- puts JSON.dump($client.admin_conversations_disconnectShared(options))
53
- end
54
- end
55
-
56
46
  g.desc 'Get conversation preferences for a public or private channel.'
57
47
  g.long_desc %( Get conversation preferences for a public or private channel. )
58
48
  g.command 'getConversationPrefs' do |c|
@@ -6,7 +6,7 @@ command 'admin_teams' do |g|
6
6
  g.desc 'Create an Enterprise team.'
7
7
  g.long_desc %( Create an Enterprise team. )
8
8
  g.command 'create' do |c|
9
- c.flag 'team_domain', desc: 'Team domain (for example, slacksoftballteam).'
9
+ c.flag 'team_domain', desc: 'Team domain (for example, slacksoftballteam). Domains are limited to 21 characters.'
10
10
  c.flag 'team_name', desc: 'Team name (for example, Slack Softball Team).'
11
11
  c.flag 'team_description', desc: 'Description for the team.'
12
12
  c.flag 'team_discoverability', desc: "Who can join the team. A team's discoverability can be open, closed, invite_only, or unlisted."
@@ -3,26 +3,6 @@
3
3
 
4
4
  desc "Get info on your team's Slack channels, create or archive channels, invite users, set the topic and purpose, and mark a channel as read."
5
5
  command 'channels' do |g|
6
- g.desc 'Archives a channel.'
7
- g.long_desc %( Archives a channel. )
8
- g.command 'archive' do |c|
9
- c.flag 'channel', desc: 'Channel to archive.'
10
- c.action do |_global_options, options, _args|
11
- puts JSON.dump($client.channels_archive(options))
12
- end
13
- end
14
-
15
- g.desc 'Creates a channel.'
16
- g.long_desc %( Creates a channel. )
17
- g.command 'create' do |c|
18
- c.flag 'name', desc: 'Name of channel to create.'
19
- c.flag 'team_id', desc: 'encoded team id to create the channel in, required if org token is used.'
20
- c.flag 'validate', desc: 'Whether to return errors on invalid channel name instead of modifying it to meet the specified criteria.'
21
- c.action do |_global_options, options, _args|
22
- puts JSON.dump($client.channels_create(options))
23
- end
24
- end
25
-
26
6
  g.desc 'Delete a channel (undocumented)'
27
7
  g.long_desc %( Delete a channel )
28
8
  g.command 'delete' do |c|
@@ -32,19 +12,6 @@ command 'channels' do |g|
32
12
  end
33
13
  end
34
14
 
35
- g.desc 'Fetches history of messages and events from a channel.'
36
- g.long_desc %( Fetches history of messages and events from a channel. )
37
- g.command 'history' do |c|
38
- c.flag 'channel', desc: 'Channel to fetch history for.'
39
- c.flag 'inclusive', desc: 'Include messages with latest or oldest timestamp in results.'
40
- c.flag 'latest', desc: 'End of time range of messages to include in results.'
41
- c.flag 'oldest', desc: 'Start of time range of messages to include in results.'
42
- c.flag 'unreads', desc: 'Include unread_count_display in the output?.'
43
- c.action do |_global_options, options, _args|
44
- puts JSON.dump($client.channels_history(options))
45
- end
46
- end
47
-
48
15
  g.desc 'This method returns the ID of a team channel.'
49
16
  g.long_desc %( This method returns the ID of a team channel. )
50
17
  g.command 'id' do |c|
@@ -53,128 +20,4 @@ command 'channels' do |g|
53
20
  puts JSON.dump($client.channels_id(options))
54
21
  end
55
22
  end
56
-
57
- g.desc 'Gets information about a channel.'
58
- g.long_desc %( Gets information about a channel. )
59
- g.command 'info' do |c|
60
- c.flag 'channel', desc: 'Channel to get info on.'
61
- c.flag 'include_locale', desc: 'Set this to true to receive the locale for this channel. Defaults to false.'
62
- c.action do |_global_options, options, _args|
63
- puts JSON.dump($client.channels_info(options))
64
- end
65
- end
66
-
67
- g.desc 'Invites a user to a channel.'
68
- g.long_desc %( Invites a user to a channel. )
69
- g.command 'invite' do |c|
70
- c.flag 'channel', desc: 'Channel to invite user to.'
71
- c.flag 'user', desc: 'User to invite to channel.'
72
- c.action do |_global_options, options, _args|
73
- puts JSON.dump($client.channels_invite(options))
74
- end
75
- end
76
-
77
- g.desc 'Joins a channel, creating it if needed.'
78
- g.long_desc %( Joins a channel, creating it if needed. )
79
- g.command 'join' do |c|
80
- c.flag 'name', desc: 'Name of channel to join.'
81
- c.flag 'team_id', desc: 'encoded team id to list channels in, required if org token is used.'
82
- c.flag 'validate', desc: 'Whether to return errors on invalid channel name instead of modifying it to meet the specified criteria.'
83
- c.action do |_global_options, options, _args|
84
- puts JSON.dump($client.channels_join(options))
85
- end
86
- end
87
-
88
- g.desc 'Removes a user from a channel.'
89
- g.long_desc %( Removes a user from a channel. )
90
- g.command 'kick' do |c|
91
- c.flag 'channel', desc: 'Channel to remove user from.'
92
- c.flag 'user', desc: 'User to remove from channel.'
93
- c.action do |_global_options, options, _args|
94
- puts JSON.dump($client.channels_kick(options))
95
- end
96
- end
97
-
98
- g.desc 'Leaves a channel.'
99
- g.long_desc %( Leaves a channel. )
100
- g.command 'leave' do |c|
101
- c.flag 'channel', desc: 'Channel to leave.'
102
- c.action do |_global_options, options, _args|
103
- puts JSON.dump($client.channels_leave(options))
104
- end
105
- end
106
-
107
- g.desc 'Lists all channels in a Slack team.'
108
- g.long_desc %( Lists all channels in a Slack team. )
109
- g.command 'list' do |c|
110
- c.flag 'cursor', desc: "Paginate through collections of data by setting the cursor parameter to a next_cursor attribute returned by a previous request's response_metadata. Default value fetches the first 'page' of the collection. See pagination for more detail."
111
- c.flag 'exclude_archived', desc: 'Exclude archived channels from the list.'
112
- c.flag 'exclude_members', desc: 'Exclude the members collection from each channel.'
113
- c.flag 'limit', desc: "The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the users list hasn't been reached."
114
- c.flag 'team_id', desc: 'encoded team id to list channels in, required if org token is used.'
115
- c.action do |_global_options, options, _args|
116
- puts JSON.dump($client.channels_list(options))
117
- end
118
- end
119
-
120
- g.desc 'Sets the read cursor in a channel.'
121
- g.long_desc %( Sets the read cursor in a channel. )
122
- g.command 'mark' do |c|
123
- c.flag 'channel', desc: 'Channel or conversation to set the read cursor for.'
124
- c.flag 'ts', desc: 'Unique identifier of message you want marked as most recently seen in this conversation.'
125
- c.action do |_global_options, options, _args|
126
- puts JSON.dump($client.channels_mark(options))
127
- end
128
- end
129
-
130
- g.desc 'Renames a channel.'
131
- g.long_desc %( Renames a channel. )
132
- g.command 'rename' do |c|
133
- c.flag 'channel', desc: 'Channel to rename.'
134
- c.flag 'name', desc: 'New name for channel.'
135
- c.flag 'validate', desc: 'Whether to return errors on invalid channel name instead of modifying it to meet the specified criteria.'
136
- c.action do |_global_options, options, _args|
137
- puts JSON.dump($client.channels_rename(options))
138
- end
139
- end
140
-
141
- g.desc 'Retrieve a thread of messages posted to a channel'
142
- g.long_desc %( Retrieve a thread of messages posted to a channel )
143
- g.command 'replies' do |c|
144
- c.flag 'channel', desc: 'Channel to fetch thread from.'
145
- c.flag 'thread_ts', desc: "Unique identifier of a thread's parent message."
146
- c.action do |_global_options, options, _args|
147
- puts JSON.dump($client.channels_replies(options))
148
- end
149
- end
150
-
151
- g.desc 'Sets the purpose for a channel.'
152
- g.long_desc %( Sets the purpose for a channel. )
153
- g.command 'setPurpose' do |c|
154
- c.flag 'channel', desc: 'Channel to set the purpose of.'
155
- c.flag 'purpose', desc: 'The new purpose.'
156
- c.flag 'name_tagging', desc: 'if it is true, treat this like a message and not an unescaped thing.'
157
- c.action do |_global_options, options, _args|
158
- puts JSON.dump($client.channels_setPurpose(options))
159
- end
160
- end
161
-
162
- g.desc 'Sets the topic for a channel.'
163
- g.long_desc %( Sets the topic for a channel. )
164
- g.command 'setTopic' do |c|
165
- c.flag 'channel', desc: 'Channel to set the topic of.'
166
- c.flag 'topic', desc: 'The new topic.'
167
- c.action do |_global_options, options, _args|
168
- puts JSON.dump($client.channels_setTopic(options))
169
- end
170
- end
171
-
172
- g.desc 'Unarchives a channel.'
173
- g.long_desc %( Unarchives a channel. )
174
- g.command 'unarchive' do |c|
175
- c.flag 'channel', desc: 'Channel to unarchive.'
176
- c.action do |_global_options, options, _args|
177
- puts JSON.dump($client.channels_unarchive(options))
178
- end
179
- end
180
23
  end
data/bin/commands/chat.rb CHANGED
@@ -80,20 +80,21 @@ command 'chat' do |g|
80
80
  g.long_desc %( Sends a message to a channel. )
81
81
  g.command 'postMessage' do |c|
82
82
  c.flag 'channel', desc: 'Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name. See below for more details.'
83
- c.flag 'text', desc: 'How this field works and whether it is required depends on other fields you use in your API call. See below for more detail.'
84
- c.flag 'as_user', desc: 'Pass true to post the message as the authed user, instead of as a bot. Defaults to false. See authorship below. This argument may not be used with newer bot tokens.'
83
+ c.flag 'as_user', desc: 'Pass true to post the message as the authed user, instead of as a bot. Defaults to false. See authorship below.'
85
84
  c.flag 'attachments', desc: 'A JSON-based array of structured attachments, presented as a URL-encoded string.'
86
85
  c.flag 'blocks', desc: 'A JSON-based array of structured blocks, presented as a URL-encoded string.'
87
- c.flag 'icon_emoji', desc: 'Emoji to use as the icon for this message. Overrides icon_url. See authorship below. Use with bot tokens requires chat:write.customize.'
88
- c.flag 'icon_url', desc: 'URL to an image to use as the icon for this message. See authorship below. Use with bot tokens requires chat:write.customize.'
86
+ c.flag 'draft_id', desc: 'The id of the draft associated with the message.'
87
+ c.flag 'icon_emoji', desc: 'Emoji to use as the icon for this message. Overrides icon_url. Must be used in conjunction with as_user set to false, otherwise ignored. See authorship below.'
88
+ c.flag 'icon_url', desc: 'URL to an image to use as the icon for this message. Must be used in conjunction with as_user set to false, otherwise ignored. See authorship below.'
89
89
  c.flag 'link_names', desc: 'Find and link channel names and usernames.'
90
90
  c.flag 'mrkdwn', desc: 'Disable Slack markup parsing by setting to false. Enabled by default.'
91
91
  c.flag 'parse', desc: 'Change how messages are treated. Defaults to none. See below.'
92
92
  c.flag 'reply_broadcast', desc: 'Used in conjunction with thread_ts and indicates whether reply should be made visible to everyone in the channel or conversation. Defaults to false.'
93
+ c.flag 'text', desc: 'How this field works and whether it is required depends on other fields you use in your API call. See below for more detail.'
93
94
  c.flag 'thread_ts', desc: "Provide another message's ts value to make this message a reply. Avoid using a reply's ts value; use its parent instead."
94
95
  c.flag 'unfurl_links', desc: 'Pass true to enable unfurling of primarily text-based content.'
95
96
  c.flag 'unfurl_media', desc: 'Pass false to disable unfurling of media content.'
96
- c.flag 'username', desc: "Set your bot's user name. See authorship below. Use with bot tokens requires chat:write.customize."
97
+ c.flag 'username', desc: "Set your bot's user name. Must be used in conjunction with as_user set to false, otherwise ignored. See authorship below."
97
98
  c.action do |_global_options, options, _args|
98
99
  puts JSON.dump($client.chat_postMessage(options))
99
100
  end
@@ -125,7 +126,8 @@ command 'chat' do |g|
125
126
  c.flag 'channel', desc: 'Channel ID of the message.'
126
127
  c.flag 'ts', desc: 'Timestamp of the message to add unfurl behavior to.'
127
128
  c.flag 'unfurls', desc: 'URL-encoded JSON map with keys set to URLs featured in the the message, pointing to their unfurl blocks or message attachments.'
128
- c.flag 'user_auth_message', desc: 'Provide a simply-formatted string to send as an ephemeral message to the user as invitation to authenticate further and enable full unfurling behavior.'
129
+ c.flag 'user_auth_blocks', desc: 'Provide a JSON based array of structured blocks presented as URL-encoded string to send as an ephemeral message to the user as invitation to authenticate further and enable full unfurling behavior.'
130
+ c.flag 'user_auth_message', desc: 'Provide a simply-formatted string to send as an ephemeral message to the user as invitation to authenticate further and enable full unfurling behavior. Provides two buttons, Not now or Never ask me again.'
129
131
  c.flag 'user_auth_required', desc: 'Set to true or 1 to indicate the user must install your Slack app to trigger unfurls for this domain.'
130
132
  c.flag 'user_auth_url', desc: 'Send users to this custom URL where they will complete authentication in your app to fully trigger unfurling. Value should be properly URL-encoded.'
131
133
  c.action do |_global_options, options, _args|
@@ -101,7 +101,7 @@ command 'conversations' do |g|
101
101
  c.flag 'cursor', desc: "Paginate through collections of data by setting the cursor parameter to a next_cursor attribute returned by a previous request's response_metadata. Default value fetches the first 'page' of the collection. See pagination for more detail."
102
102
  c.flag 'exclude_archived', desc: 'Set to true to exclude archived channels from the list.'
103
103
  c.flag 'limit', desc: "The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the list hasn't been reached. Must be an integer no larger than 1000."
104
- c.flag 'team_id', desc: 'encoded team id to list channels in, required if org token is used.'
104
+ c.flag 'team_id', desc: 'encoded team id to list channels in, required if token belongs to org-wide app.'
105
105
  c.flag 'types', desc: 'Mix and match channel types by providing a comma-separated list of any combination of public_channel, private_channel, mpim, im.'
106
106
  c.action do |_global_options, options, _args|
107
107
  puts JSON.dump($client.conversations_list(options))
@@ -154,7 +154,7 @@ command 'conversations' do |g|
154
154
  g.long_desc %( Retrieve a thread of messages posted to a conversation )
155
155
  g.command 'replies' do |c|
156
156
  c.flag 'channel', desc: 'Conversation ID to fetch thread from.'
157
- c.flag 'ts', desc: "Unique identifier of a thread's parent message. ts must be the timestamp of an existing message with 0 or more replies. If there are no replies then just the single message referenced by ts will return - it is just an ordinary, unthreaded message."
157
+ c.flag 'ts', desc: "Unique identifier of either a thread's parent message or a message in the thread. ts must be the timestamp of an existing message with 0 or more replies. If there are no replies then just the single message referenced by ts will return - it is just an ordinary, unthreaded message."
158
158
  c.flag 'cursor', desc: "Paginate through collections of data by setting the cursor parameter to a next_cursor attribute returned by a previous request's response_metadata. Default value fetches the first 'page' of the collection. See pagination for more detail."
159
159
  c.flag 'inclusive', desc: 'Include messages with latest or oldest timestamp in results only when either timestamp is specified.'
160
160
  c.flag 'latest', desc: 'End of time range of messages to include in results.'
data/bin/commands/dnd.rb CHANGED
@@ -22,6 +22,7 @@ command 'dnd' do |g|
22
22
  g.desc "Retrieves a user's current Do Not Disturb status."
23
23
  g.long_desc %( Retrieves a user's current Do Not Disturb status. )
24
24
  g.command 'info' do |c|
25
+ c.flag 'team_id', desc: 'Encoded team id where passed in user param belongs, required if org token is used. If no user param is passed, then a team which has access to the app should be passed.'
25
26
  c.flag 'user', desc: 'User to fetch status for (defaults to current user).'
26
27
  c.action do |_global_options, options, _args|
27
28
  puts JSON.dump($client.dnd_info(options))
@@ -41,6 +42,7 @@ command 'dnd' do |g|
41
42
  g.long_desc %( Retrieves the Do Not Disturb status for up to 50 users on a team. )
42
43
  g.command 'teamInfo' do |c|
43
44
  c.flag 'users', desc: 'Comma-separated list of users to fetch Do Not Disturb status for.'
45
+ c.flag 'team_id', desc: 'Encoded team id where passed in users belong, required if org token is used.'
44
46
  c.action do |_global_options, options, _args|
45
47
  puts JSON.dump($client.dnd_teamInfo(options))
46
48
  end
@@ -3,48 +3,6 @@
3
3
 
4
4
  desc "Get info on your team's private channels."
5
5
  command 'groups' do |g|
6
- g.desc 'Archives a private channel.'
7
- g.long_desc %( Archives a private channel. )
8
- g.command 'archive' do |c|
9
- c.flag 'channel', desc: 'Private channel to archive.'
10
- c.action do |_global_options, options, _args|
11
- puts JSON.dump($client.groups_archive(options))
12
- end
13
- end
14
-
15
- g.desc 'Creates a private channel.'
16
- g.long_desc %( Creates a private channel. )
17
- g.command 'create' do |c|
18
- c.flag 'name', desc: 'Name of private channel to create.'
19
- c.flag 'team_id', desc: 'encoded team id to create the channel in, required if org token is used.'
20
- c.flag 'validate', desc: 'Whether to return errors on invalid channel name instead of modifying it to meet the specified criteria.'
21
- c.action do |_global_options, options, _args|
22
- puts JSON.dump($client.groups_create(options))
23
- end
24
- end
25
-
26
- g.desc 'Clones and archives a private channel.'
27
- g.long_desc %( Clones and archives a private channel. )
28
- g.command 'createChild' do |c|
29
- c.flag 'channel', desc: 'Private channel to clone and archive.'
30
- c.action do |_global_options, options, _args|
31
- puts JSON.dump($client.groups_createChild(options))
32
- end
33
- end
34
-
35
- g.desc 'Fetches history of messages and events from a private channel.'
36
- g.long_desc %( Fetches history of messages and events from a private channel. )
37
- g.command 'history' do |c|
38
- c.flag 'channel', desc: 'Private channel to fetch history for.'
39
- c.flag 'inclusive', desc: 'Include messages with latest or oldest timestamp in results.'
40
- c.flag 'latest', desc: 'End of time range of messages to include in results.'
41
- c.flag 'oldest', desc: 'Start of time range of messages to include in results.'
42
- c.flag 'unreads', desc: 'Include unread_count_display in the output?.'
43
- c.action do |_global_options, options, _args|
44
- puts JSON.dump($client.groups_history(options))
45
- end
46
- end
47
-
48
6
  g.desc 'This method returns the ID of a group.'
49
7
  g.long_desc %( This method returns the ID of a group. )
50
8
  g.command 'id' do |c|
@@ -53,125 +11,4 @@ command 'groups' do |g|
53
11
  puts JSON.dump($client.groups_id(options))
54
12
  end
55
13
  end
56
-
57
- g.desc 'Gets information about a private channel.'
58
- g.long_desc %( Gets information about a private channel. )
59
- g.command 'info' do |c|
60
- c.flag 'channel', desc: 'Private channel to get info on.'
61
- c.flag 'include_locale', desc: 'Set this to true to receive the locale for this group. Defaults to false.'
62
- c.action do |_global_options, options, _args|
63
- puts JSON.dump($client.groups_info(options))
64
- end
65
- end
66
-
67
- g.desc 'Invites a user to a private channel.'
68
- g.long_desc %( Invites a user to a private channel. )
69
- g.command 'invite' do |c|
70
- c.flag 'channel', desc: 'Private channel to invite user to.'
71
- c.flag 'user', desc: 'User to invite.'
72
- c.action do |_global_options, options, _args|
73
- puts JSON.dump($client.groups_invite(options))
74
- end
75
- end
76
-
77
- g.desc 'Removes a user from a private channel.'
78
- g.long_desc %( Removes a user from a private channel. )
79
- g.command 'kick' do |c|
80
- c.flag 'channel', desc: 'Private channel to remove user from.'
81
- c.flag 'user', desc: 'User to remove from private channel.'
82
- c.action do |_global_options, options, _args|
83
- puts JSON.dump($client.groups_kick(options))
84
- end
85
- end
86
-
87
- g.desc 'Leaves a private channel.'
88
- g.long_desc %( Leaves a private channel. )
89
- g.command 'leave' do |c|
90
- c.flag 'channel', desc: 'Private channel to leave.'
91
- c.action do |_global_options, options, _args|
92
- puts JSON.dump($client.groups_leave(options))
93
- end
94
- end
95
-
96
- g.desc 'Lists private channels that the calling user has access to.'
97
- g.long_desc %( Lists private channels that the calling user has access to. )
98
- g.command 'list' do |c|
99
- c.flag 'cursor', desc: "Parameter for pagination. Set cursor equal to the next_cursor attribute returned by the previous request's response_metadata. This parameter is optional, but pagination is mandatory: the default value simply fetches the first 'page' of the collection. See pagination for more details."
100
- c.flag 'exclude_archived', desc: "Don't return archived private channels."
101
- c.flag 'exclude_members', desc: 'Exclude the members from each group.'
102
- c.flag 'limit', desc: "The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the list hasn't been reached."
103
- c.flag 'team_id', desc: 'encoded team id to list channels in, required if org token is used.'
104
- c.action do |_global_options, options, _args|
105
- puts JSON.dump($client.groups_list(options))
106
- end
107
- end
108
-
109
- g.desc 'Sets the read cursor in a private channel.'
110
- g.long_desc %( Sets the read cursor in a private channel. )
111
- g.command 'mark' do |c|
112
- c.flag 'channel', desc: 'Channel or conversation to set the read cursor for.'
113
- c.flag 'ts', desc: 'Unique identifier of message you want marked as most recently seen in this conversation.'
114
- c.action do |_global_options, options, _args|
115
- puts JSON.dump($client.groups_mark(options))
116
- end
117
- end
118
-
119
- g.desc 'Opens a private channel.'
120
- g.long_desc %( Opens a private channel. )
121
- g.command 'open' do |c|
122
- c.flag 'channel', desc: 'Private channel to open.'
123
- c.action do |_global_options, options, _args|
124
- puts JSON.dump($client.groups_open(options))
125
- end
126
- end
127
-
128
- g.desc 'Renames a private channel.'
129
- g.long_desc %( Renames a private channel. )
130
- g.command 'rename' do |c|
131
- c.flag 'channel', desc: 'Private channel to rename.'
132
- c.flag 'name', desc: 'New name for private channel.'
133
- c.flag 'validate', desc: 'Whether to return errors on invalid channel name instead of modifying it to meet the specified criteria.'
134
- c.action do |_global_options, options, _args|
135
- puts JSON.dump($client.groups_rename(options))
136
- end
137
- end
138
-
139
- g.desc 'Retrieve a thread of messages posted to a private channel'
140
- g.long_desc %( Retrieve a thread of messages posted to a private channel )
141
- g.command 'replies' do |c|
142
- c.flag 'channel', desc: 'Private channel to fetch thread from.'
143
- c.flag 'thread_ts', desc: "Unique identifier of a thread's parent message."
144
- c.action do |_global_options, options, _args|
145
- puts JSON.dump($client.groups_replies(options))
146
- end
147
- end
148
-
149
- g.desc 'Sets the purpose for a private channel.'
150
- g.long_desc %( Sets the purpose for a private channel. )
151
- g.command 'setPurpose' do |c|
152
- c.flag 'channel', desc: 'Private channel to set the purpose of.'
153
- c.flag 'purpose', desc: 'The new purpose.'
154
- c.action do |_global_options, options, _args|
155
- puts JSON.dump($client.groups_setPurpose(options))
156
- end
157
- end
158
-
159
- g.desc 'Sets the topic for a private channel.'
160
- g.long_desc %( Sets the topic for a private channel. )
161
- g.command 'setTopic' do |c|
162
- c.flag 'channel', desc: 'Private channel to set the topic of.'
163
- c.flag 'topic', desc: 'The new topic.'
164
- c.action do |_global_options, options, _args|
165
- puts JSON.dump($client.groups_setTopic(options))
166
- end
167
- end
168
-
169
- g.desc 'Unarchives a private channel.'
170
- g.long_desc %( Unarchives a private channel. )
171
- g.command 'unarchive' do |c|
172
- c.flag 'channel', desc: 'Private channel to unarchive.'
173
- c.action do |_global_options, options, _args|
174
- puts JSON.dump($client.groups_unarchive(options))
175
- end
176
- end
177
14
  end