slack-ruby-client 0.14.1 → 0.14.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (91) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/.rubocop_todo.yml +15 -4
  4. data/CHANGELOG.md +7 -0
  5. data/README.md +8 -1
  6. data/Rakefile +1 -1
  7. data/bin/commands.rb +1 -0
  8. data/bin/commands/api.rb +2 -2
  9. data/bin/commands/apps.rb +2 -2
  10. data/bin/commands/apps_permissions.rb +4 -4
  11. data/bin/commands/apps_permissions_resources.rb +2 -2
  12. data/bin/commands/apps_permissions_scopes.rb +2 -2
  13. data/bin/commands/apps_permissions_users.rb +4 -4
  14. data/bin/commands/auth.rb +4 -4
  15. data/bin/commands/bots.rb +2 -2
  16. data/bin/commands/channels.rb +32 -31
  17. data/bin/commands/chat.rb +48 -17
  18. data/bin/commands/chat_scheduledMessages.rb +17 -0
  19. data/bin/commands/conversations.rb +35 -35
  20. data/bin/commands/dialog.rb +2 -2
  21. data/bin/commands/dnd.rb +9 -9
  22. data/bin/commands/emoji.rb +2 -2
  23. data/bin/commands/files.rb +14 -25
  24. data/bin/commands/files_comments.rb +2 -23
  25. data/bin/commands/groups.rb +33 -33
  26. data/bin/commands/im.rb +13 -13
  27. data/bin/commands/migration.rb +2 -2
  28. data/bin/commands/mpim.rb +11 -11
  29. data/bin/commands/oauth.rb +4 -4
  30. data/bin/commands/pins.rb +6 -6
  31. data/bin/commands/reactions.rb +8 -8
  32. data/bin/commands/reminders.rb +10 -10
  33. data/bin/commands/rtm.rb +4 -4
  34. data/bin/commands/search.rb +7 -7
  35. data/bin/commands/stars.rb +6 -6
  36. data/bin/commands/team.rb +8 -8
  37. data/bin/commands/team_profile.rb +2 -2
  38. data/bin/commands/usergroups.rb +11 -11
  39. data/bin/commands/usergroups_users.rb +4 -4
  40. data/bin/commands/users.rb +21 -22
  41. data/bin/commands/users_profile.rb +4 -4
  42. data/lib/slack/events/request.rb +9 -5
  43. data/lib/slack/real_time/client.rb +23 -6
  44. data/lib/slack/real_time/concurrency/async.rb +55 -23
  45. data/lib/slack/real_time/concurrency/celluloid.rb +0 -1
  46. data/lib/slack/real_time/concurrency/eventmachine.rb +0 -5
  47. data/lib/slack/real_time/socket.rb +16 -9
  48. data/lib/slack/version.rb +1 -1
  49. data/lib/slack/web/api/endpoints.rb +2 -0
  50. data/lib/slack/web/api/endpoints/api.rb +1 -1
  51. data/lib/slack/web/api/endpoints/apps.rb +1 -1
  52. data/lib/slack/web/api/endpoints/apps_permissions.rb +2 -2
  53. data/lib/slack/web/api/endpoints/apps_permissions_resources.rb +1 -1
  54. data/lib/slack/web/api/endpoints/apps_permissions_scopes.rb +1 -1
  55. data/lib/slack/web/api/endpoints/apps_permissions_users.rb +2 -2
  56. data/lib/slack/web/api/endpoints/auth.rb +2 -2
  57. data/lib/slack/web/api/endpoints/bots.rb +1 -1
  58. data/lib/slack/web/api/endpoints/channels.rb +18 -15
  59. data/lib/slack/web/api/endpoints/chat.rb +63 -9
  60. data/lib/slack/web/api/endpoints/chat_scheduledMessages.rb +37 -0
  61. data/lib/slack/web/api/endpoints/conversations.rb +17 -17
  62. data/lib/slack/web/api/endpoints/dialog.rb +1 -1
  63. data/lib/slack/web/api/endpoints/dnd.rb +4 -4
  64. data/lib/slack/web/api/endpoints/emoji.rb +1 -1
  65. data/lib/slack/web/api/endpoints/files.rb +7 -18
  66. data/lib/slack/web/api/endpoints/files_comments.rb +1 -34
  67. data/lib/slack/web/api/endpoints/groups.rb +18 -16
  68. data/lib/slack/web/api/endpoints/im.rb +8 -6
  69. data/lib/slack/web/api/endpoints/migration.rb +1 -1
  70. data/lib/slack/web/api/endpoints/mpim.rb +7 -5
  71. data/lib/slack/web/api/endpoints/oauth.rb +2 -2
  72. data/lib/slack/web/api/endpoints/pins.rb +5 -3
  73. data/lib/slack/web/api/endpoints/reactions.rb +6 -4
  74. data/lib/slack/web/api/endpoints/reminders.rb +5 -5
  75. data/lib/slack/web/api/endpoints/rtm.rb +2 -2
  76. data/lib/slack/web/api/endpoints/search.rb +3 -3
  77. data/lib/slack/web/api/endpoints/stars.rb +5 -3
  78. data/lib/slack/web/api/endpoints/team.rb +5 -4
  79. data/lib/slack/web/api/endpoints/team_profile.rb +1 -1
  80. data/lib/slack/web/api/endpoints/usergroups.rb +5 -5
  81. data/lib/slack/web/api/endpoints/usergroups_users.rb +2 -2
  82. data/lib/slack/web/api/endpoints/users.rb +12 -12
  83. data/lib/slack/web/api/endpoints/users_profile.rb +2 -2
  84. data/spec/integration/integration_spec.rb +43 -36
  85. data/spec/slack/events/request_spec.rb +29 -1
  86. data/spec/slack/real_time/concurrency/celluloid_spec.rb +5 -0
  87. data/spec/slack/real_time/concurrency/eventmachine_spec.rb +1 -0
  88. data/spec/slack/web/api/endpoints/chat_scheduledMessages_spec.rb +7 -0
  89. data/spec/slack/web/api/endpoints/files_comments_spec.rb +0 -19
  90. data/spec/spec_helper.rb +5 -0
  91. metadata +6 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3f49c09a3a19a7cabc86a35479cc1e0073b6fb35939379961353cf16b30c8ce5
4
- data.tar.gz: 82d9a2b2854adfb3e78a51328dbdbcf298c50acb9eef45a521a3a6a4335f7674
3
+ metadata.gz: 358de8d699475c86a5e79c8c96e082dd55b9f60fcb44ed806f62758c3e99479e
4
+ data.tar.gz: ae9bceefa9fef8950b823bcb6f6ff7023ca027a268022500a9e48d8d5aa28f85
5
5
  SHA512:
6
- metadata.gz: c7840627a1a2b0226599c6d64445fe4f2a1590b6d129211a6659cbe9aef7bb6dc534438fc61ee95e01ea3f518b299ff8a9739165011e361538f6688e8b228b41
7
- data.tar.gz: ed84733c510bc3ef05710046b7a6eef36d84b923cfcf76912093386de88d2a47c55bf1e7082c384c9829ba639373d73fa3ebac0f4a1c711fff398ea9be84a230
6
+ metadata.gz: 03c79a47ba7b75a13ca37bb1a592faca4c3d6c4d1f53b34ba205a8587bb72b26a6d009fb22cb9a57b63e017dac6b05ef344f13b68f045b57679fd950e0ed686a
7
+ data.tar.gz: 1761adca1f3ab450cb630102ea77f293340815c9a7e6c17b6afcf0f1fd73172f79cef25e4f89905c134a5b171a4f247d4e733f4c551ca90c57c1519e8f851801
data/.gitignore CHANGED
@@ -4,3 +4,4 @@ Gemfile.lock
4
4
  .DS_Store
5
5
  .bundle
6
6
  .idea
7
+ .rspec_status
@@ -1,11 +1,18 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2019-01-19 17:37:31 -0500 using RuboCop version 0.61.1.
3
+ # on 2019-04-09 22:16:03 -0500 using RuboCop version 0.61.1.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
7
7
  # versions of RuboCop, may require this file to be generated again.
8
8
 
9
+ # Offense count: 2
10
+ # Configuration parameters: AllowSafeAssignment.
11
+ Lint/AssignmentInCondition:
12
+ Exclude:
13
+ - 'lib/slack/real_time/concurrency/async.rb'
14
+ - 'lib/slack/real_time/socket.rb'
15
+
9
16
  # Offense count: 4
10
17
  Lint/HandleExceptions:
11
18
  Exclude:
@@ -13,12 +20,15 @@ Lint/HandleExceptions:
13
20
  - 'spec/slack/real_time/concurrency/celluloid_spec.rb'
14
21
  - 'spec/slack/real_time/concurrency/eventmachine_spec.rb'
15
22
 
16
- # Offense count: 1
23
+ # Offense count: 4
17
24
  # Configuration parameters: ExpectMatchingDefinition, Regex, IgnoreExecutableScripts, AllowedAcronyms.
18
25
  # AllowedAcronyms: CLI, DSL, ACL, API, ASCII, CPU, CSS, DNS, EOF, GUID, HTML, HTTP, HTTPS, ID, IP, JSON, LHS, QPS, RAM, RHS, RPC, SLA, SMTP, SQL, SSH, TCP, TLS, TTL, UDP, UI, UID, UUID, URI, URL, UTF8, VM, XML, XMPP, XSRF, XSS
19
26
  Naming/FileName:
20
27
  Exclude:
28
+ - 'bin/commands/chat_scheduledMessages.rb'
21
29
  - 'lib/slack-ruby-client.rb'
30
+ - 'lib/slack/web/api/endpoints/chat_scheduledMessages.rb'
31
+ - 'spec/slack/web/api/endpoints/chat_scheduledMessages_spec.rb'
22
32
 
23
33
  # Offense count: 1
24
34
  # Configuration parameters: EnforcedStyleForLeadingUnderscores.
@@ -40,15 +50,16 @@ Style/AccessModifierDeclarations:
40
50
  - 'lib/slack/real_time/concurrency/eventmachine.rb'
41
51
  - 'lib/slack/real_time/socket.rb'
42
52
 
43
- # Offense count: 153
53
+ # Offense count: 154
44
54
  # Configuration parameters: AllowedVariables.
45
55
  Style/GlobalVars:
46
56
  Enabled: false
47
57
 
48
- # Offense count: 2
58
+ # Offense count: 3
49
59
  # Configuration parameters: MinBodyLength.
50
60
  Style/GuardClause:
51
61
  Exclude:
62
+ - 'lib/slack/real_time/socket.rb'
52
63
  - 'lib/slack/real_time/stores/store.rb'
53
64
  - 'lib/slack/web/faraday/response/raise_error.rb'
54
65
 
@@ -1,3 +1,10 @@
1
+ ### 0.14.2 (2019/4/12)
2
+
3
+ * [#256](https://github.com/slack-ruby/slack-ruby-client/pull/256): Added support for specifying signing secrets on a per-request basis via optional parameters to the `Slack::Events::Request` constructor - [@gabrielmdeal](https://github.com/gabrielmdeal).
4
+ * [#257](https://github.com/slack-ruby/slack-ruby-client/pull/257), [#262](https://github.com/slack-ruby/slack-ruby-client/pull/262): Fixed occasional failures to reconnect - [@ioquatix](https://github.com/ioquatix), [@dblock](https://github.com/dblock).
5
+ * [#264](https://github.com/slack-ruby/slack-ruby-client/pull/264): Added `chat_scheduleMessage`, `chat_deleteScheduledMessage` and `chat_scheduledMessages_list` - [@dblock](https://github.com/dblock).
6
+ * [#264](https://github.com/slack-ruby/slack-ruby-client/pull/264): Removed `files_comments_add` and `files_comments_edit` - [@dblock](https://github.com/dblock).
7
+
1
8
  ### 0.14.1 (2019/2/26)
2
9
 
3
10
  * [#254](https://github.com/slack-ruby/slack-ruby-client/issues/254): Fix: celluloid infinite reconnect loop - [@dblock](https://github.com/dblock).
data/README.md CHANGED
@@ -66,7 +66,7 @@ A Ruby client for the Slack [Web](https://api.slack.com/web), [RealTime Messagin
66
66
 
67
67
  ## Stable Release
68
68
 
69
- You're reading the documentation for the **stable** release of slack-ruby-client, v0.14.1. See [UPGRADING](UPGRADING.md) when upgrading from an older version.
69
+ You're reading the documentation for the **stable** release of slack-ruby-client, 0.14.2. See [UPGRADING](UPGRADING.md) when upgrading from an older version.
70
70
 
71
71
  ## Installation
72
72
 
@@ -506,6 +506,13 @@ slack_request = Slack::Events::Request.new(http_request)
506
506
  slack_request.verify!
507
507
  ```
508
508
 
509
+ To specify secrets on a per-request basis:
510
+ ```ruby
511
+ Slack::Events::Request.new(http_request,
512
+ signing_secret: signing_secret,
513
+ signature_expires_in: signature_expires_in)
514
+ ```
515
+
509
516
  The `verify!` call may raise `Slack::Events::MissingSigningSecret`, `Slack::Events::InvalidSignature` or `Slack::Events::TimestampExpired` errors.
510
517
 
511
518
  ### Message Parsing
data/Rakefile CHANGED
@@ -14,7 +14,7 @@ end
14
14
  require 'rubocop/rake_task'
15
15
  RuboCop::RakeTask.new
16
16
 
17
- task default: %i[rubocop spec]
17
+ task default: %i[spec rubocop]
18
18
 
19
19
  load 'tasks/git.rake'
20
20
  load 'tasks/web.rake'
@@ -10,6 +10,7 @@ require 'commands/auth'
10
10
  require 'commands/bots'
11
11
  require 'commands/channels'
12
12
  require 'commands/chat'
13
+ require 'commands/chat_scheduledMessages'
13
14
  require 'commands/conversations'
14
15
  require 'commands/dialog'
15
16
  require 'commands/dnd'
@@ -2,8 +2,8 @@
2
2
 
3
3
  desc 'Api methods.'
4
4
  command 'api' do |g|
5
- g.desc 'Checks API calling code.'
6
- g.long_desc %( Checks API calling code. )
5
+ g.desc 'This method helps you test your calling code.'
6
+ g.long_desc %( This method helps you test your 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.'
@@ -2,8 +2,8 @@
2
2
 
3
3
  desc 'Apps methods.'
4
4
  command 'apps' do |g|
5
- g.desc 'Uninstalls your app from a workspace.'
6
- g.long_desc %( Uninstalls your app from a workspace. )
5
+ g.desc 'This method uninstalls a workspace app. Unlike auth.revoke, which revokes a single token, this method revokes all tokens associated with a single installation of a workspace app.'
6
+ g.long_desc %( This method uninstalls a workspace app. Unlike auth.revoke, which revokes a single token, this method revokes all tokens associated with a single installation of a workspace app. )
7
7
  g.command 'uninstall' 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.'
@@ -2,16 +2,16 @@
2
2
 
3
3
  desc 'AppsPermissions methods.'
4
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. )
5
+ g.desc 'This feature was exclusive to our workspace apps developer preview. The preview has now ended, but fan-favorite features such as token rotation and the Conversations API will become available to classic Slack apps over the coming months.'
6
+ g.long_desc %( This feature was exclusive to our workspace apps developer preview. The preview has now ended, but fan-favorite features such as token rotation and the Conversations API will become available to classic Slack apps over the coming months. )
7
7
  g.command 'info' do |c|
8
8
  c.action do |_global_options, options, _args|
9
9
  puts JSON.dump($client.apps_permissions_info(options))
10
10
  end
11
11
  end
12
12
 
13
- g.desc 'Allows an app to request additional scopes'
14
- g.long_desc %( Allows an app to request additional scopes )
13
+ g.desc 'This feature was exclusive to our workspace apps developer preview. The preview has now ended, but fan-favorite features such as token rotation and the Conversations API will become available to classic Slack apps over the coming months.'
14
+ g.long_desc %( This feature was exclusive to our workspace apps developer preview. The preview has now ended, but fan-favorite features such as token rotation and the Conversations API will become available to classic Slack apps over the coming months. )
15
15
  g.command 'request' do |c|
16
16
  c.flag 'scopes', desc: 'A comma separated list of scopes to request for.'
17
17
  c.flag 'trigger_id', desc: 'Token used to trigger the permissions API.'
@@ -2,8 +2,8 @@
2
2
 
3
3
  desc 'AppsPermissionsResources methods.'
4
4
  command 'apps_permissions_resources' do |g|
5
- g.desc 'Returns list of resource grants this app has on a team.'
6
- g.long_desc %( Returns list of resource grants this app has on a team. )
5
+ g.desc 'This feature was exclusive to our workspace apps developer preview. The preview has now ended, but fan-favorite features such as token rotation and the Conversations API will become available to classic Slack apps over the coming months.'
6
+ g.long_desc %( This feature was exclusive to our workspace apps developer preview. The preview has now ended, but fan-favorite features such as token rotation and the Conversations API will become available to classic Slack apps over the coming months. )
7
7
  g.command 'list' do |c|
8
8
  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."
9
9
  c.flag 'limit', desc: 'The maximum number of items to return.'
@@ -2,8 +2,8 @@
2
2
 
3
3
  desc 'AppsPermissionsScopes methods.'
4
4
  command 'apps_permissions_scopes' do |g|
5
- g.desc 'Returns list of scopes this app has on a team.'
6
- g.long_desc %( Returns list of scopes this app has on a team. )
5
+ g.desc 'This feature was exclusive to our workspace apps developer preview. The preview has now ended, but fan-favorite features such as token rotation and the Conversations API will become available to classic Slack apps over the coming months.'
6
+ g.long_desc %( This feature was exclusive to our workspace apps developer preview. The preview has now ended, but fan-favorite features such as token rotation and the Conversations API will become available to classic Slack apps over the coming months. )
7
7
  g.command 'list' do |c|
8
8
  c.action do |_global_options, options, _args|
9
9
  puts JSON.dump($client.apps_permissions_scopes_list(options))
@@ -2,8 +2,8 @@
2
2
 
3
3
  desc 'AppsPermissionsUsers methods.'
4
4
  command 'apps_permissions_users' do |g|
5
- g.desc 'Returns list of user grants and corresponding scopes this app has on a team.'
6
- g.long_desc %( Returns list of user grants and corresponding scopes this app has on a team. )
5
+ g.desc 'This feature was exclusive to our workspace apps developer preview. The preview has now ended, but fan-favorite features such as token rotation and the Conversations API will become available to classic Slack apps over the coming months.'
6
+ g.long_desc %( This feature was exclusive to our workspace apps developer preview. The preview has now ended, but fan-favorite features such as token rotation and the Conversations API will become available to classic Slack apps over the coming months. )
7
7
  g.command 'list' do |c|
8
8
  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."
9
9
  c.flag 'limit', desc: 'The maximum number of items to return.'
@@ -12,8 +12,8 @@ command 'apps_permissions_users' do |g|
12
12
  end
13
13
  end
14
14
 
15
- g.desc 'Enables an app to trigger a permissions modal to grant an app access to a user access scope.'
16
- g.long_desc %( Enables an app to trigger a permissions modal to grant an app access to a user access scope. )
15
+ g.desc 'This feature was exclusive to our workspace apps developer preview. The preview has now ended, but fan-favorite features such as token rotation and the Conversations API will become available to classic Slack apps over the coming months.'
16
+ g.long_desc %( This feature was exclusive to our workspace apps developer preview. The preview has now ended, but fan-favorite features such as token rotation and the Conversations API will become available to classic Slack apps over the coming months. )
17
17
  g.command 'request' do |c|
18
18
  c.flag 'scopes', desc: 'A comma separated list of user scopes to request for.'
19
19
  c.flag 'trigger_id', desc: 'Token used to trigger the request.'
@@ -2,8 +2,8 @@
2
2
 
3
3
  desc 'Auth methods.'
4
4
  command 'auth' do |g|
5
- g.desc 'Revokes a token.'
6
- g.long_desc %( Revokes a token. )
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. )
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 'Checks authentication & identity.'
15
- g.long_desc %( Checks authentication & identity. )
14
+ g.desc 'This method checks authentication and tells "you" who you are, even if you might be a bot.'
15
+ g.long_desc %( This method checks authentication and tells "you" who you are, even if you might be a bot. )
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 'Gets information about a bot user.'
6
- g.long_desc %( Gets information about a bot user. )
5
+ g.desc 'This method returns extended information about a bot user.'
6
+ g.long_desc %( This method returns extended 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|
@@ -1,9 +1,9 @@
1
1
  # This file was auto-generated by lib/tasks/web.rake
2
2
 
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."
3
+ desc 'Channels methods.'
4
4
  command 'channels' do |g|
5
- g.desc 'Archives a channel.'
6
- g.long_desc %( Archives a channel. )
5
+ g.desc 'This method archives a channel.'
6
+ g.long_desc %( This method 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 'Creates a channel.'
15
- g.long_desc %( Creates a channel. )
14
+ g.desc 'This method is used to create a channel.'
15
+ g.long_desc %( This method is used to create 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.'
@@ -30,8 +30,8 @@ command 'channels' do |g|
30
30
  end
31
31
  end
32
32
 
33
- g.desc 'Fetches history of messages and events from a channel.'
34
- g.long_desc %( Fetches history of messages and events from a channel. )
33
+ g.desc 'This method returns a portion of message events from the specified public channel.'
34
+ g.long_desc %( This method returns a portion of message events from the specified public channel. )
35
35
  g.command 'history' do |c|
36
36
  c.flag 'channel', desc: 'Channel to fetch history for.'
37
37
  c.flag 'inclusive', desc: 'Include messages with latest or oldest timestamp in results.'
@@ -52,8 +52,8 @@ command 'channels' do |g|
52
52
  end
53
53
  end
54
54
 
55
- g.desc 'Gets information about a channel.'
56
- g.long_desc %( Gets information about a channel. )
55
+ g.desc 'This method returns information about a team channel.'
56
+ g.long_desc %( This method returns information about a team channel. )
57
57
  g.command 'info' do |c|
58
58
  c.flag 'channel', desc: 'Channel to get info on.'
59
59
  c.flag 'include_locale', desc: 'Set this to true to receive the locale for this channel. Defaults to false.'
@@ -62,8 +62,8 @@ command 'channels' do |g|
62
62
  end
63
63
  end
64
64
 
65
- g.desc 'Invites a user to a channel.'
66
- g.long_desc %( Invites a user to a channel. )
65
+ g.desc 'This method is used to invite a user to a channel. The calling user must be a member of the channel.'
66
+ g.long_desc %( This method is used to invite a user to a channel. The calling user must be a member of the channel. )
67
67
  g.command 'invite' do |c|
68
68
  c.flag 'channel', desc: 'Channel to invite user to.'
69
69
  c.flag 'user', desc: 'User to invite to channel.'
@@ -72,8 +72,8 @@ command 'channels' do |g|
72
72
  end
73
73
  end
74
74
 
75
- g.desc 'Joins a channel, creating it if needed.'
76
- g.long_desc %( Joins a channel, creating it if needed. )
75
+ g.desc 'This method is used to join a channel. If the channel does not exist, it is'
76
+ g.long_desc %( This method is used to join a channel. If the channel does not exist, it is created. )
77
77
  g.command 'join' do |c|
78
78
  c.flag 'name', desc: 'Name of channel to join.'
79
79
  c.flag 'validate', desc: 'Whether to return errors on invalid channel name instead of modifying it to meet the specified criteria.'
@@ -82,8 +82,8 @@ command 'channels' do |g|
82
82
  end
83
83
  end
84
84
 
85
- g.desc 'Removes a user from a channel.'
86
- g.long_desc %( Removes a user from a channel. )
85
+ g.desc 'This method allows a user to remove another member from a team channel.'
86
+ g.long_desc %( This method allows a user to remove another member from a team channel. )
87
87
  g.command 'kick' do |c|
88
88
  c.flag 'channel', desc: 'Channel to remove user from.'
89
89
  c.flag 'user', desc: 'User to remove from channel.'
@@ -92,8 +92,8 @@ command 'channels' do |g|
92
92
  end
93
93
  end
94
94
 
95
- g.desc 'Leaves a channel.'
96
- g.long_desc %( Leaves a channel. )
95
+ g.desc 'This method is used to leave a channel.'
96
+ g.long_desc %( This method is used to leave a channel. )
97
97
  g.command 'leave' do |c|
98
98
  c.flag 'channel', desc: 'Channel to leave.'
99
99
  c.action do |_global_options, options, _args|
@@ -101,8 +101,8 @@ command 'channels' do |g|
101
101
  end
102
102
  end
103
103
 
104
- g.desc 'Lists all channels in a Slack team.'
105
- g.long_desc %( Lists all channels in a Slack team. )
104
+ g.desc "Don't use this method. Use conversations.list instead."
105
+ g.long_desc %( Don't use this method. Use conversations.list instead. )
106
106
  g.command 'list' do |c|
107
107
  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."
108
108
  c.flag 'exclude_archived', desc: 'Exclude archived channels from the list.'
@@ -113,8 +113,8 @@ command 'channels' do |g|
113
113
  end
114
114
  end
115
115
 
116
- g.desc 'Sets the read cursor in a channel.'
117
- g.long_desc %( Sets the read cursor in a channel. )
116
+ g.desc 'This method moves the read cursor in a channel.'
117
+ g.long_desc %( This method moves the read cursor in a channel. )
118
118
  g.command 'mark' do |c|
119
119
  c.flag 'channel', desc: 'Channel to set reading cursor in.'
120
120
  c.flag 'ts', desc: 'Timestamp of the most recently seen message.'
@@ -123,8 +123,8 @@ command 'channels' do |g|
123
123
  end
124
124
  end
125
125
 
126
- g.desc 'Renames a channel.'
127
- g.long_desc %( Renames a channel. )
126
+ g.desc 'This method renames a team channel.'
127
+ g.long_desc %( This method renames a team channel. )
128
128
  g.command 'rename' do |c|
129
129
  c.flag 'channel', desc: 'Channel to rename.'
130
130
  c.flag 'name', desc: 'New name for channel.'
@@ -134,8 +134,8 @@ command 'channels' do |g|
134
134
  end
135
135
  end
136
136
 
137
- g.desc 'Retrieve a thread of messages posted to a channel'
138
- g.long_desc %( Retrieve a thread of messages posted to a channel )
137
+ g.desc 'This method returns an entire thread (a message plus all the messages in reply to it).'
138
+ g.long_desc %( This method returns an entire thread (a message plus all the messages in reply to it). )
139
139
  g.command 'replies' do |c|
140
140
  c.flag 'channel', desc: 'Channel to fetch thread from.'
141
141
  c.flag 'thread_ts', desc: "Unique identifier of a thread's parent message."
@@ -144,18 +144,19 @@ command 'channels' do |g|
144
144
  end
145
145
  end
146
146
 
147
- g.desc 'Sets the purpose for a channel.'
148
- g.long_desc %( Sets the purpose for a channel. )
147
+ g.desc 'This method is used to change the purpose of a channel. The calling user must be a member of the channel.'
148
+ g.long_desc %( This method is used to change the purpose of a channel. The calling user must be a member of the channel. )
149
149
  g.command 'setPurpose' do |c|
150
150
  c.flag 'channel', desc: 'Channel to set the purpose of.'
151
151
  c.flag 'purpose', desc: 'The new purpose.'
152
+ c.flag 'name_tagging', desc: 'if it is true, treat this like a message and not an unescaped thing.'
152
153
  c.action do |_global_options, options, _args|
153
154
  puts JSON.dump($client.channels_setPurpose(options))
154
155
  end
155
156
  end
156
157
 
157
- g.desc 'Sets the topic for a channel.'
158
- g.long_desc %( Sets the topic for a channel. )
158
+ g.desc 'This method is used to change the topic of a channel. The calling user must be a member of the channel.'
159
+ g.long_desc %( This method is used to change the topic of a channel. The calling user must be a member of the channel. )
159
160
  g.command 'setTopic' do |c|
160
161
  c.flag 'channel', desc: 'Channel to set the topic of.'
161
162
  c.flag 'topic', desc: 'The new topic.'
@@ -164,8 +165,8 @@ command 'channels' do |g|
164
165
  end
165
166
  end
166
167
 
167
- g.desc 'Unarchives a channel.'
168
- g.long_desc %( Unarchives a channel. )
168
+ g.desc 'This method unarchives a channel. The calling user is added to the channel.'
169
+ g.long_desc %( This method unarchives a channel. The calling user is added to the channel. )
169
170
  g.command 'unarchive' do |c|
170
171
  c.flag 'channel', desc: 'Channel to unarchive.'
171
172
  c.action do |_global_options, options, _args|
@@ -1,6 +1,6 @@
1
1
  # This file was auto-generated by lib/tasks/web.rake
2
2
 
3
- desc 'Post chat messages to Slack.'
3
+ desc 'Chat methods.'
4
4
  command 'chat' do |g|
5
5
  g.desc 'Execute a slash command in a public channel (undocumented)'
6
6
  g.long_desc %( Execute a slash command in a public channel )
@@ -13,8 +13,8 @@ command 'chat' do |g|
13
13
  end
14
14
  end
15
15
 
16
- g.desc 'Deletes a message.'
17
- g.long_desc %( Deletes a message. )
16
+ g.desc 'This method deletes a message from a channel.'
17
+ g.long_desc %( This method deletes a message from a channel. )
18
18
  g.command 'delete' do |c|
19
19
  c.flag 'channel', desc: 'Channel containing the message to be deleted.'
20
20
  c.flag 'ts', desc: 'Timestamp of the message to be deleted.'
@@ -24,8 +24,19 @@ command 'chat' do |g|
24
24
  end
25
25
  end
26
26
 
27
- g.desc 'Retrieve a permalink URL for a specific extant message'
28
- g.long_desc %( Retrieve a permalink URL for a specific extant message )
27
+ g.desc 'This method deletes a pending scheduled message before it is sent.'
28
+ g.long_desc %( This method deletes a pending scheduled message before it is sent. )
29
+ g.command 'deleteScheduledMessage' do |c|
30
+ c.flag 'channel', desc: 'The channel the scheduled_message is posting to.'
31
+ c.flag 'scheduled_message_id', desc: 'scheduled_message_id returned from call to chat.scheduleMessage.'
32
+ c.flag 'as_user', desc: 'Pass true to delete the message as the authed user with chat:write:user scope. Bot users in this context are considered authed users. If unused or false, the message will be deleted with chat:write:bot scope.'
33
+ c.action do |_global_options, options, _args|
34
+ puts JSON.dump($client.chat_deleteScheduledMessage(options))
35
+ end
36
+ end
37
+
38
+ g.desc 'Easily exchange a message timestamp and a channel ID for a friendly HTTP-based permalink to that message. Handles message threads and all conversation types.'
39
+ g.long_desc %( Easily exchange a message timestamp and a channel ID for a friendly HTTP-based permalink to that message. Handles message threads and all conversation types. )
29
40
  g.command 'getPermalink' do |c|
30
41
  c.flag 'channel', desc: 'The ID of the conversation or channel containing the message.'
31
42
  c.flag 'message_ts', desc: "A message's ts value, uniquely identifying it within a channel."
@@ -34,8 +45,8 @@ command 'chat' do |g|
34
45
  end
35
46
  end
36
47
 
37
- g.desc 'Share a me message into a channel.'
38
- g.long_desc %( Share a me message into a channel. )
48
+ g.desc 'This method sends a me message to a channel from the calling user.'
49
+ g.long_desc %( This method sends a me message to a channel from the calling user. )
39
50
  g.command 'meMessage' do |c|
40
51
  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.'
41
52
  c.flag 'text', desc: 'Text of the message to send.'
@@ -44,8 +55,8 @@ command 'chat' do |g|
44
55
  end
45
56
  end
46
57
 
47
- g.desc 'Sends an ephemeral message to a user in a channel.'
48
- g.long_desc %( Sends an ephemeral message to a user in a channel. )
58
+ g.desc 'This method posts an ephemeral message, which is visible only to the assigned user in a specific public channel, private channel, or private conversation.'
59
+ g.long_desc %( This method posts an ephemeral message, which is visible only to the assigned user in a specific public channel, private channel, or private conversation. )
49
60
  g.command 'postEphemeral' do |c|
50
61
  c.flag 'channel', desc: 'Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name.'
51
62
  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."
@@ -55,14 +66,14 @@ command 'chat' do |g|
55
66
  c.flag 'blocks', desc: 'A JSON-based array of structured blocks, presented as a URL-encoded string.'
56
67
  c.flag 'link_names', desc: 'Find and link channel names and usernames.'
57
68
  c.flag 'parse', desc: 'Change how messages are treated. Defaults to none. See below.'
58
- 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."
69
+ c.flag 'thread_ts', desc: "Provide another message's ts value to post this message in a thread. Avoid using a reply's ts value; use its parent's value instead. Ephemeral messages in threads are only shown if there is already an active thread."
59
70
  c.action do |_global_options, options, _args|
60
71
  puts JSON.dump($client.chat_postEphemeral(options))
61
72
  end
62
73
  end
63
74
 
64
- g.desc 'Sends a message to a channel.'
65
- g.long_desc %( Sends a message to a channel. )
75
+ g.desc 'This method posts a message to a public channel, private channel, or direct message/IM channel.'
76
+ g.long_desc %( This method posts a message to a public channel, private channel, or direct message/IM channel. )
66
77
  g.command 'postMessage' do |c|
67
78
  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.'
68
79
  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. Provide no more than 40,000 characters or risk truncation."
@@ -84,12 +95,32 @@ command 'chat' do |g|
84
95
  end
85
96
  end
86
97
 
87
- g.desc 'Provide custom unfurl behavior for user-posted URLs'
88
- g.long_desc %( Provide custom unfurl behavior for user-posted URLs )
98
+ g.desc 'This method schedules a message for delivery to a public channel, private channel, or direct message/IM channel at a specified time in the future.'
99
+ g.long_desc %( This method schedules a message for delivery to a public channel, private channel, or direct message/IM channel at a specified time in the future. )
100
+ g.command 'scheduleMessage' do |c|
101
+ c.flag 'channel', desc: 'Channel, private group, or DM channel to send message to. Can be an encoded ID, or a name. See below for more details.'
102
+ c.flag 'post_at', desc: 'Unix EPOCH timestamp of time in future to send the message.'
103
+ 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. Provide no more than 40,000 characters or risk truncation."
104
+ 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.'
105
+ c.flag 'attachments', desc: 'A JSON-based array of structured attachments, presented as a URL-encoded string.'
106
+ c.flag 'blocks', desc: 'A JSON-based array of structured blocks, presented as a URL-encoded string.'
107
+ c.flag 'link_names', desc: 'Find and link channel names and usernames.'
108
+ c.flag 'parse', desc: 'Change how messages are treated. Defaults to none. See below.'
109
+ 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.'
110
+ 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."
111
+ c.flag 'unfurl_links', desc: 'Pass true to enable unfurling of primarily text-based content.'
112
+ c.flag 'unfurl_media', desc: 'Pass false to disable unfurling of media content.'
113
+ c.action do |_global_options, options, _args|
114
+ puts JSON.dump($client.chat_scheduleMessage(options))
115
+ end
116
+ end
117
+
118
+ 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.'
119
+ 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. )
89
120
  g.command 'unfurl' do |c|
90
121
  c.flag 'channel', desc: 'Channel ID of the message.'
91
122
  c.flag 'ts', desc: 'Timestamp of the message to add unfurl behavior to.'
92
- c.flag 'unfurls', desc: 'URL-encoded JSON map with keys set to URLs featured in the the message, pointing to their unfurl message attachments.'
123
+ 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.'
93
124
  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.'
94
125
  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.'
95
126
  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.'
@@ -98,8 +129,8 @@ command 'chat' do |g|
98
129
  end
99
130
  end
100
131
 
101
- g.desc 'Updates a message.'
102
- g.long_desc %( Updates a message. )
132
+ g.desc 'This method updates a message in a channel. Though related to chat.postMessage, some parameters of chat.update are handled differently.'
133
+ g.long_desc %( This method updates a message in a channel. Though related to chat.postMessage, some parameters of chat.update are handled differently. )
103
134
  g.command 'update' do |c|
104
135
  c.flag 'channel', desc: 'Channel containing the message to be updated.'
105
136
  c.flag 'text', desc: "New text for the message, using the default formatting rules. It's not required when presenting attachments."