Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: slack-ruby/slack-ruby-client
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.11.1
Choose a base ref
...
head repository: slack-ruby/slack-ruby-client
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.12.0
Choose a head ref
  • 17 commits
  • 59 files changed
  • 7 contributors

Commits on Jan 23, 2018

  1. Verified

    This commit was signed with the committer’s verified signature.
    codetheweb Max Isom
    Copy the full SHA
    7731c6e View commit details
  2. Verified

    This commit was signed with the committer’s verified signature.
    codetheweb Max Isom
    Copy the full SHA
    e7d6dab View commit details

Commits on Feb 9, 2018

  1. replaces #config -> #configure

    otherwise config block is ignored
    phigrofi committed Feb 9, 2018

    Verified

    This commit was signed with the committer’s verified signature.
    codetheweb Max Isom
    Copy the full SHA
    b5d7510 View commit details
  2. Merge pull request #202 from phigrofi/master

    replaces #config -> #configure in readme
    dblock authored Feb 9, 2018

    Verified

    This commit was signed with the committer’s verified signature.
    novemberborn Mark Wubben
    Copy the full SHA
    54fed17 View commit details

Commits on Apr 29, 2018

  1. Fix 100% cpu in async examples

    This switches from the endless loop to accumulating and joining the
    threads.
    felixbuenemann committed Apr 29, 2018

    Verified

    This commit was signed with the committer’s verified signature.
    codetheweb Max Isom
    Copy the full SHA
    6ee4434 View commit details
  2. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    b384225 View commit details

Commits on Apr 30, 2018

  1. Merge pull request #206 from felixbuenemann/fix-async-example-high-cp…

    …u-usage
    
    Fix 100% CPU usage in async examples
    dblock authored Apr 30, 2018
    Copy the full SHA
    07a854d View commit details

Commits on May 7, 2018

  1. update web api (#207)

    * update web api
    
    * add changelog entry
    
    * add another changelog entry
    jmanian authored and dblock committed May 7, 2018
    Copy the full SHA
    f0f0de4 View commit details

Commits on Jun 17, 2018

  1. Copy the full SHA
    018dcfd View commit details

Commits on Aug 18, 2018

  1. Copy the full SHA
    98340a9 View commit details
  2. Copy the full SHA
    d8b7b26 View commit details

Commits on Aug 20, 2018

  1. Upgraded Rubocop to 0.58.2.

    dblock committed Aug 20, 2018
    Copy the full SHA
    457a86d View commit details
  2. Copy the full SHA
    608e7a7 View commit details
  3. Merge pull request #217 from dblock/upgrade-rubocop

    Upgrade rubocop, stop testing ruby 2.1
    dblock authored Aug 20, 2018
    Copy the full SHA
    d239896 View commit details
  4. Copy the full SHA
    c7a067d View commit details

Commits on Aug 21, 2018

  1. Merge pull request #216 from dblock/fix-208

    Handle Errno::ECONNRESET and empty buffer reads with celluloid-io
    dblock authored Aug 21, 2018
    Copy the full SHA
    51e5522 View commit details
  2. Preparing for release, 0.12.0.

    dblock committed Aug 21, 2018
    Copy the full SHA
    7008d81 View commit details
Showing with 563 additions and 159 deletions.
  1. +9 −0 .rubocop.yml
  2. +39 −47 .rubocop_todo.yml
  3. +2 −2 .travis.yml
  4. +13 −1 CHANGELOG.md
  5. +0 −1 Gemfile
  6. +5 −5 README.md
  7. +1 −1 RELEASING.md
  8. +3 −0 bin/commands.rb
  9. +14 −0 bin/commands/apps_permissions_resources.rb
  10. +12 −0 bin/commands/apps_permissions_scopes.rb
  11. +25 −0 bin/commands/apps_permissions_users.rb
  12. +3 −2 bin/commands/chat.rb
  13. +1 −0 bin/commands/conversations.rb
  14. +4 −1 bin/commands/files.rb
  15. +2 −0 bin/commands/groups.rb
  16. +2 −0 bin/commands/mpim.rb
  17. +3 −2 bin/commands/oauth.rb
  18. +2 −0 bin/commands/reactions.rb
  19. +4 −2 bin/commands/rtm.rb
  20. +2 −2 bin/commands/search.rb
  21. +2 −0 bin/commands/stars.rb
  22. +16 −3 bin/commands/users.rb
  23. +1 −1 bin/commands/users_profile.rb
  24. +3 −4 examples/hi_real_time_async_celluloid/hi.rb
  25. +3 −4 examples/hi_real_time_async_eventmachine/hi.rb
  26. +0 −1 lib/slack/messages/formatting.rb
  27. +3 −2 lib/slack/real_time/concurrency/celluloid.rb
  28. +10 −0 lib/slack/real_time/stores/starter.rb
  29. +10 −0 lib/slack/real_time/stores/store.rb
  30. +1 −1 lib/slack/version.rb
  31. +6 −0 lib/slack/web/api/endpoints.rb
  32. +30 −0 lib/slack/web/api/endpoints/apps_permissions_resources.rb
  33. +20 −0 lib/slack/web/api/endpoints/apps_permissions_scopes.rb
  34. +49 −0 lib/slack/web/api/endpoints/apps_permissions_users.rb
  35. +5 −3 lib/slack/web/api/endpoints/chat.rb
  36. +2 −0 lib/slack/web/api/endpoints/conversations.rb
  37. +14 −2 lib/slack/web/api/endpoints/files.rb
  38. +11 −1 lib/slack/web/api/endpoints/groups.rb
  39. +11 −1 lib/slack/web/api/endpoints/mpim.rb
  40. +3 −1 lib/slack/web/api/endpoints/oauth.rb
  41. +11 −1 lib/slack/web/api/endpoints/reactions.rb
  42. +5 −1 lib/slack/web/api/endpoints/rtm.rb
  43. +2 −2 lib/slack/web/api/endpoints/search.rb
  44. +11 −1 lib/slack/web/api/endpoints/stars.rb
  45. +28 −2 lib/slack/web/api/endpoints/users.rb
  46. +1 −1 lib/slack/web/api/endpoints/users_profile.rb
  47. +13 −0 lib/slack/web/api/patches/chat.5.postEphemeral-text-or-attachments.patch
  48. +1 −1 lib/slack/web/api/slack-api-ref
  49. +1 −1 slack-ruby-client.gemspec
  50. +0 −1 spec/slack/messages/formatting_spec.rb
  51. +79 −35 spec/slack/real_time/concurrency/celluloid_spec.rb
  52. +2 −2 spec/slack/slack_spec.rb
  53. +7 −0 spec/slack/web/api/endpoints/apps_permissions_resources_spec.rb
  54. +7 −0 spec/slack/web/api/endpoints/apps_permissions_scopes_spec.rb
  55. +18 −0 spec/slack/web/api/endpoints/apps_permissions_users_spec.rb
  56. +6 −2 spec/slack/web/api/endpoints/custom_specs/chat_spec.rb
  57. +8 −6 spec/slack/web/api/mixins/channels_spec.rb
  58. +8 −6 spec/slack/web/api/mixins/groups_spec.rb
  59. +9 −7 spec/slack/web/api/mixins/users_spec.rb
9 changes: 9 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -3,6 +3,15 @@ AllCops:
- vendor/**/*
- lib/slack/web/api/slack-api-ref/**/*

Metrics:
Enabled: false

Metrics/LineLength:
Max: 512

Style/Documentation:
Enabled: false

Naming/MethodName:
Enabled: false

86 changes: 39 additions & 47 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2017-11-25 11:28:32 -0500 using RuboCop version 0.51.0.
# on 2018-08-20 08:24:54 -0400 using RuboCop version 0.58.2.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
@@ -14,60 +14,40 @@ Lint/HandleExceptions:
- 'spec/slack/real_time/concurrency/eventmachine_spec.rb'

# Offense count: 1
Lint/RescueWithoutErrorClass:
# Configuration parameters: EnforcedStyleForLeadingUnderscores.
# SupportedStylesForLeadingUnderscores: disallowed, required, optional
Naming/MemoizedInstanceVariableName:
Exclude:
- 'lib/slack/real_time/concurrency/celluloid.rb'

# Offense count: 18
Metrics/AbcSize:
Max: 44

# Offense count: 81
# Configuration parameters: CountComments, ExcludedMethods.
Metrics/BlockLength:
Max: 421
- 'lib/slack/logger.rb'

# Offense count: 2
# Configuration parameters: CountComments.
Metrics/ClassLength:
Max: 166

# Offense count: 4
Metrics/CyclomaticComplexity:
Max: 9

# Offense count: 741
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
# URISchemes: http, https
Metrics/LineLength:
Max: 266

# Offense count: 10
# Configuration parameters: CountComments.
Metrics/MethodLength:
Max: 42
# Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
# AllowedNames: io, id, to, by, on, in, at, ip
Naming/UncommunicativeMethodParamName:
Exclude:
- 'spec/support/queue_with_timeout.rb'

# Offense count: 1
# Configuration parameters: CountComments.
Metrics/ModuleLength:
Max: 113

# Offense count: 3
Metrics/PerceivedComplexity:
Max: 11
Security/Open:
Exclude:
- 'lib/slack/real_time/client.rb'

# Offense count: 1
# Configuration parameters: ExpectMatchingDefinition, Regex, IgnoreExecutableScripts, AllowedAcronyms.
# 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
Naming/FileName:
# Offense count: 2
# Configuration parameters: EnforcedStyle.
# SupportedStyles: inline, group
Style/AccessModifierDeclarations:
Exclude:
- 'lib/slack-ruby-client.rb'
- 'lib/slack/real_time/concurrency/eventmachine.rb'
- 'lib/slack/real_time/socket.rb'

# Offense count: 63
Style/Documentation:
Enabled: false
# Offense count: 2
# Cop supports --auto-correct.
Style/ExpandPathArguments:
Exclude:
- 'bin/slack'
- 'slack-ruby-client.gemspec'

# Offense count: 137
# Offense count: 152
# Configuration parameters: AllowedVariables.
Style/GlobalVars:
Enabled: false
@@ -79,8 +59,14 @@ Style/GuardClause:
- 'lib/slack/real_time/stores/store.rb'
- 'lib/slack/web/faraday/response/raise_error.rb'

# Offense count: 1
Style/MixinUsage:
Exclude:
- 'bin/slack'

# Offense count: 3
# Configuration parameters: EnforcedStyle, SupportedStyles.
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: module_function, extend_self
Style/ModuleFunction:
Exclude:
@@ -92,3 +78,9 @@ Style/ModuleFunction:
Style/MultilineTernaryOperator:
Exclude:
- 'spec/support/real_time/connected_client.rb'

# Offense count: 1
# Cop supports --auto-correct.
Style/RandomWithOffset:
Exclude:
- 'spec/integration/integration_spec.rb'
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -4,8 +4,8 @@ cache: bundler

rvm:
- 2.2
- 2.1
- 2.3.4
- 2.3
- 2.5
- ruby-head
- jruby-head

14 changes: 13 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
### 0.11.1 (1/23/2017)
### 0.12.0 (8/20/2018)

* [#216](https://github.com/slack-ruby/slack-ruby-client/pull/216): Handle `Errno::ECONNRESET` and empty buffer reads with celluloid-io - [@dblock](https://github.com/dblock).
* [#215](https://github.com/slack-ruby/slack-ruby-client/pull/215): Web API `groups_list`, `files_info`, `mpim_list`, `reactions_list` and `stars_list` now support cursor pagination - [@hotwatermorning](https://github.com/hotwatermorning).
* [#215](https://github.com/slack-ruby/slack-ruby-client/pull/215): Added `apps_permissions_users_list` and `apps_permissions_users_request` - [@hotwatermorning](https://github.com/hotwatermorning).
* [#209](https://github.com/slack-ruby/slack-ruby-client/pull/209): Changed `chat_postEphemeral`to check for existence of either `text` or `attachments` - [@peterzhu2118](https://github.com/peterzhu2118).
* [#207](https://github.com/slack-ruby/slack-ruby-client/pull/207): Added `apps_permissions_resources_list` and `apps_permissions_scopes_list` - [@jmanian](https://github.com/jmanian).
* [#207](https://github.com/slack-ruby/slack-ruby-client/pull/207): Added `users_conversations` - [@jmanian](https://github.com/jmanian).
* [#206](https://github.com/slack-ruby/slack-ruby-client/pull/206): Fix 100% cpu usage in async examples - [@felixbuenemann](https://github.com/felixbuenemann).
* [#217](https://github.com/slack-ruby/slack-ruby-client/pull/217): Upgraded RuboCop to 0.58.2 - [@dblock](https://github.com/dblock).
* [#217](https://github.com/slack-ruby/slack-ruby-client/pull/217): No longer tested with Ruby 2.1, added 2.5 - [@dblock](https://github.com/dblock).

### 0.11.1 (1/23/2018)

* [#187](https://github.com/slack-ruby/slack-ruby-client/pull/187): Concatenate error message when multiple errors present - [@chrislopresto](https://github.com/chrislopresto).
* [#188](https://github.com/slack-ruby/slack-ruby-client/pull/188): Fixed `NoMethodError` when Slack is unavailable - [@sonicdoe](https://github.com/sonicdoe).
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -3,7 +3,6 @@ source 'http://rubygems.org'
gemspec

gem ENV['CONCURRENCY'], require: false if ENV.key?('CONCURRENCY')
# rubocop:enable Bundler/OrderedGems

gem 'activesupport', '~> 4.0'
gem 'picky' unless RUBY_PLATFORM == 'java'
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@ A Ruby client for the Slack [Web](https://api.slack.com/web) and [RealTime Messa

## Stable Release

You're reading the documentation for the **stable** release of slack-ruby-client. See [UPGRADING](UPGRADING.md) when upgrading from an older version.
You're reading the documentation for the **stable** release of slack-ruby-client, 0.12.0. See [UPGRADING](UPGRADING.md) when upgrading from an older version.

## Installation

@@ -153,7 +153,7 @@ Refer to the [Slack Web API Method Reference](https://api.slack.com/methods) for
You can configure the Web client either globally or via the initializer.

```ruby
Slack::Web::Client.config do |config|
Slack::Web::Client.configure do |config|
config.user_agent = 'Slack Ruby Client/1.0'
end
```
@@ -295,7 +295,7 @@ A smaller store that only stores and tracks information about the bot user, but
You can configure the RealTime client either globally or via the initializer.

```ruby
Slack::RealTime::Client.config do |config|
Slack::RealTime::Client.configure do |config|
config.websocket_ping = 42
end
```
@@ -327,7 +327,7 @@ See a fully working example in [examples/hi_real_time](examples/hi_real_time/hi.
The RealTime client uses either [rtm.start](https://api.slack.com/methods/rtm.start) or [rtm.connect](https://api.slack.com/methods/rtm.connect) to open a connection. The former retrieves a lot of team information while the latter only serves connection purposes and is preferred. You should let the library choose the right method for you based on the `store_class` used and override this behavior with `start_method` when necessary.

```ruby
Slack::RealTime::Client.config do |config|
Slack::RealTime::Client.configure do |config|
config.start_method = :rtm_start
end
```
@@ -360,7 +360,7 @@ See a fully working example in [examples/hi_real_time_and_web](examples/hi_real_
The `rtm.start` call downloads a large amount of data. For large teams, consider reducing the amount of unnecessary data downloaded with `start_options`. You may also want to increase the default timeout of 180 seconds.

```ruby
Slack::RealTime::Client.config do |config|
Slack::RealTime::Client.configure do |config|
# Return timestamp only for latest message object of each channel.
config.start_options[:simple_latest] = true
# Skip unread counts for each channel.
2 changes: 1 addition & 1 deletion RELEASING.md
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@ Change "Next" in [CHANGELOG.md](CHANGELOG.md) to the current date.

Remove the line with "Your contribution here.", since there will be no more contributions to this release.

Change `**next**` in the "Stable Release" section in README that warns users that they are reading the documentation for an unreleased version with `**stable**`.
In the "Stable Release" section of the README, change `**next**` to `**stable**` so users know that they are reading the documentation for a released version.

```
## Stable Release
3 changes: 3 additions & 0 deletions bin/commands.rb
Original file line number Diff line number Diff line change
@@ -2,6 +2,9 @@

require 'commands/api'
require 'commands/apps_permissions'
require 'commands/apps_permissions_resources'
require 'commands/apps_permissions_scopes'
require 'commands/apps_permissions_users'
require 'commands/auth'
require 'commands/bots'
require 'commands/channels'
14 changes: 14 additions & 0 deletions bin/commands/apps_permissions_resources.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# This file was auto-generated by lib/tasks/web.rake

desc 'AppsPermissionsResources methods.'
command 'apps_permissions_resources' do |g|
g.desc 'Returns list of resource grants this app has on a team.'
g.long_desc %( Returns list of resource grants this app has on a team. )
g.command 'list' do |c|
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."
c.flag 'limit', desc: 'The maximum number of items to return.'
c.action do |_global_options, options, _args|
puts JSON.dump($client.apps_permissions_resources_list(options))
end
end
end
12 changes: 12 additions & 0 deletions bin/commands/apps_permissions_scopes.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# This file was auto-generated by lib/tasks/web.rake

desc 'AppsPermissionsScopes methods.'
command 'apps_permissions_scopes' do |g|
g.desc 'Returns list of scopes this app has on a team.'
g.long_desc %( Returns list of scopes this app has on a team. )
g.command 'list' do |c|
c.action do |_global_options, options, _args|
puts JSON.dump($client.apps_permissions_scopes_list(options))
end
end
end
25 changes: 25 additions & 0 deletions bin/commands/apps_permissions_users.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# This file was auto-generated by lib/tasks/web.rake

desc 'AppsPermissionsUsers methods.'
command 'apps_permissions_users' do |g|
g.desc 'Returns list of user grants and corresponding scopes this app has on a team.'
g.long_desc %( Returns list of user grants and corresponding scopes this app has on a team. )
g.command 'list' do |c|
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."
c.flag 'limit', desc: 'The maximum number of items to return.'
c.action do |_global_options, options, _args|
puts JSON.dump($client.apps_permissions_users_list(options))
end
end

g.desc 'Enables an app to trigger a permissions modal to grant an app access to a user access scope.'
g.long_desc %( Enables an app to trigger a permissions modal to grant an app access to a user access scope. )
g.command 'request' do |c|
c.flag 'scopes', desc: 'A comma separated list of user scopes to request for.'
c.flag 'trigger_id', desc: 'Token used to trigger the request.'
c.flag 'user', desc: 'The user this scope is being requested for.'
c.action do |_global_options, options, _args|
puts JSON.dump($client.apps_permissions_users_request(options))
end
end
end
5 changes: 3 additions & 2 deletions bin/commands/chat.rb
Original file line number Diff line number Diff line change
@@ -63,12 +63,13 @@
g.long_desc %( Sends a message to a channel. )
g.command 'postMessage' do |c|
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.'
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."
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."
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.'
c.flag 'attachments', desc: 'A JSON-based array of structured attachments, presented as a URL-encoded string.'
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.'
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.'
c.flag 'link_names', desc: 'Find and link channel names and usernames.'
c.flag 'mrkdwn', desc: 'Disable Slack markup parsing by setting to false. Enabled by default.'
c.flag 'parse', desc: 'Change how messages are treated. Defaults to none. See below.'
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.'
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."
@@ -102,7 +103,7 @@
c.flag 'ts', desc: 'Timestamp of the message to be updated.'
c.flag 'as_user', desc: 'Pass true to update the message as the authed user. Bot users in this context are considered authed users.'
c.flag 'attachments', desc: 'A JSON-based array of structured attachments, presented as a URL-encoded string. This field is required when not presenting text.'
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.'
c.flag 'link_names', desc: 'Find and link channel names and usernames. Defaults to none. See below.'
c.flag 'parse', desc: 'Change how messages are treated. Defaults to client, unlike chat.postMessage. See below.'
c.action do |_global_options, options, _args|
puts JSON.dump($client.chat_update(options))
1 change: 1 addition & 0 deletions bin/commands/conversations.rb
Original file line number Diff line number Diff line change
@@ -25,6 +25,7 @@
g.command 'create' do |c|
c.flag 'name', desc: 'Name of the public or private channel to create.'
c.flag 'is_private', desc: 'Create a private channel instead of a public one.'
c.flag 'user_ids', desc: 'Required for workspace apps. A list of between 1 and 30 human users that will be added to the newly-created conversation. This argument has no effect when used by classic Slack apps.'
c.action do |_global_options, options, _args|
puts JSON.dump($client.conversations_create(options))
end
5 changes: 4 additions & 1 deletion bin/commands/files.rb
Original file line number Diff line number Diff line change
@@ -26,6 +26,8 @@
g.long_desc %( Gets information about a team file. )
g.command 'info' do |c|
c.flag 'file', desc: 'Specify a file by providing its ID.'
c.flag 'cursor', desc: "Parameter for pagination. File comments are paginated for a single file. 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 of comments. See pagination for more details."
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."
c.action do |_global_options, options, _args|
puts JSON.dump($client.files_info(options))
end
@@ -92,7 +94,8 @@
c.flag 'file', desc: 'File contents via multipart/form-data. If omitting this parameter, you must submit content.'
c.flag 'filename', desc: 'Filename of file.'
c.flag 'filetype', desc: 'A file type identifier.'
c.flag 'initial_comment', desc: 'Initial comment to add to file.'
c.flag 'initial_comment', desc: 'The message text introducing the file in specified channels.'
c.flag 'thread_ts', desc: "Provide another message's ts value to upload this file as a reply. Never use a reply's ts value; use its parent instead."
c.flag 'title', desc: 'Title of file.'
c.action do |_global_options, options, _args|
puts JSON.dump($client.files_upload(options))
2 changes: 2 additions & 0 deletions bin/commands/groups.rb
Original file line number Diff line number Diff line change
@@ -94,8 +94,10 @@
g.desc 'Lists private channels that the calling user has access to.'
g.long_desc %( Lists private channels that the calling user has access to. )
g.command 'list' do |c|
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."
c.flag 'exclude_archived', desc: "Don't return archived private channels."
c.flag 'exclude_members', desc: 'Exclude the members from each group.'
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."
c.action do |_global_options, options, _args|
puts JSON.dump($client.groups_list(options))
end
2 changes: 2 additions & 0 deletions bin/commands/mpim.rb
Original file line number Diff line number Diff line change
@@ -27,6 +27,8 @@
g.desc 'Lists multiparty direct message channels for the calling user.'
g.long_desc %( Lists multiparty direct message channels for the calling user. )
g.command 'list' do |c|
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."
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."
c.action do |_global_options, options, _args|
puts JSON.dump($client.mpim_list(options))
end
5 changes: 3 additions & 2 deletions bin/commands/oauth.rb
Original file line number Diff line number Diff line change
@@ -2,13 +2,14 @@

desc 'Oauth methods.'
command 'oauth' do |g|
g.desc 'Exchanges a temporary OAuth code for an API token.'
g.long_desc %( Exchanges a temporary OAuth code for an API token. )
g.desc 'Exchanges a temporary OAuth verifier code for an access token.'
g.long_desc %( Exchanges a temporary OAuth verifier code for an access token. )
g.command 'access' do |c|
c.flag 'client_id', desc: 'Issued when you created your application.'
c.flag 'client_secret', desc: 'Issued when you created your application.'
c.flag 'code', desc: 'The code param returned via the OAuth callback.'
c.flag 'redirect_uri', desc: 'This must match the originally submitted URI (if one was sent).'
c.flag 'single_channel', desc: 'Request the user to add your app only to a single channel.'
c.action do |_global_options, options, _args|
puts JSON.dump($client.oauth_access(options))
end
Loading