slack-ruby-client 0.14.2 → 0.15.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 +23 -7
- data/.rubocop_todo.yml +103 -43
- data/.travis.yml +0 -1
- data/CHANGELOG.md +39 -2
- data/CONTRIBUTING.md +24 -6
- data/Dangerfile +2 -1
- data/Gemfile +10 -3
- data/README.md +90 -30
- data/Rakefile +1 -0
- data/UPGRADING.md +16 -0
- data/bin/commands.rb +24 -0
- data/bin/commands/admin_apps.rb +27 -0
- data/bin/commands/admin_apps_approved.rb +17 -0
- data/bin/commands/admin_apps_requests.rb +16 -0
- data/bin/commands/admin_apps_restricted.rb +17 -0
- data/bin/commands/admin_conversations.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 +54 -0
- data/bin/commands/admin_inviteRequests.rb +36 -0
- data/bin/commands/admin_inviteRequests_approved.rb +16 -0
- data/bin/commands/admin_inviteRequests_denied.rb +16 -0
- data/bin/commands/admin_teams.rb +27 -0
- data/bin/commands/admin_teams_admins.rb +16 -0
- data/bin/commands/admin_teams_owners.rb +16 -0
- data/bin/commands/admin_teams_settings.rb +64 -0
- data/bin/commands/admin_usergroups.rb +48 -0
- data/bin/commands/admin_users.rb +97 -0
- data/bin/commands/admin_users_session.rb +16 -0
- data/bin/commands/api.rb +3 -2
- data/bin/commands/apps.rb +3 -2
- data/bin/commands/apps_permissions.rb +5 -4
- data/bin/commands/apps_permissions_resources.rb +3 -2
- data/bin/commands/apps_permissions_scopes.rb +3 -2
- data/bin/commands/apps_permissions_users.rb +5 -4
- data/bin/commands/auth.rb +5 -4
- data/bin/commands/bots.rb +3 -2
- data/bin/commands/calls.rb +52 -0
- data/bin/commands/calls_participants.rb +25 -0
- data/bin/commands/channels.rb +31 -30
- data/bin/commands/chat.rb +36 -32
- data/bin/commands/chat_scheduledMessages.rb +3 -2
- data/bin/commands/conversations.rb +36 -36
- data/bin/commands/dialog.rb +3 -2
- data/bin/commands/dnd.rb +9 -8
- data/bin/commands/emoji.rb +3 -2
- data/bin/commands/files.rb +14 -12
- data/bin/commands/files_comments.rb +3 -2
- data/bin/commands/files_remote.rb +78 -0
- data/bin/commands/groups.rb +33 -32
- data/bin/commands/im.rb +13 -12
- data/bin/commands/migration.rb +3 -2
- data/bin/commands/mpim.rb +11 -10
- data/bin/commands/oauth.rb +6 -5
- data/bin/commands/oauth_v2.rb +17 -0
- data/bin/commands/pins.rb +7 -8
- data/bin/commands/reactions.rb +10 -11
- data/bin/commands/reminders.rb +11 -10
- data/bin/commands/rtm.rb +5 -4
- data/bin/commands/search.rb +7 -6
- data/bin/commands/stars.rb +7 -6
- data/bin/commands/team.rb +10 -8
- data/bin/commands/team_profile.rb +3 -2
- data/bin/commands/usergroups.rb +11 -10
- data/bin/commands/usergroups_users.rb +5 -4
- data/bin/commands/users.rb +21 -20
- data/bin/commands/users_admin.rb +1 -0
- data/bin/commands/users_prefs.rb +1 -0
- data/bin/commands/users_profile.rb +5 -4
- data/bin/commands/views.rb +48 -0
- data/bin/slack +1 -2
- data/examples/hi_real_time/Gemfile +1 -0
- data/examples/hi_real_time/hi.rb +7 -3
- data/examples/hi_real_time_and_web/Gemfile +1 -0
- data/examples/hi_real_time_and_web/hi.rb +7 -3
- data/examples/hi_real_time_async_async/Gemfile +1 -0
- data/examples/hi_real_time_async_async/hi.rb +6 -2
- data/examples/hi_real_time_async_celluloid/Gemfile +1 -0
- data/examples/hi_real_time_async_celluloid/hi.rb +7 -3
- data/examples/hi_real_time_async_eventmachine/Gemfile +1 -0
- data/examples/hi_real_time_async_eventmachine/hi.rb +7 -3
- data/examples/hi_web/Gemfile +1 -0
- data/examples/hi_web/hi.rb +1 -0
- data/examples/new_ticket/Gemfile +1 -0
- data/examples/new_ticket/new_ticket.rb +1 -0
- data/lib/slack-ruby-client.rb +4 -4
- data/lib/slack.rb +1 -0
- data/lib/slack/config.rb +1 -0
- data/lib/slack/events/config.rb +1 -0
- data/lib/slack/events/request.rb +3 -1
- data/lib/slack/logger.rb +6 -5
- data/lib/slack/messages/formatting.rb +1 -0
- data/lib/slack/messages/message.rb +1 -4
- data/lib/slack/real_time/api/message.rb +3 -1
- data/lib/slack/real_time/api/message_id.rb +1 -0
- data/lib/slack/real_time/api/ping.rb +5 -2
- data/lib/slack/real_time/api/typing.rb +3 -1
- data/lib/slack/real_time/client.rb +46 -22
- data/lib/slack/real_time/concurrency.rb +1 -0
- data/lib/slack/real_time/concurrency/async.rb +18 -9
- data/lib/slack/real_time/concurrency/celluloid.rb +10 -4
- data/lib/slack/real_time/concurrency/eventmachine.rb +9 -6
- data/lib/slack/real_time/config.rb +6 -1
- data/lib/slack/real_time/models.rb +1 -0
- data/lib/slack/real_time/models/base.rb +1 -4
- data/lib/slack/real_time/models/bot.rb +1 -0
- data/lib/slack/real_time/models/channel.rb +1 -0
- data/lib/slack/real_time/models/group.rb +1 -0
- data/lib/slack/real_time/models/im.rb +1 -0
- data/lib/slack/real_time/models/team.rb +1 -0
- data/lib/slack/real_time/models/user.rb +1 -0
- data/lib/slack/real_time/socket.rb +16 -13
- data/lib/slack/real_time/stores.rb +1 -0
- data/lib/slack/real_time/stores/base.rb +4 -1
- data/lib/slack/real_time/stores/starter.rb +11 -0
- data/lib/slack/real_time/stores/store.rb +26 -25
- data/lib/slack/version.rb +2 -1
- data/lib/slack/web/api/endpoints.rb +48 -0
- data/lib/slack/web/api/endpoints/admin_apps.rb +42 -0
- data/lib/slack/web/api/endpoints/admin_apps_approved.rb +35 -0
- data/lib/slack/web/api/endpoints/admin_apps_requests.rb +33 -0
- data/lib/slack/web/api/endpoints/admin_apps_restricted.rb +35 -0
- data/lib/slack/web/api/endpoints/admin_conversations.rb +30 -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 +88 -0
- data/lib/slack/web/api/endpoints/admin_inviteRequests.rb +61 -0
- data/lib/slack/web/api/endpoints/admin_inviteRequests_approved.rb +33 -0
- data/lib/slack/web/api/endpoints/admin_inviteRequests_denied.rb +33 -0
- data/lib/slack/web/api/endpoints/admin_teams.rb +50 -0
- data/lib/slack/web/api/endpoints/admin_teams_admins.rb +34 -0
- data/lib/slack/web/api/endpoints/admin_teams_owners.rb +34 -0
- data/lib/slack/web/api/endpoints/admin_teams_settings.rb +99 -0
- data/lib/slack/web/api/endpoints/admin_usergroups.rb +77 -0
- data/lib/slack/web/api/endpoints/admin_users.rb +163 -0
- data/lib/slack/web/api/endpoints/admin_users_session.rb +28 -0
- data/lib/slack/web/api/endpoints/api.rb +2 -1
- data/lib/slack/web/api/endpoints/apps.rb +2 -1
- data/lib/slack/web/api/endpoints/apps_permissions.rb +3 -2
- data/lib/slack/web/api/endpoints/apps_permissions_resources.rb +2 -1
- data/lib/slack/web/api/endpoints/apps_permissions_scopes.rb +2 -1
- data/lib/slack/web/api/endpoints/apps_permissions_users.rb +3 -2
- data/lib/slack/web/api/endpoints/auth.rb +3 -2
- data/lib/slack/web/api/endpoints/bots.rb +2 -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 +44 -29
- data/lib/slack/web/api/endpoints/chat.rb +38 -31
- data/lib/slack/web/api/endpoints/chat_scheduledMessages.rb +3 -2
- data/lib/slack/web/api/endpoints/conversations.rb +34 -35
- data/lib/slack/web/api/endpoints/dialog.rb +2 -1
- data/lib/slack/web/api/endpoints/dnd.rb +6 -4
- data/lib/slack/web/api/endpoints/emoji.rb +2 -1
- data/lib/slack/web/api/endpoints/files.rb +11 -8
- data/lib/slack/web/api/endpoints/files_comments.rb +2 -1
- data/lib/slack/web/api/endpoints/files_remote.rb +127 -0
- data/lib/slack/web/api/endpoints/groups.rb +33 -18
- data/lib/slack/web/api/endpoints/im.rb +17 -12
- data/lib/slack/web/api/endpoints/migration.rb +2 -1
- data/lib/slack/web/api/endpoints/mpim.rb +16 -11
- data/lib/slack/web/api/endpoints/oauth.rb +4 -6
- data/lib/slack/web/api/endpoints/oauth_v2.rb +30 -0
- data/lib/slack/web/api/endpoints/pins.rb +8 -12
- data/lib/slack/web/api/endpoints/reactions.rb +12 -15
- data/lib/slack/web/api/endpoints/reminders.rb +6 -5
- data/lib/slack/web/api/endpoints/rtm.rb +3 -2
- data/lib/slack/web/api/endpoints/search.rb +4 -3
- data/lib/slack/web/api/endpoints/stars.rb +6 -7
- data/lib/slack/web/api/endpoints/team.rb +7 -5
- data/lib/slack/web/api/endpoints/team_profile.rb +2 -1
- data/lib/slack/web/api/endpoints/usergroups.rb +6 -5
- data/lib/slack/web/api/endpoints/usergroups_users.rb +3 -2
- data/lib/slack/web/api/endpoints/users.rb +11 -12
- data/lib/slack/web/api/endpoints/users_admin.rb +1 -0
- data/lib/slack/web/api/endpoints/users_prefs.rb +1 -0
- data/lib/slack/web/api/endpoints/users_profile.rb +3 -2
- data/lib/slack/web/api/endpoints/views.rb +97 -0
- data/lib/slack/web/api/error.rb +1 -0
- data/lib/slack/web/api/errors.rb +656 -0
- data/lib/slack/web/api/errors/slack_error.rb +14 -1
- data/lib/slack/web/api/errors/too_many_requests_error.rb +1 -0
- data/lib/slack/web/api/mixins.rb +2 -0
- data/lib/slack/web/api/mixins/channels.id.rb +1 -0
- data/lib/slack/web/api/mixins/conversations.id.rb +27 -0
- data/lib/slack/web/api/mixins/groups.id.rb +1 -0
- data/lib/slack/web/api/mixins/ids.id.rb +1 -0
- data/lib/slack/web/api/mixins/users.id.rb +1 -0
- data/lib/slack/web/api/mixins/users.search.rb +1 -0
- data/lib/slack/web/api/patches/{chat.6.block-kit-support.patch → chat.1.patch} +29 -26
- data/lib/slack/web/api/patches/views.1.view-json.patch +40 -0
- data/lib/slack/web/api/patches/views.1.views-published.patch +16 -0
- data/lib/slack/web/api/templates/command.erb +1 -0
- data/lib/slack/web/api/templates/commands.erb +1 -0
- data/lib/slack/web/api/templates/endpoints.erb +1 -0
- data/lib/slack/web/api/templates/errors.erb +20 -0
- data/lib/slack/web/api/templates/method.erb +5 -1
- data/lib/slack/web/api/templates/method_spec.erb +1 -0
- data/lib/slack/web/client.rb +2 -1
- data/lib/slack/web/config.rb +1 -0
- data/lib/slack/web/faraday/connection.rb +24 -20
- data/lib/slack/web/faraday/request.rb +1 -0
- data/lib/slack/web/faraday/response/raise_error.rb +10 -6
- data/lib/slack/web/pagination/cursor.rb +3 -2
- data/lib/slack_ruby_client.rb +1 -0
- data/lib/tasks/git.rake +1 -0
- data/lib/tasks/real_time.rake +13 -5
- data/lib/tasks/update.rake +1 -0
- data/lib/tasks/web.rake +27 -7
- data/screenshots/create-app.png +0 -0
- data/slack-ruby-client.gemspec +6 -3
- data/spec/fixtures/slack/web/channels_info.yml +108 -15
- data/spec/fixtures/slack/web/views_open_error.yml +76 -0
- data/spec/integration/integration_spec.rb +26 -23
- data/spec/slack/config_spec.rb +2 -0
- data/spec/slack/events/config_spec.rb +8 -4
- data/spec/slack/events/request_spec.rb +67 -37
- data/spec/slack/messages/formatting_spec.rb +25 -13
- data/spec/slack/real_time/api/message_spec.rb +6 -1
- data/spec/slack/real_time/api/ping_spec.rb +2 -0
- data/spec/slack/real_time/api/typing_spec.rb +5 -1
- data/spec/slack/real_time/client_spec.rb +178 -32
- data/spec/slack/real_time/concurrency/celluloid_spec.rb +11 -6
- data/spec/slack/real_time/concurrency/eventmachine_spec.rb +9 -1
- data/spec/slack/real_time/concurrency/it_behaves_like_a_realtime_socket.rb +2 -0
- data/spec/slack/real_time/event_handlers/bot_spec.rb +2 -1
- data/spec/slack/real_time/event_handlers/channel_spec.rb +9 -6
- data/spec/slack/real_time/event_handlers/event_handlers_spec.rb +2 -1
- data/spec/slack/real_time/event_handlers/group_spec.rb +5 -4
- data/spec/slack/real_time/event_handlers/im_spec.rb +4 -3
- data/spec/slack/real_time/event_handlers/team_spec.rb +3 -1
- data/spec/slack/real_time/event_handlers/user_spec.rb +1 -0
- data/spec/slack/real_time/rtm_connect_spec.rb +1 -0
- data/spec/slack/real_time/rtm_start_spec.rb +1 -0
- data/spec/slack/real_time/store_spec.rb +2 -1
- data/spec/slack/slack_spec.rb +37 -5
- data/spec/slack/version_spec.rb +2 -1
- data/spec/slack/web/api/endpoints/admin_apps_approved_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/admin_apps_requests_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/admin_apps_restricted_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/admin_apps_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/admin_conversations_restrictAccess_spec.rb +32 -0
- data/spec/slack/web/api/endpoints/admin_conversations_spec.rb +13 -0
- data/spec/slack/web/api/endpoints/admin_conversations_whitelist_spec.rb +32 -0
- data/spec/slack/web/api/endpoints/admin_emoji_spec.rb +37 -0
- data/spec/slack/web/api/endpoints/admin_inviteRequests_approved_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/admin_inviteRequests_denied_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/admin_inviteRequests_spec.rb +18 -0
- data/spec/slack/web/api/endpoints/admin_teams_admins_spec.rb +13 -0
- data/spec/slack/web/api/endpoints/admin_teams_owners_spec.rb +13 -0
- data/spec/slack/web/api/endpoints/admin_teams_settings_spec.rb +53 -0
- data/spec/slack/web/api/endpoints/admin_teams_spec.rb +16 -0
- data/spec/slack/web/api/endpoints/admin_usergroups_spec.rb +37 -0
- data/spec/slack/web/api/endpoints/admin_users_session_spec.rb +13 -0
- data/spec/slack/web/api/endpoints/admin_users_spec.rb +75 -0
- data/spec/slack/web/api/endpoints/api_spec.rb +1 -0
- data/spec/slack/web/api/endpoints/apps_permissions_resources_spec.rb +1 -0
- data/spec/slack/web/api/endpoints/apps_permissions_scopes_spec.rb +1 -0
- data/spec/slack/web/api/endpoints/apps_permissions_spec.rb +3 -2
- data/spec/slack/web/api/endpoints/apps_permissions_users_spec.rb +4 -3
- data/spec/slack/web/api/endpoints/apps_spec.rb +1 -0
- data/spec/slack/web/api/endpoints/bots_spec.rb +1 -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/chat_scheduledMessages_spec.rb +1 -0
- data/spec/slack/web/api/endpoints/conversations_spec.rb +2 -1
- data/spec/slack/web/api/endpoints/custom_specs/auth_spec.rb +5 -1
- data/spec/slack/web/api/endpoints/custom_specs/channels_spec.rb +5 -3
- data/spec/slack/web/api/endpoints/custom_specs/chat_spec.rb +80 -25
- data/spec/slack/web/api/endpoints/custom_specs/dialog_spec.rb +12 -4
- data/spec/slack/web/api/endpoints/custom_specs/groups_spec.rb +2 -0
- data/spec/slack/web/api/endpoints/custom_specs/users_spec.rb +6 -1
- data/spec/slack/web/api/endpoints/custom_specs/views_spec.rb +95 -0
- data/spec/slack/web/api/endpoints/dnd_spec.rb +6 -0
- data/spec/slack/web/api/endpoints/emoji_spec.rb +1 -0
- data/spec/slack/web/api/endpoints/files_comments_spec.rb +1 -0
- data/spec/slack/web/api/endpoints/files_remote_spec.rb +24 -0
- data/spec/slack/web/api/endpoints/files_spec.rb +1 -0
- data/spec/slack/web/api/endpoints/im_spec.rb +1 -0
- data/spec/slack/web/api/endpoints/migration_spec.rb +1 -0
- data/spec/slack/web/api/endpoints/mpim_spec.rb +1 -0
- data/spec/slack/web/api/endpoints/oauth_spec.rb +1 -11
- data/spec/slack/web/api/endpoints/oauth_v2_spec.rb +13 -0
- data/spec/slack/web/api/endpoints/pins_spec.rb +5 -1
- data/spec/slack/web/api/endpoints/reactions_spec.rb +8 -1
- data/spec/slack/web/api/endpoints/reminders_spec.rb +1 -0
- data/spec/slack/web/api/endpoints/rtm_spec.rb +1 -0
- data/spec/slack/web/api/endpoints/search_spec.rb +1 -0
- data/spec/slack/web/api/endpoints/stars_spec.rb +1 -0
- data/spec/slack/web/api/endpoints/team_profile_spec.rb +1 -0
- data/spec/slack/web/api/endpoints/team_spec.rb +1 -0
- data/spec/slack/web/api/endpoints/usergroups_spec.rb +1 -0
- data/spec/slack/web/api/endpoints/usergroups_users_spec.rb +1 -0
- data/spec/slack/web/api/endpoints/users_admin_spec.rb +1 -0
- data/spec/slack/web/api/endpoints/users_prefs_spec.rb +1 -0
- data/spec/slack/web/api/endpoints/users_profile_spec.rb +1 -0
- data/spec/slack/web/api/endpoints/views_spec.rb +29 -0
- data/spec/slack/web/api/error_spec.rb +4 -2
- data/spec/slack/web/api/errors/service_unavailable_spec.rb +8 -5
- data/spec/slack/web/api/errors/slack_error_spec.rb +26 -2
- data/spec/slack/web/api/mixins/channels_spec.rb +17 -7
- data/spec/slack/web/api/mixins/conversations_spec.rb +41 -0
- data/spec/slack/web/api/mixins/groups_spec.rb +17 -7
- data/spec/slack/web/api/mixins/users_spec.rb +17 -8
- data/spec/slack/web/api/pagination/cursor_spec.rb +40 -10
- data/spec/slack/web/client_spec.rb +71 -18
- data/spec/slack/web/faraday/response/raise_error_spec.rb +41 -7
- data/spec/spec_helper.rb +2 -1
- data/spec/support/queue_with_timeout.rb +1 -0
- data/spec/support/real_time/concurrency/mock.rb +1 -0
- data/spec/support/real_time/connected_client.rb +9 -3
- data/spec/support/real_time/event.rb +1 -0
- data/spec/support/token.rb +1 -0
- data/spec/support/vcr.rb +1 -0
- metadata +156 -30
- 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 -13
- data/screenshots/register-bot.png +0 -0
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
# This file was auto-generated by lib/tasks/web.rake
|
2
3
|
|
3
4
|
module Slack
|
@@ -18,13 +19,13 @@ module Slack
|
|
18
19
|
def chat_command(options = {})
|
19
20
|
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
20
21
|
throw ArgumentError.new('Required arguments :command missing') if options[:command].nil?
|
21
|
-
options = options.merge(channel:
|
22
|
+
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
22
23
|
logger.warn('The chat.command method is undocumented.')
|
23
24
|
post('chat.command', options)
|
24
25
|
end
|
25
26
|
|
26
27
|
#
|
27
|
-
#
|
28
|
+
# Deletes a message.
|
28
29
|
#
|
29
30
|
# @option options [channel] :channel
|
30
31
|
# Channel containing the message to be deleted.
|
@@ -37,12 +38,12 @@ module Slack
|
|
37
38
|
def chat_delete(options = {})
|
38
39
|
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
39
40
|
throw ArgumentError.new('Required arguments :ts missing') if options[:ts].nil?
|
40
|
-
options = options.merge(channel:
|
41
|
+
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
41
42
|
post('chat.delete', options)
|
42
43
|
end
|
43
44
|
|
44
45
|
#
|
45
|
-
#
|
46
|
+
# Deletes a pending scheduled message from the queue.
|
46
47
|
#
|
47
48
|
# @option options [channel] :channel
|
48
49
|
# The channel the scheduled_message is posting to.
|
@@ -55,12 +56,12 @@ module Slack
|
|
55
56
|
def chat_deleteScheduledMessage(options = {})
|
56
57
|
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
57
58
|
throw ArgumentError.new('Required arguments :scheduled_message_id missing') if options[:scheduled_message_id].nil?
|
58
|
-
options = options.merge(channel:
|
59
|
+
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
59
60
|
post('chat.deleteScheduledMessage', options)
|
60
61
|
end
|
61
62
|
|
62
63
|
#
|
63
|
-
#
|
64
|
+
# Retrieve a permalink URL for a specific extant message
|
64
65
|
#
|
65
66
|
# @option options [channel] :channel
|
66
67
|
# The ID of the conversation or channel containing the message.
|
@@ -71,12 +72,12 @@ module Slack
|
|
71
72
|
def chat_getPermalink(options = {})
|
72
73
|
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
73
74
|
throw ArgumentError.new('Required arguments :message_ts missing') if options[:message_ts].nil?
|
74
|
-
options = options.merge(channel:
|
75
|
+
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
75
76
|
post('chat.getPermalink', options)
|
76
77
|
end
|
77
78
|
|
78
79
|
#
|
79
|
-
#
|
80
|
+
# Share a me message into a channel.
|
80
81
|
#
|
81
82
|
# @option options [channel] :channel
|
82
83
|
# Channel to send message to. Can be a public channel, private group or IM channel. Can be an encoded ID, or a name.
|
@@ -91,26 +92,32 @@ module Slack
|
|
91
92
|
end
|
92
93
|
|
93
94
|
#
|
94
|
-
#
|
95
|
+
# Sends an ephemeral message to a user in a channel.
|
95
96
|
#
|
97
|
+
# @option options [Object] :attachments
|
98
|
+
# A JSON-based array of structured attachments, presented as a URL-encoded string.
|
96
99
|
# @option options [channel] :channel
|
97
100
|
# Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name.
|
98
101
|
# @option options [Object] :text
|
99
|
-
#
|
102
|
+
# How this field works and whether it is required depends on other fields you use in your API call. See below for more detail.
|
100
103
|
# @option options [user] :user
|
101
104
|
# id of the user who will receive the ephemeral message. The user should be in the channel specified by the channel argument.
|
102
105
|
# @option options [Object] :as_user
|
103
106
|
# Pass true to post the message as the authed user. Defaults to true if the chat:write:bot scope is not included. Otherwise, defaults to false.
|
104
|
-
# @option options [Object] :attachments
|
105
|
-
# A JSON-based array of structured attachments, presented as a URL-encoded string.
|
106
107
|
# @option options [Object] :blocks
|
107
108
|
# A JSON-based array of structured blocks, presented as a URL-encoded string.
|
109
|
+
# @option options [Object] :icon_emoji
|
110
|
+
# 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.
|
111
|
+
# @option options [Object] :icon_url
|
112
|
+
# 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.
|
108
113
|
# @option options [Object] :link_names
|
109
114
|
# Find and link channel names and usernames.
|
110
115
|
# @option options [Object] :parse
|
111
116
|
# Change how messages are treated. Defaults to none. See below.
|
112
117
|
# @option options [Object] :thread_ts
|
113
118
|
# 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.
|
119
|
+
# @option options [Object] :username
|
120
|
+
# Set your bot's user name. Must be used in conjunction with as_user set to false, otherwise ignored. See authorship below.
|
114
121
|
# @see https://api.slack.com/methods/chat.postEphemeral
|
115
122
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/chat/chat.postEphemeral.json
|
116
123
|
def chat_postEphemeral(options = {})
|
@@ -134,22 +141,22 @@ module Slack
|
|
134
141
|
end
|
135
142
|
|
136
143
|
#
|
137
|
-
#
|
144
|
+
# Sends a message to a channel.
|
138
145
|
#
|
139
146
|
# @option options [channel] :channel
|
140
147
|
# Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name. See below for more details.
|
141
148
|
# @option options [Object] :text
|
142
|
-
#
|
149
|
+
# How this field works and whether it is required depends on other fields you use in your API call. See below for more detail.
|
143
150
|
# @option options [Object] :as_user
|
144
|
-
# Pass true to post the message as the authed user, instead of as a bot. Defaults to false. See authorship below.
|
151
|
+
# Pass true to post the message as the authed user, instead of as a bot. Defaults to false. See authorship below. This argument may not be used with newer bot tokens.
|
145
152
|
# @option options [Object] :attachments
|
146
153
|
# A JSON-based array of structured attachments, presented as a URL-encoded string.
|
147
154
|
# @option options [Object] :blocks
|
148
155
|
# A JSON-based array of structured blocks, presented as a URL-encoded string.
|
149
156
|
# @option options [Object] :icon_emoji
|
150
|
-
# 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.
|
157
|
+
# 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. This argument may not be used with newer bot tokens.
|
151
158
|
# @option options [Object] :icon_url
|
152
|
-
# 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.
|
159
|
+
# 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. This argument may not be used with newer bot tokens.
|
153
160
|
# @option options [Object] :link_names
|
154
161
|
# Find and link channel names and usernames.
|
155
162
|
# @option options [Object] :mrkdwn
|
@@ -187,16 +194,16 @@ module Slack
|
|
187
194
|
end
|
188
195
|
|
189
196
|
#
|
190
|
-
#
|
197
|
+
# Schedules a message to be sent to a channel.
|
191
198
|
#
|
192
199
|
# @option options [channel] :channel
|
193
200
|
# Channel, private group, or DM channel to send message to. Can be an encoded ID, or a name. See below for more details.
|
194
201
|
# @option options [Object] :post_at
|
195
202
|
# Unix EPOCH timestamp of time in future to send the message.
|
196
203
|
# @option options [Object] :text
|
197
|
-
#
|
204
|
+
# How this field works and whether it is required depends on other fields you use in your API call. See below for more detail.
|
198
205
|
# @option options [Object] :as_user
|
199
|
-
# Pass true to post the message as the authed user, instead of as a bot. Defaults to false. See
|
206
|
+
# Pass true to post the message as the authed user, instead of as a bot. Defaults to false. See chat.postMessage.
|
200
207
|
# @option options [Object] :attachments
|
201
208
|
# A JSON-based array of structured attachments, presented as a URL-encoded string.
|
202
209
|
# @option options [Object] :blocks
|
@@ -204,7 +211,7 @@ module Slack
|
|
204
211
|
# @option options [Object] :link_names
|
205
212
|
# Find and link channel names and usernames.
|
206
213
|
# @option options [Object] :parse
|
207
|
-
# Change how messages are treated. Defaults to none. See
|
214
|
+
# Change how messages are treated. Defaults to none. See chat.postMessage.
|
208
215
|
# @option options [Object] :reply_broadcast
|
209
216
|
# Used in conjunction with thread_ts and indicates whether reply should be made visible to everyone in the channel or conversation. Defaults to false.
|
210
217
|
# @option options [Object] :thread_ts
|
@@ -223,7 +230,7 @@ module Slack
|
|
223
230
|
end
|
224
231
|
|
225
232
|
#
|
226
|
-
#
|
233
|
+
# Provide custom unfurl behavior for user-posted URLs
|
227
234
|
#
|
228
235
|
# @option options [channel] :channel
|
229
236
|
# Channel ID of the message.
|
@@ -243,36 +250,36 @@ module Slack
|
|
243
250
|
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
244
251
|
throw ArgumentError.new('Required arguments :ts missing') if options[:ts].nil?
|
245
252
|
throw ArgumentError.new('Required arguments :unfurls missing') if options[:unfurls].nil?
|
246
|
-
options = options.merge(channel:
|
253
|
+
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
247
254
|
post('chat.unfurl', options)
|
248
255
|
end
|
249
256
|
|
250
257
|
#
|
251
|
-
#
|
258
|
+
# Updates a message.
|
252
259
|
#
|
253
260
|
# @option options [channel] :channel
|
254
261
|
# Channel containing the message to be updated.
|
255
|
-
# @option options [Object] :text
|
256
|
-
# New text for the message, using the default formatting rules. It's not required when presenting attachments.
|
257
262
|
# @option options [timestamp] :ts
|
258
263
|
# Timestamp of the message to be updated.
|
259
264
|
# @option options [Object] :as_user
|
260
265
|
# Pass true to update the message as the authed user. Bot users in this context are considered authed users.
|
261
266
|
# @option options [Object] :attachments
|
262
|
-
# A JSON-based array of structured attachments, presented as a URL-encoded string. This field is required when not presenting text.
|
267
|
+
# A JSON-based array of structured attachments, presented as a URL-encoded string. This field is required when not presenting text. If you don't include this field, the message's previous attachments will be retained. To remove previous attachments, include an empty array for this field.
|
263
268
|
# @option options [Object] :blocks
|
264
|
-
# A JSON-based array of structured blocks, presented as a URL-encoded string.
|
269
|
+
# A JSON-based array of structured blocks, presented as a URL-encoded string. If you don't include this field, the message's previous blocks will be retained. To remove previous blocks, include an empty array for this field.
|
265
270
|
# @option options [Object] :link_names
|
266
|
-
# Find and link channel names and usernames. Defaults to none.
|
271
|
+
# Find and link channel names and usernames. Defaults to none. If you do not specify a value for this field, the original value set for the message will be overwritten with the default, none.
|
267
272
|
# @option options [Object] :parse
|
268
|
-
# Change how messages are treated. Defaults to client, unlike chat.postMessage.
|
273
|
+
# Change how messages are treated. Defaults to client, unlike chat.postMessage. Accepts either none or full. If you do not specify a value for this field, the original value set for the message will be overwritten with the default, client.
|
274
|
+
# @option options [Object] :text
|
275
|
+
# New text for the message, using the default formatting rules. It's not required when presenting blocks or attachments.
|
269
276
|
# @see https://api.slack.com/methods/chat.update
|
270
277
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/chat/chat.update.json
|
271
278
|
def chat_update(options = {})
|
272
279
|
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
273
280
|
throw ArgumentError.new('Required arguments :text, :attachments or :blocks missing') if options[:text].nil? && options[:attachments].nil? && options[:blocks].nil?
|
274
281
|
throw ArgumentError.new('Required arguments :ts missing') if options[:ts].nil?
|
275
|
-
options = options.merge(channel:
|
282
|
+
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
276
283
|
# attachments must be passed as an encoded JSON string
|
277
284
|
if options.key?(:attachments)
|
278
285
|
attachments = options[:attachments]
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
# This file was auto-generated by lib/tasks/web.rake
|
2
3
|
|
3
4
|
module Slack
|
@@ -6,7 +7,7 @@ module Slack
|
|
6
7
|
module Endpoints
|
7
8
|
module ChatScheduledmessages
|
8
9
|
#
|
9
|
-
#
|
10
|
+
# Returns a list of scheduled messages.
|
10
11
|
#
|
11
12
|
# @option options [channel] :channel
|
12
13
|
# The channel of the scheduled messages.
|
@@ -21,7 +22,7 @@ module Slack
|
|
21
22
|
# @see https://api.slack.com/methods/chat.scheduledMessages.list
|
22
23
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/chat.scheduledMessages/chat.scheduledMessages.list.json
|
23
24
|
def chat_scheduledMessages_list(options = {})
|
24
|
-
options = options.merge(channel:
|
25
|
+
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
25
26
|
if block_given?
|
26
27
|
Pagination::Cursor.new(self, :chat_scheduledMessages_list, options).each do |page|
|
27
28
|
yield page
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
# This file was auto-generated by lib/tasks/web.rake
|
2
3
|
|
3
4
|
module Slack
|
@@ -6,7 +7,7 @@ module Slack
|
|
6
7
|
module Endpoints
|
7
8
|
module Conversations
|
8
9
|
#
|
9
|
-
#
|
10
|
+
# Archives a conversation.
|
10
11
|
#
|
11
12
|
# @option options [channel] :channel
|
12
13
|
# ID of conversation to archive.
|
@@ -14,12 +15,12 @@ module Slack
|
|
14
15
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.archive.json
|
15
16
|
def conversations_archive(options = {})
|
16
17
|
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
17
|
-
options = options.merge(channel:
|
18
|
+
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
18
19
|
post('conversations.archive', options)
|
19
20
|
end
|
20
21
|
|
21
22
|
#
|
22
|
-
#
|
23
|
+
# Closes a direct message or multi-person direct message.
|
23
24
|
#
|
24
25
|
# @option options [channel] :channel
|
25
26
|
# Conversation to close.
|
@@ -27,19 +28,17 @@ module Slack
|
|
27
28
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.close.json
|
28
29
|
def conversations_close(options = {})
|
29
30
|
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
30
|
-
options = options.merge(channel:
|
31
|
+
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
31
32
|
post('conversations.close', options)
|
32
33
|
end
|
33
34
|
|
34
35
|
#
|
35
|
-
#
|
36
|
+
# Initiates a public or private channel-based conversation
|
36
37
|
#
|
37
38
|
# @option options [Object] :name
|
38
39
|
# Name of the public or private channel to create.
|
39
40
|
# @option options [Object] :is_private
|
40
41
|
# Create a private channel instead of a public one.
|
41
|
-
# @option options [Object] :user_ids
|
42
|
-
# 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.
|
43
42
|
# @see https://api.slack.com/methods/conversations.create
|
44
43
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.create.json
|
45
44
|
def conversations_create(options = {})
|
@@ -48,7 +47,7 @@ module Slack
|
|
48
47
|
end
|
49
48
|
|
50
49
|
#
|
51
|
-
#
|
50
|
+
# Fetches a conversation's history of messages and events.
|
52
51
|
#
|
53
52
|
# @option options [channel] :channel
|
54
53
|
# Conversation ID to fetch history for.
|
@@ -66,7 +65,7 @@ module Slack
|
|
66
65
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.history.json
|
67
66
|
def conversations_history(options = {})
|
68
67
|
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
69
|
-
options = options.merge(channel:
|
68
|
+
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
70
69
|
if block_given?
|
71
70
|
Pagination::Cursor.new(self, :conversations_history, options).each do |page|
|
72
71
|
yield page
|
@@ -77,7 +76,7 @@ module Slack
|
|
77
76
|
end
|
78
77
|
|
79
78
|
#
|
80
|
-
#
|
79
|
+
# Retrieve information about a conversation.
|
81
80
|
#
|
82
81
|
# @option options [channel] :channel
|
83
82
|
# Conversation ID to learn more about.
|
@@ -89,28 +88,28 @@ module Slack
|
|
89
88
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.info.json
|
90
89
|
def conversations_info(options = {})
|
91
90
|
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
92
|
-
options = options.merge(channel:
|
91
|
+
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
93
92
|
post('conversations.info', options)
|
94
93
|
end
|
95
94
|
|
96
95
|
#
|
97
|
-
#
|
96
|
+
# Invites users to a channel.
|
98
97
|
#
|
99
98
|
# @option options [channel] :channel
|
100
99
|
# The ID of the public or private channel to invite user(s) to.
|
101
100
|
# @option options [Object] :users
|
102
|
-
# A comma separated list of user IDs. Up to
|
101
|
+
# A comma separated list of user IDs. Up to 1000 users may be listed.
|
103
102
|
# @see https://api.slack.com/methods/conversations.invite
|
104
103
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.invite.json
|
105
104
|
def conversations_invite(options = {})
|
106
105
|
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
107
106
|
throw ArgumentError.new('Required arguments :users missing') if options[:users].nil?
|
108
|
-
options = options.merge(channel:
|
107
|
+
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
109
108
|
post('conversations.invite', options)
|
110
109
|
end
|
111
110
|
|
112
111
|
#
|
113
|
-
#
|
112
|
+
# Joins an existing conversation.
|
114
113
|
#
|
115
114
|
# @option options [channel] :channel
|
116
115
|
# ID of conversation to join.
|
@@ -118,12 +117,12 @@ module Slack
|
|
118
117
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.join.json
|
119
118
|
def conversations_join(options = {})
|
120
119
|
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
121
|
-
options = options.merge(channel:
|
120
|
+
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
122
121
|
post('conversations.join', options)
|
123
122
|
end
|
124
123
|
|
125
124
|
#
|
126
|
-
#
|
125
|
+
# Removes a user from a conversation.
|
127
126
|
#
|
128
127
|
# @option options [channel] :channel
|
129
128
|
# ID of conversation to remove user from.
|
@@ -134,13 +133,13 @@ module Slack
|
|
134
133
|
def conversations_kick(options = {})
|
135
134
|
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
136
135
|
throw ArgumentError.new('Required arguments :user missing') if options[:user].nil?
|
137
|
-
options = options.merge(channel:
|
136
|
+
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
138
137
|
options = options.merge(user: users_id(options)['user']['id']) if options[:user]
|
139
138
|
post('conversations.kick', options)
|
140
139
|
end
|
141
140
|
|
142
141
|
#
|
143
|
-
#
|
142
|
+
# Leaves a conversation.
|
144
143
|
#
|
145
144
|
# @option options [channel] :channel
|
146
145
|
# Conversation to leave.
|
@@ -148,12 +147,12 @@ module Slack
|
|
148
147
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.leave.json
|
149
148
|
def conversations_leave(options = {})
|
150
149
|
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
151
|
-
options = options.merge(channel:
|
150
|
+
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
152
151
|
post('conversations.leave', options)
|
153
152
|
end
|
154
153
|
|
155
154
|
#
|
156
|
-
#
|
155
|
+
# Lists all channels in a Slack team.
|
157
156
|
#
|
158
157
|
# @option options [Object] :cursor
|
159
158
|
# 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.
|
@@ -176,7 +175,7 @@ module Slack
|
|
176
175
|
end
|
177
176
|
|
178
177
|
#
|
179
|
-
#
|
178
|
+
# Retrieve members of a conversation.
|
180
179
|
#
|
181
180
|
# @option options [channel] :channel
|
182
181
|
# ID of the conversation to retrieve members for.
|
@@ -188,7 +187,7 @@ module Slack
|
|
188
187
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.members.json
|
189
188
|
def conversations_members(options = {})
|
190
189
|
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
191
|
-
options = options.merge(channel:
|
190
|
+
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
192
191
|
if block_given?
|
193
192
|
Pagination::Cursor.new(self, :conversations_members, options).each do |page|
|
194
193
|
yield page
|
@@ -199,7 +198,7 @@ module Slack
|
|
199
198
|
end
|
200
199
|
|
201
200
|
#
|
202
|
-
#
|
201
|
+
# Opens or resumes a direct message or multi-person direct message.
|
203
202
|
#
|
204
203
|
# @option options [channel] :channel
|
205
204
|
# Resume a conversation by supplying an im or mpim's ID. Or provide the users field instead.
|
@@ -210,12 +209,12 @@ module Slack
|
|
210
209
|
# @see https://api.slack.com/methods/conversations.open
|
211
210
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.open.json
|
212
211
|
def conversations_open(options = {})
|
213
|
-
options = options.merge(channel:
|
212
|
+
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
214
213
|
post('conversations.open', options)
|
215
214
|
end
|
216
215
|
|
217
216
|
#
|
218
|
-
#
|
217
|
+
# Renames a conversation.
|
219
218
|
#
|
220
219
|
# @option options [channel] :channel
|
221
220
|
# ID of conversation to rename.
|
@@ -226,12 +225,12 @@ module Slack
|
|
226
225
|
def conversations_rename(options = {})
|
227
226
|
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
228
227
|
throw ArgumentError.new('Required arguments :name missing') if options[:name].nil?
|
229
|
-
options = options.merge(channel:
|
228
|
+
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
230
229
|
post('conversations.rename', options)
|
231
230
|
end
|
232
231
|
|
233
232
|
#
|
234
|
-
#
|
233
|
+
# Retrieve a thread of messages posted to a conversation
|
235
234
|
#
|
236
235
|
# @option options [channel] :channel
|
237
236
|
# Conversation ID to fetch thread from.
|
@@ -252,7 +251,7 @@ module Slack
|
|
252
251
|
def conversations_replies(options = {})
|
253
252
|
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
254
253
|
throw ArgumentError.new('Required arguments :ts missing') if options[:ts].nil?
|
255
|
-
options = options.merge(channel:
|
254
|
+
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
256
255
|
if block_given?
|
257
256
|
Pagination::Cursor.new(self, :conversations_replies, options).each do |page|
|
258
257
|
yield page
|
@@ -263,7 +262,7 @@ module Slack
|
|
263
262
|
end
|
264
263
|
|
265
264
|
#
|
266
|
-
#
|
265
|
+
# Sets the purpose for a conversation.
|
267
266
|
#
|
268
267
|
# @option options [channel] :channel
|
269
268
|
# Conversation to set the purpose of.
|
@@ -274,12 +273,12 @@ module Slack
|
|
274
273
|
def conversations_setPurpose(options = {})
|
275
274
|
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
276
275
|
throw ArgumentError.new('Required arguments :purpose missing') if options[:purpose].nil?
|
277
|
-
options = options.merge(channel:
|
276
|
+
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
278
277
|
post('conversations.setPurpose', options)
|
279
278
|
end
|
280
279
|
|
281
280
|
#
|
282
|
-
#
|
281
|
+
# Sets the topic for a conversation.
|
283
282
|
#
|
284
283
|
# @option options [channel] :channel
|
285
284
|
# Conversation to set the topic of.
|
@@ -290,12 +289,12 @@ module Slack
|
|
290
289
|
def conversations_setTopic(options = {})
|
291
290
|
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
292
291
|
throw ArgumentError.new('Required arguments :topic missing') if options[:topic].nil?
|
293
|
-
options = options.merge(channel:
|
292
|
+
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
294
293
|
post('conversations.setTopic', options)
|
295
294
|
end
|
296
295
|
|
297
296
|
#
|
298
|
-
#
|
297
|
+
# Reverses conversation archival.
|
299
298
|
#
|
300
299
|
# @option options [channel] :channel
|
301
300
|
# ID of conversation to unarchive.
|
@@ -303,7 +302,7 @@ module Slack
|
|
303
302
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.unarchive.json
|
304
303
|
def conversations_unarchive(options = {})
|
305
304
|
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
306
|
-
options = options.merge(channel:
|
305
|
+
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
307
306
|
post('conversations.unarchive', options)
|
308
307
|
end
|
309
308
|
end
|