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.
Files changed (70) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +1 -8
  3. data/CHANGELOG.md +4 -0
  4. data/README.md +1 -1
  5. data/bin/commands.rb +1 -0
  6. data/bin/commands/api.rb +2 -2
  7. data/bin/commands/apps_permissions.rb +22 -0
  8. data/bin/commands/auth.rb +4 -4
  9. data/bin/commands/bots.rb +2 -2
  10. data/bin/commands/channels.rb +31 -31
  11. data/bin/commands/chat.rb +40 -23
  12. data/bin/commands/dnd.rb +8 -8
  13. data/bin/commands/emoji.rb +2 -2
  14. data/bin/commands/files.rb +17 -17
  15. data/bin/commands/files_comments.rb +6 -6
  16. data/bin/commands/groups.rb +36 -35
  17. data/bin/commands/im.rb +13 -13
  18. data/bin/commands/mpim.rb +11 -11
  19. data/bin/commands/oauth.rb +15 -2
  20. data/bin/commands/pins.rb +6 -6
  21. data/bin/commands/reactions.rb +13 -13
  22. data/bin/commands/reminders.rb +10 -10
  23. data/bin/commands/rtm.rb +10 -6
  24. data/bin/commands/search.rb +9 -9
  25. data/bin/commands/stars.rb +8 -8
  26. data/bin/commands/team.rb +10 -10
  27. data/bin/commands/team_profile.rb +2 -2
  28. data/bin/commands/usergroups.rb +16 -16
  29. data/bin/commands/usergroups_users.rb +4 -4
  30. data/bin/commands/users.rb +20 -18
  31. data/bin/commands/users_profile.rb +7 -7
  32. data/lib/slack/real_time/stores/starter.rb +20 -0
  33. data/lib/slack/real_time/stores/store.rb +20 -0
  34. data/lib/slack/version.rb +1 -1
  35. data/lib/slack/web/api/endpoints.rb +2 -0
  36. data/lib/slack/web/api/endpoints/api.rb +1 -1
  37. data/lib/slack/web/api/endpoints/apps_permissions.rb +35 -0
  38. data/lib/slack/web/api/endpoints/auth.rb +2 -2
  39. data/lib/slack/web/api/endpoints/bots.rb +1 -1
  40. data/lib/slack/web/api/endpoints/channels.rb +17 -18
  41. data/lib/slack/web/api/endpoints/chat.rb +67 -30
  42. data/lib/slack/web/api/endpoints/dnd.rb +4 -4
  43. data/lib/slack/web/api/endpoints/emoji.rb +1 -1
  44. data/lib/slack/web/api/endpoints/files.rb +16 -17
  45. data/lib/slack/web/api/endpoints/files_comments.rb +8 -8
  46. data/lib/slack/web/api/endpoints/groups.rb +21 -22
  47. data/lib/slack/web/api/endpoints/im.rb +8 -10
  48. data/lib/slack/web/api/endpoints/mpim.rb +7 -9
  49. data/lib/slack/web/api/endpoints/oauth.rb +23 -2
  50. data/lib/slack/web/api/endpoints/pins.rb +3 -5
  51. data/lib/slack/web/api/endpoints/reactions.rb +14 -16
  52. data/lib/slack/web/api/endpoints/reminders.rb +5 -5
  53. data/lib/slack/web/api/endpoints/rtm.rb +14 -6
  54. data/lib/slack/web/api/endpoints/search.rb +9 -9
  55. data/lib/slack/web/api/endpoints/stars.rb +7 -9
  56. data/lib/slack/web/api/endpoints/team.rb +8 -9
  57. data/lib/slack/web/api/endpoints/team_profile.rb +1 -1
  58. data/lib/slack/web/api/endpoints/usergroups.rb +17 -17
  59. data/lib/slack/web/api/endpoints/usergroups_users.rb +2 -2
  60. data/lib/slack/web/api/endpoints/users.rb +15 -15
  61. data/lib/slack/web/api/endpoints/users_profile.rb +8 -8
  62. data/lib/slack/web/api/patches/chat.3.update-attachments-support.patch +4 -3
  63. data/lib/slack/web/api/patches/chat.4.postEphemeral-attachments-support.patch +17 -0
  64. data/spec/integration/integration_spec.rb +1 -1
  65. data/spec/slack/web/api/endpoints/apps_permissions_spec.rb +15 -0
  66. data/spec/slack/web/api/endpoints/custom_specs/chat_spec.rb +37 -1
  67. data/spec/slack/web/api/endpoints/files_comments_spec.rb +8 -8
  68. data/spec/slack/web/api/endpoints/files_spec.rb +0 -5
  69. data/spec/slack/web/api/endpoints/oauth_spec.rb +11 -0
  70. metadata +7 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c27d0774e9e56d2188bf8e9aea953b86821a9156
4
- data.tar.gz: d4ca8180bcc3d643e5dcc0b326975086831df51f
3
+ metadata.gz: fcd1ef609f08b50f10e18a4c6fead723a0479638
4
+ data.tar.gz: 3740c747309c53870894ff627b5101149881e379
5
5
  SHA512:
6
- metadata.gz: '0395ba1c14c66f1f3360c71a9bb294fd33ed88775de08c933e6cb7c23aa47485a864e151a3dd41354debd266cd9d9fa1ba80d0c5260afb5f62b60c46c1784a4c'
7
- data.tar.gz: bbe81ee65b8358950dc946791bb72c8e8e3c84ce6ac52fe73a9a66c2f70073394153d604fce446b3eff3590b94ff87a4236a5d447522c8e0e10af4dd54daeddd
6
+ metadata.gz: ff1a0e156c5cd597c7a785dd5c740bea559fb86f83c5955e218a37e4fd827dc7335456f907fbc30ea3d89654c0a4ea154acc3afb3328a014de4a7a9a7877faf5
7
+ data.tar.gz: 9b62c200399f30be7df84c19da02d52a29585713b7ce0e7cc9ed3b0d97ccc9a19e4f51add07605b7a713988f482ce5f6ed15e27c6b50112718c97e9dfee62778
@@ -6,8 +6,7 @@ rvm:
6
6
  - 2.2
7
7
  - 2.1
8
8
  - 2.0
9
- - rbx-2
10
- - jruby-19mode
9
+ - 2.3.4
11
10
  - ruby-head
12
11
  - jruby-head
13
12
 
@@ -20,15 +19,9 @@ matrix:
20
19
  env: CONCURRENCY=celluloid-io
21
20
  - rvm: 2.4.1
22
21
  env: CONCURRENCY=faye-websocket
23
- - rvm: 2.3.4
24
- env: CONCURRENCY=celluloid-io
25
- - rvm: 2.3.4
26
- env: CONCURRENCY=faye-websocket
27
22
  allow_failures:
28
23
  - rvm: ruby-head
29
24
  - rvm: jruby-head
30
- - rvm: jruby-19mode
31
- - rvm: rbx-2
32
25
 
33
26
  git:
34
27
  submodules: false
@@ -1,3 +1,7 @@
1
+ ### 0.9.1 (8/24/2017)
2
+
3
+ * [#158](https://github.com/slack-ruby/slack-ruby-client/issues/158): Updated to latest slack-api-ref; Updated chat.3.update patch to reflect argument reordering; Added chat.4.postEphemeral patch to apply the attachments JSON fix (whitespace last line of diff matters! ;-) - [@alexagranov](https://github.com/alexagranov).
4
+
1
5
  ### 0.9.0 (8/6/2017)
2
6
 
3
7
  * [#146](https://github.com/slack-ruby/slack-ruby-client/issues/146): Fix: `undefined method running?` and `ThreadError: Target thread must not be current thread` with `Celluloid::IO` - [@dblock](https://github.com/dblock).
data/README.md CHANGED
@@ -18,7 +18,7 @@ A Ruby client for the Slack [Web](https://api.slack.com/web) and [RealTime Messa
18
18
 
19
19
  ## Stable Release
20
20
 
21
- You're reading the documentation for the **stable** release of slack-ruby-client, 0.9.0. See [UPGRADING](UPGRADING.md) when upgrading from an older version.
21
+ You're reading the documentation for the **stable** release of slack-ruby-client. See [UPGRADING](UPGRADING.md) when upgrading from an older version.
22
22
 
23
23
  ## Installation
24
24
 
@@ -1,6 +1,7 @@
1
1
  # This file was auto-generated by lib/tasks/web.rake
2
2
 
3
3
  require 'commands/api'
4
+ require 'commands/apps_permissions'
4
5
  require 'commands/auth'
5
6
  require 'commands/bots'
6
7
  require 'commands/channels'
@@ -2,8 +2,8 @@
2
2
 
3
3
  desc 'Api methods.'
4
4
  command 'api' do |g|
5
- g.desc 'This method helps you test your calling code.'
6
- g.long_desc %( This method helps you test your calling code. )
5
+ g.desc 'Checks API calling code.'
6
+ g.long_desc %( Checks API calling code. )
7
7
  g.command 'test' do |c|
8
8
  c.flag 'error', desc: 'Error response to return.'
9
9
  c.flag 'foo', desc: 'example property to return.'
@@ -0,0 +1,22 @@
1
+ # This file was auto-generated by lib/tasks/web.rake
2
+
3
+ desc 'AppsPermissions methods.'
4
+ command 'apps_permissions' do |g|
5
+ g.desc 'Returns list of permissions this app has on a team.'
6
+ g.long_desc %( Returns list of permissions this app has on a team. )
7
+ g.command 'info' do |c|
8
+ c.action do |_global_options, options, _args|
9
+ puts JSON.dump($client.apps_permissions_info(options))
10
+ end
11
+ end
12
+
13
+ g.desc 'Allows an app to request additional scopes'
14
+ g.long_desc %( Allows an app to request additional scopes )
15
+ g.command 'request' do |c|
16
+ c.flag 'scopes', desc: 'A comma separated list of scopes to request for.'
17
+ c.flag 'trigger_id', desc: 'Token used to trigger the permissions API.'
18
+ c.action do |_global_options, options, _args|
19
+ puts JSON.dump($client.apps_permissions_request(options))
20
+ end
21
+ end
22
+ end
@@ -2,8 +2,8 @@
2
2
 
3
3
  desc 'Auth methods.'
4
4
  command 'auth' do |g|
5
- g.desc 'This method revokes an access token. Use it when you no longer need a token. For example, with a Sign In With Slack app, call this to log a user out.'
6
- g.long_desc %( This method revokes an access token. Use it when you no longer need a token. For example, with a Sign In With Slack app, call this to log a user out. )
5
+ g.desc 'Revokes a token.'
6
+ g.long_desc %( Revokes a token. )
7
7
  g.command 'revoke' do |c|
8
8
  c.flag 'test', desc: 'Setting this parameter to 1 triggers a testing mode where the specified token will not actually be revoked.'
9
9
  c.action do |_global_options, options, _args|
@@ -11,8 +11,8 @@ command 'auth' do |g|
11
11
  end
12
12
  end
13
13
 
14
- g.desc 'This method checks authentication and tells you who you are.'
15
- g.long_desc %( This method checks authentication and tells you who you are. )
14
+ g.desc 'Checks authentication & identity.'
15
+ g.long_desc %( Checks authentication & identity. )
16
16
  g.command 'test' do |c|
17
17
  c.action do |_global_options, options, _args|
18
18
  puts JSON.dump($client.auth_test(options))
@@ -2,8 +2,8 @@
2
2
 
3
3
  desc 'Bots methods.'
4
4
  command 'bots' do |g|
5
- g.desc 'This method returns information about a bot user.'
6
- g.long_desc %( This method returns information about a bot user. )
5
+ g.desc 'Gets information about a bot user.'
6
+ g.long_desc %( Gets information about a bot user. )
7
7
  g.command 'info' do |c|
8
8
  c.flag 'bot', desc: 'Bot user to get info on.'
9
9
  c.action do |_global_options, options, _args|
@@ -2,8 +2,8 @@
2
2
 
3
3
  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."
4
4
  command 'channels' do |g|
5
- g.desc 'This method archives a channel.'
6
- g.long_desc %( This method archives a channel. )
5
+ g.desc 'Archives a channel.'
6
+ g.long_desc %( Archives a channel. )
7
7
  g.command 'archive' do |c|
8
8
  c.flag 'channel', desc: 'Channel to archive.'
9
9
  c.action do |_global_options, options, _args|
@@ -11,8 +11,8 @@ command 'channels' do |g|
11
11
  end
12
12
  end
13
13
 
14
- g.desc 'This method is used to create a channel.'
15
- g.long_desc %( This method is used to create a channel. )
14
+ g.desc 'Creates a channel.'
15
+ g.long_desc %( Creates a channel. )
16
16
  g.command 'create' do |c|
17
17
  c.flag 'name', desc: 'Name of channel to create.'
18
18
  c.flag 'validate', desc: 'Whether to return errors on invalid channel name instead of modifying it to meet the specified criteria.'
@@ -21,21 +21,21 @@ command 'channels' do |g|
21
21
  end
22
22
  end
23
23
 
24
- g.desc 'This method returns a portion of message events from the specified channel.'
25
- g.long_desc %( This method returns a portion of message events from the specified channel. )
24
+ g.desc 'Fetches history of messages and events from a channel.'
25
+ g.long_desc %( Fetches history of messages and events from a channel. )
26
26
  g.command 'history' do |c|
27
27
  c.flag 'channel', desc: 'Channel to fetch history for.'
28
+ c.flag 'inclusive', desc: 'Include messages with latest or oldest timestamp in results.'
28
29
  c.flag 'latest', desc: 'End of time range of messages to include in results.'
29
30
  c.flag 'oldest', desc: 'Start of time range of messages to include in results.'
30
- c.flag 'inclusive', desc: 'Include messages with latest or oldest timestamp in results.'
31
31
  c.flag 'unreads', desc: 'Include unread_count_display in the output?.'
32
32
  c.action do |_global_options, options, _args|
33
33
  puts JSON.dump($client.channels_history(options))
34
34
  end
35
35
  end
36
36
 
37
- g.desc 'This method returns information about a team channel.'
38
- g.long_desc %( This method returns information about a team channel. )
37
+ g.desc 'Gets information about a channel.'
38
+ g.long_desc %( Gets information about a channel. )
39
39
  g.command 'info' do |c|
40
40
  c.flag 'channel', desc: 'Channel to get info on.'
41
41
  c.action do |_global_options, options, _args|
@@ -43,8 +43,8 @@ command 'channels' do |g|
43
43
  end
44
44
  end
45
45
 
46
- g.desc 'This method is used to invite a user to a channel. The calling user must be a member of the channel.'
47
- g.long_desc %( This method is used to invite a user to a channel. The calling user must be a member of the channel. )
46
+ g.desc 'Invites a user to a channel.'
47
+ g.long_desc %( Invites a user to a channel. )
48
48
  g.command 'invite' do |c|
49
49
  c.flag 'channel', desc: 'Channel to invite user to.'
50
50
  c.flag 'user', desc: 'User to invite to channel.'
@@ -53,8 +53,8 @@ command 'channels' do |g|
53
53
  end
54
54
  end
55
55
 
56
- g.desc 'This method is used to join a channel. If the channel does not exist, it is'
57
- g.long_desc %( This method is used to join a channel. If the channel does not exist, it is created. )
56
+ g.desc 'Joins a channel, creating it if needed.'
57
+ g.long_desc %( Joins a channel, creating it if needed. )
58
58
  g.command 'join' do |c|
59
59
  c.flag 'name', desc: 'Name of channel to join.'
60
60
  c.flag 'validate', desc: 'Whether to return errors on invalid channel name instead of modifying it to meet the specified criteria.'
@@ -63,8 +63,8 @@ command 'channels' do |g|
63
63
  end
64
64
  end
65
65
 
66
- g.desc 'This method allows a user to remove another member from a team channel.'
67
- g.long_desc %( This method allows a user to remove another member from a team channel. )
66
+ g.desc 'Removes a user from a channel.'
67
+ g.long_desc %( Removes a user from a channel. )
68
68
  g.command 'kick' do |c|
69
69
  c.flag 'channel', desc: 'Channel to remove user from.'
70
70
  c.flag 'user', desc: 'User to remove from channel.'
@@ -73,8 +73,8 @@ command 'channels' do |g|
73
73
  end
74
74
  end
75
75
 
76
- g.desc 'This method is used to leave a channel.'
77
- g.long_desc %( This method is used to leave a channel. )
76
+ g.desc 'Leaves a channel.'
77
+ g.long_desc %( Leaves a channel. )
78
78
  g.command 'leave' do |c|
79
79
  c.flag 'channel', desc: 'Channel to leave.'
80
80
  c.action do |_global_options, options, _args|
@@ -82,8 +82,8 @@ command 'channels' do |g|
82
82
  end
83
83
  end
84
84
 
85
- g.desc 'This method returns a list of all channels in the team. This includes channels the caller is in, channels they are not currently in, and archived channels but does not include private channels. The number of (non-deactivated) members in each channel is also returned.'
86
- g.long_desc %( This method returns a list of all channels in the team. This includes channels the caller is in, channels they are not currently in, and archived channels but does not include private channels. The number of (non-deactivated) members in each channel is also returned. )
85
+ g.desc 'Lists all channels in a Slack team.'
86
+ g.long_desc %( Lists all channels in a Slack team. )
87
87
  g.command 'list' do |c|
88
88
  c.flag 'exclude_archived', desc: 'Exclude archived channels from the list.'
89
89
  c.flag 'exclude_members', desc: 'Exclude the members collection from each channel.'
@@ -92,8 +92,8 @@ command 'channels' do |g|
92
92
  end
93
93
  end
94
94
 
95
- g.desc 'This method moves the read cursor in a channel.'
96
- g.long_desc %( This method moves the read cursor in a channel. )
95
+ g.desc 'Sets the read cursor in a channel.'
96
+ g.long_desc %( Sets the read cursor in a channel. )
97
97
  g.command 'mark' do |c|
98
98
  c.flag 'channel', desc: 'Channel to set reading cursor in.'
99
99
  c.flag 'ts', desc: 'Timestamp of the most recently seen message.'
@@ -102,8 +102,8 @@ command 'channels' do |g|
102
102
  end
103
103
  end
104
104
 
105
- g.desc 'This method renames a team channel.'
106
- g.long_desc %( This method renames a team channel. )
105
+ g.desc 'Renames a channel.'
106
+ g.long_desc %( Renames a channel. )
107
107
  g.command 'rename' do |c|
108
108
  c.flag 'channel', desc: 'Channel to rename.'
109
109
  c.flag 'name', desc: 'New name for channel.'
@@ -113,8 +113,8 @@ command 'channels' do |g|
113
113
  end
114
114
  end
115
115
 
116
- g.desc 'This method returns an entire thread (a message plus all the messages in reply to it).'
117
- g.long_desc %( This method returns an entire thread (a message plus all the messages in reply to it). )
116
+ g.desc 'Retrieve a thread of messages posted to a channel'
117
+ g.long_desc %( Retrieve a thread of messages posted to a channel )
118
118
  g.command 'replies' do |c|
119
119
  c.flag 'channel', desc: 'Channel to fetch thread from.'
120
120
  c.flag 'thread_ts', desc: "Unique identifier of a thread's parent message."
@@ -123,8 +123,8 @@ command 'channels' do |g|
123
123
  end
124
124
  end
125
125
 
126
- g.desc 'This method is used to change the purpose of a channel. The calling user must be a member of the channel.'
127
- g.long_desc %( This method is used to change the purpose of a channel. The calling user must be a member of the channel. )
126
+ g.desc 'Sets the purpose for a channel.'
127
+ g.long_desc %( Sets the purpose for a channel. )
128
128
  g.command 'setPurpose' do |c|
129
129
  c.flag 'channel', desc: 'Channel to set the purpose of.'
130
130
  c.flag 'purpose', desc: 'The new purpose.'
@@ -133,8 +133,8 @@ command 'channels' do |g|
133
133
  end
134
134
  end
135
135
 
136
- g.desc 'This method is used to change the topic of a channel. The calling user must be a member of the channel.'
137
- g.long_desc %( This method is used to change the topic of a channel. The calling user must be a member of the channel. )
136
+ g.desc 'Sets the topic for a channel.'
137
+ g.long_desc %( Sets the topic for a channel. )
138
138
  g.command 'setTopic' do |c|
139
139
  c.flag 'channel', desc: 'Channel to set the topic of.'
140
140
  c.flag 'topic', desc: 'The new topic.'
@@ -143,8 +143,8 @@ command 'channels' do |g|
143
143
  end
144
144
  end
145
145
 
146
- g.desc 'This method unarchives a channel. The calling user is added to the channel.'
147
- g.long_desc %( This method unarchives a channel. The calling user is added to the channel. )
146
+ g.desc 'Unarchives a channel.'
147
+ g.long_desc %( Unarchives a channel. )
148
148
  g.command 'unarchive' do |c|
149
149
  c.flag 'channel', desc: 'Channel to unarchive.'
150
150
  c.action do |_global_options, options, _args|
@@ -2,19 +2,19 @@
2
2
 
3
3
  desc 'Post chat messages to Slack.'
4
4
  command 'chat' do |g|
5
- g.desc 'This method deletes a message from a channel.'
6
- g.long_desc %( This method deletes a message from a channel. )
5
+ g.desc 'Deletes a message.'
6
+ g.long_desc %( Deletes a message. )
7
7
  g.command 'delete' do |c|
8
- c.flag 'ts', desc: 'Timestamp of the message to be deleted.'
9
8
  c.flag 'channel', desc: 'Channel containing the message to be deleted.'
9
+ c.flag 'ts', desc: 'Timestamp of the message to be deleted.'
10
10
  c.flag 'as_user', desc: 'Pass true to delete the message as the authed user. Bot users in this context are considered authed users.'
11
11
  c.action do |_global_options, options, _args|
12
12
  puts JSON.dump($client.chat_delete(options))
13
13
  end
14
14
  end
15
15
 
16
- g.desc 'This method sends a me message to a channel from the calling user.'
17
- g.long_desc %( This method sends a me message to a channel from the calling user. )
16
+ g.desc 'Share a me message into a channel.'
17
+ g.long_desc %( Share a me message into a channel. )
18
18
  g.command 'meMessage' do |c|
19
19
  c.flag 'channel', desc: 'Channel to send message to. Can be a public channel, private group or IM channel. Can be an encoded ID, or a name.'
20
20
  c.flag 'text', desc: 'Text of the message to send.'
@@ -23,49 +23,66 @@ command 'chat' do |g|
23
23
  end
24
24
  end
25
25
 
26
- g.desc 'This method posts a message to a public channel, private channel, or direct message/IM channel.'
27
- g.long_desc %( This method posts a message to a public channel, private channel, or direct message/IM channel. )
26
+ g.desc 'Sends an ephemeral message to a user in a channel.'
27
+ g.long_desc %( Sends an ephemeral message to a user in a channel. )
28
+ g.command 'postEphemeral' do |c|
29
+ c.flag 'channel', desc: 'Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name.'
30
+ c.flag 'text', desc: "Text of the message to send. See below for an explanation of formatting. This field is usually required, unless you're providing only attachments instead."
31
+ c.flag 'user', desc: 'id of the user who will receive the ephemeral message. The user should be in the channel specified by the channel argument.'
32
+ c.flag 'as_user', desc: 'Pass true to post the message as the authed bot. Defaults to false.'
33
+ c.flag 'attachments', desc: 'A JSON-based array of structured attachments, presented as a URL-encoded string.'
34
+ c.flag 'link_names', desc: 'Find and link channel names and usernames.'
35
+ c.flag 'parse', desc: 'Change how messages are treated. Defaults to none. See below.'
36
+ c.action do |_global_options, options, _args|
37
+ puts JSON.dump($client.chat_postEphemeral(options))
38
+ end
39
+ end
40
+
41
+ g.desc 'Sends a message to a channel.'
42
+ g.long_desc %( Sends a message to a channel. )
28
43
  g.command 'postMessage' do |c|
29
44
  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.'
30
45
  c.flag 'text', desc: "Text of the message to send. See below for an explanation of formatting. This field is usually required, unless you're providing only attachments instead."
31
- c.flag 'parse', desc: 'Change how messages are treated. Defaults to none. See below.'
46
+ 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.'
47
+ c.flag 'attachments', desc: 'A JSON-based array of structured attachments, presented as a URL-encoded string.'
48
+ 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.'
49
+ 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.'
32
50
  c.flag 'link_names', desc: 'Find and link channel names and usernames.'
33
- c.flag 'attachments', desc: 'Structured message attachments.'
51
+ c.flag 'parse', desc: 'Change how messages are treated. Defaults to none. See below.'
52
+ 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.'
53
+ 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."
34
54
  c.flag 'unfurl_links', desc: 'Pass true to enable unfurling of primarily text-based content.'
35
55
  c.flag 'unfurl_media', desc: 'Pass false to disable unfurling of media content.'
36
56
  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."
37
- 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.'
38
- 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.'
39
- 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.'
40
- 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."
41
- 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.'
42
57
  c.action do |_global_options, options, _args|
43
58
  puts JSON.dump($client.chat_postMessage(options))
44
59
  end
45
60
  end
46
61
 
47
- g.desc 'This method attaches Slack app unfurl behavior to a specified and relevant message. A user token is required as this method does not support bot user tokens.'
48
- g.long_desc %( This method attaches Slack app unfurl behavior to a specified and relevant message. A user token is required as this method does not support bot user tokens. )
62
+ g.desc 'Provide custom unfurl behavior for user-posted URLs'
63
+ g.long_desc %( Provide custom unfurl behavior for user-posted URLs )
49
64
  g.command 'unfurl' do |c|
50
65
  c.flag 'channel', desc: 'Channel ID of the message.'
51
66
  c.flag 'ts', desc: 'Timestamp of the message to add unfurl behavior to.'
52
- c.flag 'unfurls', desc: 'JSON mapping a set of URLs from the message to their unfurl attachments.'
67
+ c.flag 'unfurls', desc: 'URL-encoded JSON map with keys set to URLs featured in the the message, pointing to their unfurl message attachments.'
68
+ 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.'
53
69
  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.'
70
+ 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.'
54
71
  c.action do |_global_options, options, _args|
55
72
  puts JSON.dump($client.chat_unfurl(options))
56
73
  end
57
74
  end
58
75
 
59
- g.desc 'This method updates a message in a channel. Though related to chat.postMessage, some parameters of chat.update are handled differently.'
60
- g.long_desc %( This method updates a message in a channel. Though related to chat.postMessage, some parameters of chat.update are handled differently. )
76
+ g.desc 'Updates a message.'
77
+ g.long_desc %( Updates a message. )
61
78
  g.command 'update' do |c|
62
- c.flag 'ts', desc: 'Timestamp of the message to be updated.'
63
79
  c.flag 'channel', desc: 'Channel containing the message to be updated.'
64
80
  c.flag 'text', desc: 'New text for the message, using the default formatting rules.'
65
- c.flag 'attachments', desc: 'Structured message attachments.'
66
- c.flag 'parse', desc: 'Change how messages are treated. Defaults to client, unlike chat.postMessage. See below.'
67
- c.flag 'link_names', desc: 'Find and link channel names and usernames. Defaults to none. This parameter should be used in conjunction with parse. To set link_names to 1, specify a parse mode of full.'
81
+ c.flag 'ts', desc: 'Timestamp of the message to be updated.'
68
82
  c.flag 'as_user', desc: 'Pass true to update the message as the authed user. Bot users in this context are considered authed users.'
83
+ c.flag 'attachments', desc: 'A JSON-based array of structured attachments, presented as a URL-encoded string.'
84
+ c.flag 'link_names', desc: 'Find and link channel names and usernames. Defaults to none. This parameter should be used in conjunction with parse. To set link_names to 1, specify a parse mode of full.'
85
+ c.flag 'parse', desc: 'Change how messages are treated. Defaults to client, unlike chat.postMessage. See below.'
69
86
  c.action do |_global_options, options, _args|
70
87
  puts JSON.dump($client.chat_update(options))
71
88
  end
@@ -2,8 +2,8 @@
2
2
 
3
3
  desc 'Adjust and view Do Not Disturb settings for team members.'
4
4
  command 'dnd' do |g|
5
- g.desc "Ends the user's currently scheduled Do Not Disturb session immediately."
6
- g.long_desc %( Ends the user's currently scheduled Do Not Disturb session immediately. )
5
+ g.desc "Ends the current user's Do Not Disturb session immediately."
6
+ g.long_desc %( Ends the current user's Do Not Disturb session immediately. )
7
7
  g.command 'endDnd' do |c|
8
8
  c.action do |_global_options, options, _args|
9
9
  puts JSON.dump($client.dnd_endDnd(options))
@@ -18,8 +18,8 @@ command 'dnd' do |g|
18
18
  end
19
19
  end
20
20
 
21
- g.desc "Provides information about a user's current Do Not Disturb settings."
22
- g.long_desc %( Provides information about a user's current Do Not Disturb settings. )
21
+ g.desc "Retrieves a user's current Do Not Disturb status."
22
+ g.long_desc %( Retrieves a user's current Do Not Disturb status. )
23
23
  g.command 'info' do |c|
24
24
  c.flag 'user', desc: 'User to fetch status for (defaults to current user).'
25
25
  c.action do |_global_options, options, _args|
@@ -27,8 +27,8 @@ command 'dnd' do |g|
27
27
  end
28
28
  end
29
29
 
30
- g.desc "Adjusts the snooze duration for a user's Do Not Disturb settings. If a snooze session is not already active for the user, invoking this method will begin one for the specified duration."
31
- g.long_desc %( Adjusts the snooze duration for a user's Do Not Disturb settings. If a snooze session is not already active for the user, invoking this method will begin one for the specified duration. )
30
+ g.desc 'Turns on Do Not Disturb mode for the current user, or changes its duration.'
31
+ g.long_desc %( Turns on Do Not Disturb mode for the current user, or changes its duration. )
32
32
  g.command 'setSnooze' do |c|
33
33
  c.flag 'num_minutes', desc: 'Number of minutes, from now, to snooze until.'
34
34
  c.action do |_global_options, options, _args|
@@ -36,8 +36,8 @@ command 'dnd' do |g|
36
36
  end
37
37
  end
38
38
 
39
- g.desc 'Provides information about the current Do Not Disturb settings for users of a Slack team.'
40
- g.long_desc %( Provides information about the current Do Not Disturb settings for users of a Slack team. )
39
+ g.desc 'Retrieves the Do Not Disturb status for users on a team.'
40
+ g.long_desc %( Retrieves the Do Not Disturb status for users on a team. )
41
41
  g.command 'teamInfo' do |c|
42
42
  c.flag 'users', desc: 'Comma-separated list of users to fetch Do Not Disturb status for.'
43
43
  c.action do |_global_options, options, _args|