slack-ruby-client 0.14.6 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/FUNDING.yml +1 -0
- data/.rubocop.yml +15 -3
- data/.rubocop_todo.yml +110 -38
- data/.travis.yml +2 -5
- data/CHANGELOG.md +42 -0
- data/CONTRIBUTING.md +19 -8
- data/Dangerfile +1 -1
- data/Gemfile +1 -2
- data/LICENSE.md +1 -1
- data/README.md +38 -36
- data/RELEASING.md +1 -1
- data/UPGRADING.md +62 -2
- data/bin/commands/admin_analytics.rb +16 -0
- data/bin/commands/admin_apps.rb +26 -2
- data/bin/commands/admin_apps_requests.rb +1 -0
- data/bin/commands/admin_auth_policy.rb +39 -0
- data/bin/commands/admin_barriers.rb +47 -0
- data/bin/commands/admin_conversations.rb +155 -3
- data/bin/commands/admin_conversations_ekm.rb +17 -0
- data/bin/commands/admin_conversations_restrictAccess.rb +37 -0
- data/bin/commands/admin_conversations_whitelist.rb +37 -0
- data/bin/commands/admin_emoji.rb +1 -1
- data/bin/commands/admin_teams.rb +1 -1
- data/bin/commands/admin_usergroups.rb +48 -0
- data/bin/commands/admin_users.rb +3 -2
- data/bin/commands/admin_users_session.rb +62 -0
- data/bin/commands/api.rb +0 -1
- data/bin/commands/apps_connections.rb +13 -0
- data/bin/commands/apps_event_authorizations.rb +16 -0
- data/bin/commands/apps_manifest.rb +51 -0
- data/bin/commands/auth_teams.rb +16 -0
- data/bin/commands/bots.rb +1 -0
- data/bin/commands/calls.rb +52 -0
- data/bin/commands/calls_participants.rb +25 -0
- data/bin/commands/channels.rb +1 -155
- data/bin/commands/chat.rb +17 -12
- data/bin/commands/chat_scheduledMessages.rb +1 -0
- data/bin/commands/conversations.rb +71 -3
- data/bin/commands/dnd.rb +2 -0
- data/bin/commands/files.rb +6 -4
- data/bin/commands/files_remote.rb +2 -2
- data/bin/commands/groups.rb +1 -162
- data/bin/commands/im.rb +1 -63
- data/bin/commands/migration.rb +1 -0
- data/bin/commands/mpim.rb +1 -61
- data/bin/commands/oauth.rb +0 -13
- data/bin/commands/oauth_v2.rb +13 -1
- data/bin/commands/openid_connect.rb +27 -0
- data/bin/commands/pins.rb +2 -4
- data/bin/commands/reactions.rb +1 -0
- data/bin/commands/reminders.rb +6 -0
- data/bin/commands/rtm.rb +2 -2
- data/bin/commands/search.rb +4 -0
- data/bin/commands/stars.rb +7 -6
- data/bin/commands/team.rb +3 -0
- data/bin/commands/team_billing.rb +13 -0
- data/bin/commands/team_preferences.rb +13 -0
- data/bin/commands/tooling_tokens.rb +14 -0
- data/bin/commands/usergroups.rb +5 -0
- data/bin/commands/usergroups_users.rb +2 -0
- data/bin/commands/users.rb +4 -2
- data/bin/commands/users_profile.rb +5 -5
- data/bin/commands/views.rb +2 -2
- data/bin/commands/workflows.rb +38 -0
- data/bin/commands.rb +17 -8
- data/lib/slack/config.rb +1 -2
- data/lib/slack/events/request.rb +10 -4
- data/lib/slack/messages/message.rb +0 -4
- data/lib/slack/real_time/client.rb +6 -6
- data/lib/slack/real_time/concurrency/async.rb +7 -11
- data/lib/slack/real_time/concurrency.rb +0 -2
- data/lib/slack/real_time/config.rb +5 -14
- data/lib/slack/real_time/models/base.rb +0 -4
- data/lib/slack/real_time/socket.rb +3 -4
- data/lib/slack/real_time/stores/base.rb +4 -7
- data/lib/slack/real_time/stores/starter.rb +6 -3
- data/lib/slack/real_time/stores/store.rb +5 -0
- data/lib/slack/version.rb +1 -1
- data/lib/slack/web/api/endpoints/admin_analytics.rb +28 -0
- data/lib/slack/web/api/endpoints/admin_apps.rb +42 -6
- data/lib/slack/web/api/endpoints/admin_apps_approved.rb +2 -2
- data/lib/slack/web/api/endpoints/admin_apps_requests.rb +4 -2
- data/lib/slack/web/api/endpoints/admin_apps_restricted.rb +2 -2
- data/lib/slack/web/api/endpoints/admin_auth_policy.rb +72 -0
- data/lib/slack/web/api/endpoints/admin_barriers.rb +82 -0
- data/lib/slack/web/api/endpoints/admin_conversations.rb +234 -4
- data/lib/slack/web/api/endpoints/admin_conversations_ekm.rb +35 -0
- data/lib/slack/web/api/endpoints/admin_conversations_restrictAccess.rb +61 -0
- data/lib/slack/web/api/endpoints/admin_conversations_whitelist.rb +64 -0
- data/lib/slack/web/api/endpoints/admin_emoji.rb +10 -10
- data/lib/slack/web/api/endpoints/admin_inviteRequests.rb +7 -7
- data/lib/slack/web/api/endpoints/admin_inviteRequests_approved.rb +3 -3
- data/lib/slack/web/api/endpoints/admin_inviteRequests_denied.rb +2 -2
- data/lib/slack/web/api/endpoints/admin_teams.rb +7 -7
- data/lib/slack/web/api/endpoints/admin_teams_admins.rb +2 -2
- data/lib/slack/web/api/endpoints/admin_teams_owners.rb +2 -2
- data/lib/slack/web/api/endpoints/admin_teams_settings.rb +5 -5
- data/lib/slack/web/api/endpoints/admin_usergroups.rb +77 -0
- data/lib/slack/web/api/endpoints/admin_users.rb +23 -23
- data/lib/slack/web/api/endpoints/admin_users_session.rb +97 -3
- data/lib/slack/web/api/endpoints/api.rb +1 -3
- data/lib/slack/web/api/endpoints/apps.rb +2 -2
- data/lib/slack/web/api/endpoints/apps_connections.rb +21 -0
- data/lib/slack/web/api/endpoints/apps_event_authorizations.rb +34 -0
- data/lib/slack/web/api/endpoints/apps_manifest.rb +75 -0
- data/lib/slack/web/api/endpoints/auth.rb +1 -1
- data/lib/slack/web/api/endpoints/auth_teams.rb +33 -0
- data/lib/slack/web/api/endpoints/bots.rb +3 -1
- data/lib/slack/web/api/endpoints/calls.rb +83 -0
- data/lib/slack/web/api/endpoints/calls_participants.rb +42 -0
- data/lib/slack/web/api/endpoints/channels.rb +1 -245
- data/lib/slack/web/api/endpoints/chat.rb +76 -66
- data/lib/slack/web/api/endpoints/chat_scheduledMessages.rb +5 -3
- data/lib/slack/web/api/endpoints/conversations.rb +149 -41
- data/lib/slack/web/api/endpoints/dialog.rb +2 -2
- data/lib/slack/web/api/endpoints/dnd.rb +6 -3
- data/lib/slack/web/api/endpoints/files.rb +21 -17
- data/lib/slack/web/api/endpoints/files_comments.rb +1 -1
- data/lib/slack/web/api/endpoints/files_remote.rb +23 -23
- data/lib/slack/web/api/endpoints/groups.rb +0 -253
- data/lib/slack/web/api/endpoints/im.rb +0 -101
- data/lib/slack/web/api/endpoints/migration.rb +4 -2
- data/lib/slack/web/api/endpoints/mpim.rb +0 -96
- data/lib/slack/web/api/endpoints/oauth.rb +5 -30
- data/lib/slack/web/api/endpoints/oauth_v2.rb +24 -6
- data/lib/slack/web/api/endpoints/openid_connect.rb +42 -0
- data/lib/slack/web/api/endpoints/pins.rb +7 -12
- data/lib/slack/web/api/endpoints/reactions.rb +16 -14
- data/lib/slack/web/api/endpoints/reminders.rb +17 -5
- data/lib/slack/web/api/endpoints/rtm.rb +10 -10
- data/lib/slack/web/api/endpoints/search.rb +27 -13
- data/lib/slack/web/api/endpoints/stars.rb +13 -11
- data/lib/slack/web/api/endpoints/team.rb +11 -5
- data/lib/slack/web/api/endpoints/team_billing.rb +21 -0
- data/lib/slack/web/api/endpoints/team_preferences.rb +21 -0
- data/lib/slack/web/api/endpoints/team_profile.rb +1 -1
- data/lib/slack/web/api/endpoints/tooling_tokens.rb +24 -0
- data/lib/slack/web/api/endpoints/usergroups.rb +26 -16
- data/lib/slack/web/api/endpoints/usergroups_users.rb +9 -5
- data/lib/slack/web/api/endpoints/users.rb +20 -18
- data/lib/slack/web/api/endpoints/users_profile.rb +7 -7
- data/lib/slack/web/api/endpoints/views.rb +13 -13
- data/lib/slack/web/api/endpoints/workflows.rb +61 -0
- data/lib/slack/web/api/endpoints.rb +35 -18
- data/lib/slack/web/api/errors/server_error.rb +37 -0
- data/lib/slack/web/api/errors/too_many_requests_error.rb +1 -4
- data/lib/slack/web/api/errors.rb +486 -12
- data/lib/slack/web/api/mixins/{channels.id.rb → conversations.id.rb} +3 -5
- data/lib/slack/web/api/mixins/ids.id.rb +3 -5
- data/lib/slack/web/api/mixins/users.id.rb +1 -3
- data/lib/slack/web/api/mixins.rb +1 -2
- data/lib/slack/web/api/patches/{chat.6.block-kit-support.patch → chat.1.patch} +25 -24
- data/lib/slack/web/api/templates/endpoints.erb +1 -2
- data/lib/slack/web/api/templates/method.erb +4 -1
- data/lib/slack/web/api/templates/method_spec.erb +1 -1
- data/lib/slack/web/config.rb +2 -0
- data/lib/slack/web/faraday/connection.rb +23 -20
- data/lib/slack/web/faraday/request.rb +2 -1
- data/lib/slack/web/faraday/response/raise_error.rb +12 -1
- data/lib/slack/web/faraday/response/wrap_error.rb +24 -0
- data/lib/slack/web/pagination/cursor.rb +3 -7
- data/lib/slack-ruby-client.rb +4 -4
- data/lib/tasks/web.rake +11 -3
- data/slack-ruby-client.gemspec +6 -7
- data/spec/fixtures/slack/web/429_error.yml +50 -54
- data/spec/fixtures/slack/web/auth_test_error.yml +51 -18
- data/spec/fixtures/slack/web/auth_test_success.yml +50 -26
- data/spec/fixtures/slack/web/conversations_info.yml +167 -0
- data/spec/fixtures/slack/web/conversations_setTopic.yml +84 -0
- data/spec/fixtures/slack/web/conversations_setTopic_one_page.yml +172 -0
- data/spec/fixtures/slack/web/conversations_setTopic_paginated.yml +253 -0
- data/spec/fixtures/slack/web/paginated_users_list.yml +501 -69
- data/spec/fixtures/slack/web/rtm_connect.yml +267 -30
- data/spec/fixtures/slack/web/rtm_start.yml +771 -60
- data/spec/fixtures/slack/web/users_info.yml +153 -69
- data/spec/fixtures/slack/web/users_list.yml +102 -41
- data/spec/fixtures/slack/web/views_open_error.yml +49 -42
- data/spec/slack/events/request_spec.rb +13 -8
- data/spec/slack/real_time/client_spec.rb +35 -22
- data/spec/slack/real_time/concurrency/with_concurrency_spec.rb +10 -0
- data/spec/slack/real_time/concurrency/without_concurrency_spec.rb +10 -0
- data/spec/slack/real_time/event_handlers/bot_spec.rb +1 -1
- data/spec/slack/real_time/event_handlers/channel_spec.rb +1 -1
- data/spec/slack/real_time/event_handlers/im_spec.rb +5 -5
- data/spec/slack/real_time/event_handlers/user_spec.rb +2 -2
- data/spec/slack/real_time/rtm_connect_spec.rb +1 -1
- data/spec/slack/real_time/rtm_start_spec.rb +1 -1
- data/spec/slack/slack_spec.rb +3 -1
- data/spec/slack/web/api/endpoints/admin_analytics_spec.rb +13 -0
- data/spec/slack/web/api/endpoints/admin_apps_spec.rb +10 -0
- data/spec/slack/web/api/endpoints/admin_auth_policy_spec.rb +35 -0
- data/spec/slack/web/api/endpoints/admin_barriers_spec.rb +38 -0
- data/spec/slack/web/api/endpoints/{apps_permissions_scopes_spec.rb → admin_conversations_ekm_spec.rb} +1 -1
- data/spec/slack/web/api/endpoints/admin_conversations_restrictAccess_spec.rb +32 -0
- data/spec/slack/web/api/endpoints/admin_conversations_spec.rb +85 -0
- data/spec/slack/web/api/endpoints/admin_emoji_spec.rb +6 -6
- data/spec/slack/web/api/endpoints/admin_teams_settings_spec.rb +10 -10
- data/spec/slack/web/api/endpoints/admin_teams_spec.rb +2 -2
- data/spec/slack/web/api/endpoints/admin_usergroups_spec.rb +37 -0
- data/spec/slack/web/api/endpoints/admin_users_session_spec.rb +28 -0
- data/spec/slack/web/api/endpoints/admin_users_spec.rb +15 -23
- data/spec/slack/web/api/endpoints/{apps_permissions_resources_spec.rb → apps_connections_spec.rb} +1 -1
- data/spec/slack/web/api/endpoints/apps_event_authorizations_spec.rb +13 -0
- data/spec/slack/web/api/endpoints/apps_manifest_spec.rb +36 -0
- data/spec/slack/web/api/endpoints/apps_spec.rb +2 -2
- data/spec/slack/web/api/endpoints/auth_teams_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/calls_participants_spec.rb +24 -0
- data/spec/slack/web/api/endpoints/calls_spec.rb +31 -0
- data/spec/slack/web/api/endpoints/custom_specs/auth_spec.rb +4 -6
- data/spec/slack/web/api/endpoints/custom_specs/conversations_spec.rb +13 -0
- data/spec/slack/web/api/endpoints/custom_specs/users_spec.rb +2 -2
- data/spec/slack/web/api/endpoints/dnd_spec.rb +0 -5
- data/spec/slack/web/api/endpoints/files_comments_spec.rb +2 -2
- data/spec/slack/web/api/endpoints/files_remote_spec.rb +3 -3
- data/spec/slack/web/api/endpoints/files_spec.rb +4 -4
- data/spec/slack/web/api/endpoints/oauth_spec.rb +0 -22
- data/spec/slack/web/api/endpoints/oauth_v2_spec.rb +6 -3
- data/spec/slack/web/api/endpoints/openid_connect_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/pins_spec.rb +1 -4
- data/spec/slack/web/api/endpoints/reactions_spec.rb +3 -3
- data/spec/slack/web/api/endpoints/reminders_spec.rb +2 -2
- data/spec/slack/web/api/endpoints/team_billing_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/team_preferences_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/tooling_tokens_spec.rb +13 -0
- data/spec/slack/web/api/endpoints/usergroups_users_spec.rb +2 -2
- data/spec/slack/web/api/endpoints/workflows_spec.rb +26 -0
- data/spec/slack/web/api/error_spec.rb +5 -7
- data/spec/slack/web/api/errors/slack_error_spec.rb +21 -26
- data/spec/slack/web/api/mixins/conversations_list_spec.rb +21 -0
- data/spec/slack/web/api/mixins/{channels_spec.rb → conversations_spec.rb} +8 -8
- data/spec/slack/web/api/mixins/users_spec.rb +1 -1
- data/spec/slack/web/api/pagination/cursor_spec.rb +1 -3
- data/spec/slack/web/client_spec.rb +123 -1
- data/spec/slack/web/faraday/request_spec.rb +80 -0
- data/spec/slack/web/faraday/response/raise_error_spec.rb +8 -6
- data/spec/spec_helper.rb +1 -1
- data/spec/support/real_time/connected_client.rb +1 -7
- data/spec/support/vcr.rb +36 -1
- metadata +95 -173
- data/examples/hi_real_time/Gemfile +0 -6
- data/examples/hi_real_time/hi.gif +0 -0
- data/examples/hi_real_time/hi.rb +0 -41
- data/examples/hi_real_time_async_celluloid/Gemfile +0 -7
- data/examples/hi_real_time_async_celluloid/Procfile +0 -2
- data/examples/hi_real_time_async_celluloid/hi.rb +0 -39
- data/examples/hi_real_time_async_eventmachine/Gemfile +0 -7
- data/examples/hi_real_time_async_eventmachine/Procfile +0 -2
- data/examples/hi_real_time_async_eventmachine/hi.rb +0 -39
- data/lib/slack/real_time/concurrency/celluloid.rb +0 -142
- data/lib/slack/real_time/concurrency/eventmachine.rb +0 -85
- data/lib/slack/web/api/mixins/channels.id.json +0 -20
- data/lib/slack/web/api/mixins/groups.id.json +0 -20
- data/lib/slack/web/api/mixins/groups.id.rb +0 -27
- data/lib/slack/web/api/patches/chat.1.text-attachments-required.patch +0 -13
- data/lib/slack/web/api/patches/chat.2.attachments-json.patch +0 -17
- data/lib/slack/web/api/patches/chat.3.update-attachments-support.patch +0 -21
- data/lib/slack/web/api/patches/chat.4.postEphemeral-attachments-support.patch +0 -17
- data/lib/slack/web/api/patches/chat.5.postEphemeral-text-or-attachments.patch +0 -15
- data/spec/fixtures/slack/web/503_error.yml +0 -14
- data/spec/fixtures/slack/web/channels_info.yml +0 -46
- data/spec/fixtures/slack/web/groups_info.yml +0 -43
- data/spec/slack/real_time/concurrency/celluloid_spec.rb +0 -116
- data/spec/slack/real_time/concurrency/eventmachine_spec.rb +0 -57
- data/spec/slack/web/api/endpoints/apps_permissions_spec.rb +0 -16
- data/spec/slack/web/api/endpoints/apps_permissions_users_spec.rb +0 -19
- data/spec/slack/web/api/endpoints/conversations_spec.rb +0 -101
- data/spec/slack/web/api/endpoints/custom_specs/channels_spec.rb +0 -13
- data/spec/slack/web/api/endpoints/custom_specs/groups_spec.rb +0 -13
- data/spec/slack/web/api/endpoints/im_spec.rb +0 -39
- data/spec/slack/web/api/endpoints/mpim_spec.rb +0 -39
- data/spec/slack/web/api/endpoints/views_spec.rb +0 -29
- data/spec/slack/web/api/errors/service_unavailable_spec.rb +0 -17
- data/spec/slack/web/api/mixins/groups_spec.rb +0 -43
@@ -6,6 +6,42 @@ module Slack
|
|
6
6
|
module Api
|
7
7
|
module Endpoints
|
8
8
|
module Conversations
|
9
|
+
#
|
10
|
+
# Accepts an invitation to a Slack Connect channel.
|
11
|
+
#
|
12
|
+
# @option options [string] :channel_name
|
13
|
+
# Name of the channel. If the channel does not exist already in your workspace, this name is the one that the channel will take.
|
14
|
+
# @option options [Object] :channel_id
|
15
|
+
# ID of the channel that you'd like to accept. Must provide either invite_id or channel_id.
|
16
|
+
# @option options [boolean] :free_trial_accepted
|
17
|
+
# Whether you'd like to use your workspace's free trial to begin using Slack Connect.
|
18
|
+
# @option options [Object] :invite_id
|
19
|
+
# See the shared_channel_invite_received event payload for more details on how to retrieve the ID of the invitation.
|
20
|
+
# @option options [boolean] :is_private
|
21
|
+
# Whether the channel should be private.
|
22
|
+
# @option options [string] :team_id
|
23
|
+
# The ID of the workspace to accept the channel in. If an org-level token is used to call this method, the team_id argument is required.
|
24
|
+
# @see https://api.slack.com/methods/conversations.acceptSharedInvite
|
25
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.acceptSharedInvite.json
|
26
|
+
def conversations_acceptSharedInvite(options = {})
|
27
|
+
throw ArgumentError.new('Required arguments :channel_name missing') if options[:channel_name].nil?
|
28
|
+
post('conversations.acceptSharedInvite', options)
|
29
|
+
end
|
30
|
+
|
31
|
+
#
|
32
|
+
# Approves an invitation to a Slack Connect channel
|
33
|
+
#
|
34
|
+
# @option options [Object] :invite_id
|
35
|
+
# ID of the shared channel invite to approve.
|
36
|
+
# @option options [Object] :target_team
|
37
|
+
# The team or enterprise id of the other party involved in the invitation you are approving.
|
38
|
+
# @see https://api.slack.com/methods/conversations.approveSharedInvite
|
39
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.approveSharedInvite.json
|
40
|
+
def conversations_approveSharedInvite(options = {})
|
41
|
+
throw ArgumentError.new('Required arguments :invite_id missing') if options[:invite_id].nil?
|
42
|
+
post('conversations.approveSharedInvite', options)
|
43
|
+
end
|
44
|
+
|
9
45
|
#
|
10
46
|
# Archives a conversation.
|
11
47
|
#
|
@@ -15,7 +51,7 @@ module Slack
|
|
15
51
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.archive.json
|
16
52
|
def conversations_archive(options = {})
|
17
53
|
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
18
|
-
options = options.merge(channel:
|
54
|
+
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
19
55
|
post('conversations.archive', options)
|
20
56
|
end
|
21
57
|
|
@@ -28,19 +64,19 @@ module Slack
|
|
28
64
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.close.json
|
29
65
|
def conversations_close(options = {})
|
30
66
|
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
31
|
-
options = options.merge(channel:
|
67
|
+
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
32
68
|
post('conversations.close', options)
|
33
69
|
end
|
34
70
|
|
35
71
|
#
|
36
72
|
# Initiates a public or private channel-based conversation
|
37
73
|
#
|
38
|
-
# @option options [
|
74
|
+
# @option options [string] :name
|
39
75
|
# Name of the public or private channel to create.
|
40
|
-
# @option options [
|
76
|
+
# @option options [boolean] :is_private
|
41
77
|
# Create a private channel instead of a public one.
|
42
|
-
# @option options [
|
43
|
-
#
|
78
|
+
# @option options [string] :team_id
|
79
|
+
# encoded team id to create the channel in, required if org token is used.
|
44
80
|
# @see https://api.slack.com/methods/conversations.create
|
45
81
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.create.json
|
46
82
|
def conversations_create(options = {})
|
@@ -48,18 +84,32 @@ module Slack
|
|
48
84
|
post('conversations.create', options)
|
49
85
|
end
|
50
86
|
|
87
|
+
#
|
88
|
+
# Declines a Slack Connect channel invite.
|
89
|
+
#
|
90
|
+
# @option options [Object] :invite_id
|
91
|
+
# ID of the Slack Connect invite to decline. Subscribe to the shared_channel_invite_accepted event to receive IDs of Slack Connect channel invites that have been accepted and are awaiting approval.
|
92
|
+
# @option options [Object] :target_team
|
93
|
+
# The team or enterprise id of the other party involved in the invitation you are declining.
|
94
|
+
# @see https://api.slack.com/methods/conversations.declineSharedInvite
|
95
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.declineSharedInvite.json
|
96
|
+
def conversations_declineSharedInvite(options = {})
|
97
|
+
throw ArgumentError.new('Required arguments :invite_id missing') if options[:invite_id].nil?
|
98
|
+
post('conversations.declineSharedInvite', options)
|
99
|
+
end
|
100
|
+
|
51
101
|
#
|
52
102
|
# Fetches a conversation's history of messages and events.
|
53
103
|
#
|
54
104
|
# @option options [channel] :channel
|
55
105
|
# Conversation ID to fetch history for.
|
56
|
-
# @option options [
|
106
|
+
# @option options [string] :cursor
|
57
107
|
# 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.
|
58
|
-
# @option options [
|
108
|
+
# @option options [boolean] :inclusive
|
59
109
|
# Include messages with latest or oldest timestamp in results only when either timestamp is specified.
|
60
110
|
# @option options [timestamp] :latest
|
61
|
-
# End of time range of messages to include in results.
|
62
|
-
# @option options [
|
111
|
+
# End of time range of messages to include in results. Default is the current time.
|
112
|
+
# @option options [number] :limit
|
63
113
|
# The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the users list hasn't been reached.
|
64
114
|
# @option options [timestamp] :oldest
|
65
115
|
# Start of time range of messages to include in results.
|
@@ -67,7 +117,7 @@ module Slack
|
|
67
117
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.history.json
|
68
118
|
def conversations_history(options = {})
|
69
119
|
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
70
|
-
options = options.merge(channel:
|
120
|
+
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
71
121
|
if block_given?
|
72
122
|
Pagination::Cursor.new(self, :conversations_history, options).each do |page|
|
73
123
|
yield page
|
@@ -82,15 +132,15 @@ module Slack
|
|
82
132
|
#
|
83
133
|
# @option options [channel] :channel
|
84
134
|
# Conversation ID to learn more about.
|
85
|
-
# @option options [
|
135
|
+
# @option options [boolean] :include_locale
|
86
136
|
# Set this to true to receive the locale for this conversation. Defaults to false.
|
87
|
-
# @option options [
|
137
|
+
# @option options [boolean] :include_num_members
|
88
138
|
# Set to true to include the member count for the specified conversation. Defaults to false.
|
89
139
|
# @see https://api.slack.com/methods/conversations.info
|
90
140
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.info.json
|
91
141
|
def conversations_info(options = {})
|
92
142
|
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
93
|
-
options = options.merge(channel:
|
143
|
+
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
94
144
|
post('conversations.info', options)
|
95
145
|
end
|
96
146
|
|
@@ -99,17 +149,36 @@ module Slack
|
|
99
149
|
#
|
100
150
|
# @option options [channel] :channel
|
101
151
|
# The ID of the public or private channel to invite user(s) to.
|
102
|
-
# @option options [
|
152
|
+
# @option options [string] :users
|
103
153
|
# A comma separated list of user IDs. Up to 1000 users may be listed.
|
104
154
|
# @see https://api.slack.com/methods/conversations.invite
|
105
155
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.invite.json
|
106
156
|
def conversations_invite(options = {})
|
107
157
|
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
108
158
|
throw ArgumentError.new('Required arguments :users missing') if options[:users].nil?
|
109
|
-
options = options.merge(channel:
|
159
|
+
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
110
160
|
post('conversations.invite', options)
|
111
161
|
end
|
112
162
|
|
163
|
+
#
|
164
|
+
# Sends an invitation to a Slack Connect channel
|
165
|
+
#
|
166
|
+
# @option options [channel] :channel
|
167
|
+
# ID of the channel on your team that you'd like to share.
|
168
|
+
# @option options [array] :emails
|
169
|
+
# Optional email to receive this invite. Either emails or user_ids must be provided.
|
170
|
+
# @option options [boolean] :external_limited
|
171
|
+
# Optional boolean on whether invite is to a external limited member. Defaults to true.
|
172
|
+
# @option options [array] :user_ids
|
173
|
+
# Optional user_id to receive this invite. Either emails or user_ids must be provided.
|
174
|
+
# @see https://api.slack.com/methods/conversations.inviteShared
|
175
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.inviteShared.json
|
176
|
+
def conversations_inviteShared(options = {})
|
177
|
+
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
178
|
+
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
179
|
+
post('conversations.inviteShared', options)
|
180
|
+
end
|
181
|
+
|
113
182
|
#
|
114
183
|
# Joins an existing conversation.
|
115
184
|
#
|
@@ -119,7 +188,7 @@ module Slack
|
|
119
188
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.join.json
|
120
189
|
def conversations_join(options = {})
|
121
190
|
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
122
|
-
options = options.merge(channel:
|
191
|
+
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
123
192
|
post('conversations.join', options)
|
124
193
|
end
|
125
194
|
|
@@ -135,7 +204,7 @@ module Slack
|
|
135
204
|
def conversations_kick(options = {})
|
136
205
|
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
137
206
|
throw ArgumentError.new('Required arguments :user missing') if options[:user].nil?
|
138
|
-
options = options.merge(channel:
|
207
|
+
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
139
208
|
options = options.merge(user: users_id(options)['user']['id']) if options[:user]
|
140
209
|
post('conversations.kick', options)
|
141
210
|
end
|
@@ -149,20 +218,22 @@ module Slack
|
|
149
218
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.leave.json
|
150
219
|
def conversations_leave(options = {})
|
151
220
|
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
152
|
-
options = options.merge(channel:
|
221
|
+
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
153
222
|
post('conversations.leave', options)
|
154
223
|
end
|
155
224
|
|
156
225
|
#
|
157
226
|
# Lists all channels in a Slack team.
|
158
227
|
#
|
159
|
-
# @option options [
|
228
|
+
# @option options [string] :cursor
|
160
229
|
# 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.
|
161
|
-
# @option options [
|
230
|
+
# @option options [boolean] :exclude_archived
|
162
231
|
# Set to true to exclude archived channels from the list.
|
163
|
-
# @option options [
|
232
|
+
# @option options [number] :limit
|
164
233
|
# The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the list hasn't been reached. Must be an integer no larger than 1000.
|
165
|
-
# @option options [
|
234
|
+
# @option options [string] :team_id
|
235
|
+
# encoded team id to list channels in, required if token belongs to org-wide app.
|
236
|
+
# @option options [string] :types
|
166
237
|
# Mix and match channel types by providing a comma-separated list of any combination of public_channel, private_channel, mpim, im.
|
167
238
|
# @see https://api.slack.com/methods/conversations.list
|
168
239
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.list.json
|
@@ -176,20 +247,55 @@ module Slack
|
|
176
247
|
end
|
177
248
|
end
|
178
249
|
|
250
|
+
#
|
251
|
+
# Lists shared channel invites that have been generated or received but have not been approved by all parties
|
252
|
+
#
|
253
|
+
# @option options [string] :cursor
|
254
|
+
# Set to next_cursor returned by previous call to list items in subsequent page.
|
255
|
+
# @option options [string] :team_id
|
256
|
+
# Encoded team id for the workspace to retrieve invites for, required if org token is used.
|
257
|
+
# @see https://api.slack.com/methods/conversations.listConnectInvites
|
258
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.listConnectInvites.json
|
259
|
+
def conversations_listConnectInvites(options = {})
|
260
|
+
if block_given?
|
261
|
+
Pagination::Cursor.new(self, :conversations_listConnectInvites, options).each do |page|
|
262
|
+
yield page
|
263
|
+
end
|
264
|
+
else
|
265
|
+
post('conversations.listConnectInvites', options)
|
266
|
+
end
|
267
|
+
end
|
268
|
+
|
269
|
+
#
|
270
|
+
# Sets the read cursor in a channel.
|
271
|
+
#
|
272
|
+
# @option options [channel] :channel
|
273
|
+
# Channel or conversation to set the read cursor for.
|
274
|
+
# @option options [timestamp] :ts
|
275
|
+
# Unique identifier of message you want marked as most recently seen in this conversation.
|
276
|
+
# @see https://api.slack.com/methods/conversations.mark
|
277
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.mark.json
|
278
|
+
def conversations_mark(options = {})
|
279
|
+
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
280
|
+
throw ArgumentError.new('Required arguments :ts missing') if options[:ts].nil?
|
281
|
+
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
282
|
+
post('conversations.mark', options)
|
283
|
+
end
|
284
|
+
|
179
285
|
#
|
180
286
|
# Retrieve members of a conversation.
|
181
287
|
#
|
182
288
|
# @option options [channel] :channel
|
183
289
|
# ID of the conversation to retrieve members for.
|
184
|
-
# @option options [
|
290
|
+
# @option options [string] :cursor
|
185
291
|
# 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.
|
186
|
-
# @option options [
|
292
|
+
# @option options [number] :limit
|
187
293
|
# The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the users list hasn't been reached.
|
188
294
|
# @see https://api.slack.com/methods/conversations.members
|
189
295
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.members.json
|
190
296
|
def conversations_members(options = {})
|
191
297
|
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
192
|
-
options = options.merge(channel:
|
298
|
+
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
193
299
|
if block_given?
|
194
300
|
Pagination::Cursor.new(self, :conversations_members, options).each do |page|
|
195
301
|
yield page
|
@@ -204,14 +310,16 @@ module Slack
|
|
204
310
|
#
|
205
311
|
# @option options [channel] :channel
|
206
312
|
# Resume a conversation by supplying an im or mpim's ID. Or provide the users field instead.
|
207
|
-
# @option options [
|
313
|
+
# @option options [boolean] :prevent_creation
|
314
|
+
# Do not create a direct message or multi-person direct message. This is used to see if there is an existing dm or mpdm.
|
315
|
+
# @option options [boolean] :return_im
|
208
316
|
# Boolean, indicates you want the full IM channel definition in the response.
|
209
|
-
# @option options [
|
317
|
+
# @option options [string] :users
|
210
318
|
# Comma separated lists of users. If only one user is included, this creates a 1:1 DM. The ordering of the users is preserved whenever a multi-person direct message is returned. Supply a channel when not supplying users.
|
211
319
|
# @see https://api.slack.com/methods/conversations.open
|
212
320
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.open.json
|
213
321
|
def conversations_open(options = {})
|
214
|
-
options = options.merge(channel:
|
322
|
+
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
215
323
|
post('conversations.open', options)
|
216
324
|
end
|
217
325
|
|
@@ -220,14 +328,14 @@ module Slack
|
|
220
328
|
#
|
221
329
|
# @option options [channel] :channel
|
222
330
|
# ID of conversation to rename.
|
223
|
-
# @option options [
|
331
|
+
# @option options [string] :name
|
224
332
|
# New name for conversation.
|
225
333
|
# @see https://api.slack.com/methods/conversations.rename
|
226
334
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.rename.json
|
227
335
|
def conversations_rename(options = {})
|
228
336
|
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
229
337
|
throw ArgumentError.new('Required arguments :name missing') if options[:name].nil?
|
230
|
-
options = options.merge(channel:
|
338
|
+
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
231
339
|
post('conversations.rename', options)
|
232
340
|
end
|
233
341
|
|
@@ -237,14 +345,14 @@ module Slack
|
|
237
345
|
# @option options [channel] :channel
|
238
346
|
# Conversation ID to fetch thread from.
|
239
347
|
# @option options [timestamp] :ts
|
240
|
-
# Unique identifier of a thread's parent message.
|
241
|
-
# @option options [
|
348
|
+
# Unique identifier of either a thread's parent message or a message in the thread. ts must be the timestamp of an existing message with 0 or more replies. If there are no replies then just the single message referenced by ts will return - it is just an ordinary, unthreaded message.
|
349
|
+
# @option options [string] :cursor
|
242
350
|
# 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.
|
243
|
-
# @option options [
|
351
|
+
# @option options [boolean] :inclusive
|
244
352
|
# Include messages with latest or oldest timestamp in results only when either timestamp is specified.
|
245
353
|
# @option options [timestamp] :latest
|
246
354
|
# End of time range of messages to include in results.
|
247
|
-
# @option options [
|
355
|
+
# @option options [number] :limit
|
248
356
|
# The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the users list hasn't been reached.
|
249
357
|
# @option options [timestamp] :oldest
|
250
358
|
# Start of time range of messages to include in results.
|
@@ -253,7 +361,7 @@ module Slack
|
|
253
361
|
def conversations_replies(options = {})
|
254
362
|
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
255
363
|
throw ArgumentError.new('Required arguments :ts missing') if options[:ts].nil?
|
256
|
-
options = options.merge(channel:
|
364
|
+
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
257
365
|
if block_given?
|
258
366
|
Pagination::Cursor.new(self, :conversations_replies, options).each do |page|
|
259
367
|
yield page
|
@@ -268,14 +376,14 @@ module Slack
|
|
268
376
|
#
|
269
377
|
# @option options [channel] :channel
|
270
378
|
# Conversation to set the purpose of.
|
271
|
-
# @option options [
|
379
|
+
# @option options [string] :purpose
|
272
380
|
# A new, specialer purpose.
|
273
381
|
# @see https://api.slack.com/methods/conversations.setPurpose
|
274
382
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.setPurpose.json
|
275
383
|
def conversations_setPurpose(options = {})
|
276
384
|
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
277
385
|
throw ArgumentError.new('Required arguments :purpose missing') if options[:purpose].nil?
|
278
|
-
options = options.merge(channel:
|
386
|
+
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
279
387
|
post('conversations.setPurpose', options)
|
280
388
|
end
|
281
389
|
|
@@ -284,14 +392,14 @@ module Slack
|
|
284
392
|
#
|
285
393
|
# @option options [channel] :channel
|
286
394
|
# Conversation to set the topic of.
|
287
|
-
# @option options [
|
395
|
+
# @option options [string] :topic
|
288
396
|
# The new topic string. Does not support formatting or linkification.
|
289
397
|
# @see https://api.slack.com/methods/conversations.setTopic
|
290
398
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.setTopic.json
|
291
399
|
def conversations_setTopic(options = {})
|
292
400
|
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
293
401
|
throw ArgumentError.new('Required arguments :topic missing') if options[:topic].nil?
|
294
|
-
options = options.merge(channel:
|
402
|
+
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
295
403
|
post('conversations.setTopic', options)
|
296
404
|
end
|
297
405
|
|
@@ -304,7 +412,7 @@ module Slack
|
|
304
412
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.unarchive.json
|
305
413
|
def conversations_unarchive(options = {})
|
306
414
|
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
307
|
-
options = options.merge(channel:
|
415
|
+
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
308
416
|
post('conversations.unarchive', options)
|
309
417
|
end
|
310
418
|
end
|
@@ -9,9 +9,9 @@ module Slack
|
|
9
9
|
#
|
10
10
|
# Open a dialog with a user
|
11
11
|
#
|
12
|
-
# @option options [
|
12
|
+
# @option options [string] :dialog
|
13
13
|
# The dialog definition. This must be a JSON-encoded string.
|
14
|
-
# @option options [
|
14
|
+
# @option options [string] :trigger_id
|
15
15
|
# Exchange a trigger to post to the user.
|
16
16
|
# @see https://api.slack.com/methods/dialog.open
|
17
17
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/dialog/dialog.open.json
|
@@ -27,6 +27,8 @@ module Slack
|
|
27
27
|
#
|
28
28
|
# Retrieves a user's current Do Not Disturb status.
|
29
29
|
#
|
30
|
+
# @option options [string] :team_id
|
31
|
+
# Encoded team id where passed in user param belongs, required if org token is used. If no user param is passed, then a team which has access to the app should be passed.
|
30
32
|
# @option options [user] :user
|
31
33
|
# User to fetch status for (defaults to current user).
|
32
34
|
# @see https://api.slack.com/methods/dnd.info
|
@@ -39,20 +41,21 @@ module Slack
|
|
39
41
|
#
|
40
42
|
# Turns on Do Not Disturb mode for the current user, or changes its duration.
|
41
43
|
#
|
42
|
-
# @option options [
|
44
|
+
# @option options [string] :num_minutes
|
43
45
|
# Number of minutes, from now, to snooze until.
|
44
46
|
# @see https://api.slack.com/methods/dnd.setSnooze
|
45
47
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/dnd/dnd.setSnooze.json
|
46
48
|
def dnd_setSnooze(options = {})
|
47
|
-
throw ArgumentError.new('Required arguments :num_minutes missing') if options[:num_minutes].nil?
|
48
49
|
post('dnd.setSnooze', options)
|
49
50
|
end
|
50
51
|
|
51
52
|
#
|
52
53
|
# Retrieves the Do Not Disturb status for up to 50 users on a team.
|
53
54
|
#
|
54
|
-
# @option options [
|
55
|
+
# @option options [string] :users
|
55
56
|
# Comma-separated list of users to fetch Do Not Disturb status for.
|
57
|
+
# @option options [string] :team_id
|
58
|
+
# Encoded team id where passed in users belong, required if org token is used.
|
56
59
|
# @see https://api.slack.com/methods/dnd.teamInfo
|
57
60
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/dnd/dnd.teamInfo.json
|
58
61
|
def dnd_teamInfo(options = {})
|
@@ -36,13 +36,13 @@ module Slack
|
|
36
36
|
end
|
37
37
|
|
38
38
|
#
|
39
|
-
# Gets information about a
|
39
|
+
# Gets information about a file.
|
40
40
|
#
|
41
41
|
# @option options [file] :file
|
42
42
|
# Specify a file by providing its ID.
|
43
|
-
# @option options [
|
43
|
+
# @option options [string] :cursor
|
44
44
|
# 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.
|
45
|
-
# @option options [
|
45
|
+
# @option options [integer] :limit
|
46
46
|
# 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.
|
47
47
|
# @see https://api.slack.com/methods/files.info
|
48
48
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/files/files.info.json
|
@@ -58,24 +58,28 @@ module Slack
|
|
58
58
|
end
|
59
59
|
|
60
60
|
#
|
61
|
-
#
|
61
|
+
# List for a team, in a channel, or from a user with applied filters.
|
62
62
|
#
|
63
63
|
# @option options [channel] :channel
|
64
64
|
# Filter files appearing in a specific channel, indicated by its ID.
|
65
|
-
# @option options [
|
65
|
+
# @option options [string] :files
|
66
|
+
# .
|
67
|
+
# @option options [boolean] :show_files_hidden_by_limit
|
66
68
|
# Show truncated file info for files hidden due to being too old, and the team who owns the file being over the file limit.
|
67
|
-
# @option options [
|
69
|
+
# @option options [string] :team_id
|
70
|
+
# encoded team id to list files in, required if org token is used.
|
71
|
+
# @option options [string] :ts_from
|
68
72
|
# Filter files created after this timestamp (inclusive).
|
69
|
-
# @option options [
|
73
|
+
# @option options [string] :ts_to
|
70
74
|
# Filter files created before this timestamp (inclusive).
|
71
|
-
# @option options [
|
75
|
+
# @option options [string] :types
|
72
76
|
# Filter files by type (see below). You can pass multiple values in the types argument, like types=spaces,snippets.The default value is all, which does not filter the list.
|
73
77
|
# @option options [user] :user
|
74
78
|
# Filter files created by a single user.
|
75
79
|
# @see https://api.slack.com/methods/files.list
|
76
80
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/files/files.list.json
|
77
81
|
def files_list(options = {})
|
78
|
-
options = options.merge(channel:
|
82
|
+
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
79
83
|
options = options.merge(user: users_id(options)['user']['id']) if options[:user]
|
80
84
|
post('files.list', options)
|
81
85
|
end
|
@@ -103,7 +107,7 @@ module Slack
|
|
103
107
|
def files_share(options = {})
|
104
108
|
throw ArgumentError.new('Required arguments :file missing') if options[:file].nil?
|
105
109
|
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
106
|
-
options = options.merge(channel:
|
110
|
+
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
107
111
|
logger.warn('The files.share method is undocumented.')
|
108
112
|
post('files.share', options)
|
109
113
|
end
|
@@ -123,21 +127,21 @@ module Slack
|
|
123
127
|
#
|
124
128
|
# Uploads or creates a file.
|
125
129
|
#
|
126
|
-
# @option options [
|
130
|
+
# @option options [string] :channels
|
127
131
|
# Comma-separated list of channel names or IDs where the file will be shared.
|
128
|
-
# @option options [
|
132
|
+
# @option options [string] :content
|
129
133
|
# File contents via a POST variable. If omitting this parameter, you must provide a file.
|
130
134
|
# @option options [file] :file
|
131
135
|
# File contents via multipart/form-data. If omitting this parameter, you must submit content.
|
132
|
-
# @option options [
|
136
|
+
# @option options [string] :filename
|
133
137
|
# Filename of file.
|
134
|
-
# @option options [
|
138
|
+
# @option options [string] :filetype
|
135
139
|
# A file type identifier.
|
136
|
-
# @option options [
|
140
|
+
# @option options [string] :initial_comment
|
137
141
|
# The message text introducing the file in specified channels.
|
138
|
-
# @option options [
|
142
|
+
# @option options [string] :thread_ts
|
139
143
|
# Provide another message's ts value to upload this file as a reply. Never use a reply's ts value; use its parent instead.
|
140
|
-
# @option options [
|
144
|
+
# @option options [string] :title
|
141
145
|
# Title of file.
|
142
146
|
# @see https://api.slack.com/methods/files.upload
|
143
147
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/files/files.upload.json
|
@@ -11,7 +11,7 @@ module Slack
|
|
11
11
|
#
|
12
12
|
# @option options [file] :file
|
13
13
|
# File to delete a comment from.
|
14
|
-
# @option options [
|
14
|
+
# @option options [string] :id
|
15
15
|
# The comment to delete.
|
16
16
|
# @see https://api.slack.com/methods/files.comments.delete
|
17
17
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/files.comments/files.comments.delete.json
|