slack-ruby-client 0.14.4 → 0.16.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 +104 -47
- data/.travis.yml +1 -5
- data/CHANGELOG.md +41 -2
- data/CONTRIBUTING.md +17 -6
- data/Dangerfile +2 -1
- data/Gemfile +2 -2
- data/README.md +94 -53
- data/Rakefile +1 -0
- data/UPGRADING.md +20 -2
- data/bin/commands.rb +30 -0
- data/bin/commands/admin_analytics.rb +15 -0
- data/bin/commands/admin_apps.rb +40 -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_barriers.rb +47 -0
- data/bin/commands/admin_conversations.rb +169 -0
- 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 +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 +25 -2
- data/bin/commands/api.rb +3 -3
- data/bin/commands/apps.rb +3 -2
- data/bin/commands/apps_connections.rb +13 -0
- data/bin/commands/apps_event_authorizations.rb +16 -0
- 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/auth_teams.rb +16 -0
- data/bin/commands/bots.rb +4 -2
- data/bin/commands/calls.rb +52 -0
- data/bin/commands/calls_participants.rb +25 -0
- data/bin/commands/channels.rb +37 -33
- data/bin/commands/chat.rb +34 -33
- data/bin/commands/chat_scheduledMessages.rb +4 -2
- data/bin/commands/conversations.rb +50 -38
- data/bin/commands/dialog.rb +3 -2
- data/bin/commands/dnd.rb +10 -9
- data/bin/commands/emoji.rb +3 -2
- data/bin/commands/files.rb +16 -13
- data/bin/commands/files_comments.rb +3 -2
- data/bin/commands/files_remote.rb +78 -0
- data/bin/commands/groups.rb +38 -35
- data/bin/commands/im.rb +14 -13
- data/bin/commands/migration.rb +4 -2
- data/bin/commands/mpim.rb +14 -13
- data/bin/commands/oauth.rb +6 -5
- data/bin/commands/oauth_v2.rb +17 -0
- data/bin/commands/pins.rb +7 -10
- data/bin/commands/reactions.rb +11 -11
- data/bin/commands/reminders.rb +11 -10
- data/bin/commands/rtm.rb +5 -4
- data/bin/commands/search.rb +11 -7
- data/bin/commands/stars.rb +7 -6
- data/bin/commands/team.rb +12 -8
- data/bin/commands/team_profile.rb +3 -2
- data/bin/commands/usergroups.rb +17 -11
- data/bin/commands/usergroups_users.rb +7 -4
- data/bin/commands/users.rb +26 -23
- data/bin/commands/users_admin.rb +1 -0
- data/bin/commands/users_prefs.rb +1 -0
- data/bin/commands/users_profile.rb +6 -5
- data/bin/commands/views.rb +48 -0
- data/bin/commands/workflows.rb +38 -0
- data/bin/slack +1 -2
- 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_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 +6 -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 +8 -2
- 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 +21 -13
- data/lib/slack/real_time/concurrency.rb +1 -2
- data/lib/slack/real_time/concurrency/async.rb +12 -6
- data/lib/slack/real_time/config.rb +9 -3
- 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 +1 -0
- data/lib/slack/real_time/stores/store.rb +16 -25
- data/lib/slack/version.rb +2 -1
- data/lib/slack/web/api/endpoints.rb +60 -0
- data/lib/slack/web/api/endpoints/admin_analytics.rb +26 -0
- data/lib/slack/web/api/endpoints/admin_apps.rb +62 -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_barriers.rb +82 -0
- data/lib/slack/web/api/endpoints/admin_conversations.rb +260 -0
- 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 +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 +161 -0
- data/lib/slack/web/api/endpoints/admin_users_session.rb +40 -1
- data/lib/slack/web/api/endpoints/api.rb +2 -3
- data/lib/slack/web/api/endpoints/apps.rb +2 -1
- 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_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/auth_teams.rb +33 -0
- data/lib/slack/web/api/endpoints/bots.rb +4 -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 +52 -31
- data/lib/slack/web/api/endpoints/chat.rb +31 -30
- data/lib/slack/web/api/endpoints/chat_scheduledMessages.rb +5 -2
- data/lib/slack/web/api/endpoints/conversations.rb +55 -36
- data/lib/slack/web/api/endpoints/dialog.rb +2 -1
- data/lib/slack/web/api/endpoints/dnd.rb +5 -4
- data/lib/slack/web/api/endpoints/emoji.rb +2 -1
- data/lib/slack/web/api/endpoints/files.rb +13 -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 +39 -24
- data/lib/slack/web/api/endpoints/im.rb +17 -12
- data/lib/slack/web/api/endpoints/migration.rb +4 -1
- data/lib/slack/web/api/endpoints/mpim.rb +18 -13
- 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 +7 -16
- data/lib/slack/web/api/endpoints/reactions.rb +14 -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 +10 -3
- data/lib/slack/web/api/endpoints/stars.rb +6 -7
- data/lib/slack/web/api/endpoints/team.rb +11 -5
- data/lib/slack/web/api/endpoints/team_profile.rb +2 -1
- data/lib/slack/web/api/endpoints/usergroups.rb +16 -5
- data/lib/slack/web/api/endpoints/usergroups_users.rb +7 -2
- data/lib/slack/web/api/endpoints/users.rb +18 -21
- 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 +4 -3
- data/lib/slack/web/api/endpoints/views.rb +97 -0
- data/lib/slack/web/api/endpoints/workflows.rb +61 -0
- data/lib/slack/web/api/error.rb +1 -0
- data/lib/slack/web/api/errors.rb +850 -0
- data/lib/slack/web/api/errors/internal_error.rb +14 -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 +2 -3
- data/lib/slack/web/api/mixins/conversations.id.rb +25 -0
- data/lib/slack/web/api/mixins/groups.id.rb +2 -3
- data/lib/slack/web/api/mixins/ids.id.rb +3 -2
- data/lib/slack/web/api/mixins/users.id.rb +2 -3
- 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 +2 -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 +2 -1
- data/lib/slack/web/client.rb +2 -1
- data/lib/slack/web/config.rb +3 -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 +25 -6
- data/lib/slack/web/faraday/response/wrap_error.rb +18 -0
- 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 +34 -10
- 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/conversations_setTopic.yml +69 -0
- data/spec/fixtures/slack/web/conversations_setTopic_one_page.yml +142 -0
- data/spec/fixtures/slack/web/conversations_setTopic_paginated.yml +208 -0
- data/spec/fixtures/slack/web/views_open_error.yml +76 -0
- data/spec/integration/integration_spec.rb +16 -17
- data/spec/slack/config_spec.rb +2 -0
- data/spec/slack/events/config_spec.rb +8 -4
- data/spec/slack/events/request_spec.rb +74 -40
- 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 +153 -38
- 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_analytics_spec.rb +13 -0
- 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 +13 -0
- data/spec/slack/web/api/endpoints/admin_barriers_spec.rb +38 -0
- data/spec/slack/web/api/endpoints/admin_conversations_ekm_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 +98 -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 +9 -0
- data/spec/slack/web/api/endpoints/admin_users_spec.rb +67 -0
- data/spec/slack/web/api/endpoints/api_spec.rb +1 -0
- data/spec/slack/web/api/endpoints/apps_connections_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/apps_event_authorizations_spec.rb +13 -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 +3 -2
- data/spec/slack/web/api/endpoints/auth_teams_spec.rb +8 -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 +21 -12
- 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 +1 -0
- data/spec/slack/web/api/endpoints/emoji_spec.rb +1 -0
- data/spec/slack/web/api/endpoints/files_comments_spec.rb +3 -2
- data/spec/slack/web/api/endpoints/files_remote_spec.rb +24 -0
- data/spec/slack/web/api/endpoints/files_spec.rb +5 -4
- data/spec/slack/web/api/endpoints/im_spec.rb +5 -4
- data/spec/slack/web/api/endpoints/migration_spec.rb +1 -0
- data/spec/slack/web/api/endpoints/mpim_spec.rb +5 -4
- data/spec/slack/web/api/endpoints/oauth_spec.rb +4 -14
- data/spec/slack/web/api/endpoints/oauth_v2_spec.rb +13 -0
- data/spec/slack/web/api/endpoints/pins_spec.rb +1 -0
- data/spec/slack/web/api/endpoints/reactions_spec.rb +8 -1
- data/spec/slack/web/api/endpoints/reminders_spec.rb +3 -2
- 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 +3 -2
- 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/endpoints/workflows_spec.rb +26 -0
- data/spec/slack/web/api/error_spec.rb +4 -2
- 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_list_spec.rb +21 -0
- data/spec/slack/web/api/mixins/conversations_spec.rb +43 -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 +171 -18
- data/spec/slack/web/faraday/response/raise_error_spec.rb +47 -12
- 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 +5 -0
- metadata +190 -46
- data/examples/hi_real_time/Gemfile +0 -5
- data/examples/hi_real_time/hi.gif +0 -0
- data/examples/hi_real_time/hi.rb +0 -37
- data/examples/hi_real_time_async_celluloid/Gemfile +0 -6
- data/examples/hi_real_time_async_celluloid/Procfile +0 -2
- data/examples/hi_real_time_async_celluloid/hi.rb +0 -35
- data/examples/hi_real_time_async_eventmachine/Gemfile +0 -6
- data/examples/hi_real_time_async_eventmachine/Procfile +0 -2
- data/examples/hi_real_time_async_eventmachine/hi.rb +0 -35
- data/lib/slack/real_time/concurrency/celluloid.rb +0 -136
- data/lib/slack/real_time/concurrency/eventmachine.rb +0 -82
- 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/screenshots/register-bot.png +0 -0
- data/spec/slack/real_time/concurrency/celluloid_spec.rb +0 -111
- data/spec/slack/real_time/concurrency/eventmachine_spec.rb +0 -49
- data/spec/slack/web/api/errors/service_unavailable_spec.rb +0 -14
@@ -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,14 +92,14 @@ module Slack
|
|
91
92
|
end
|
92
93
|
|
93
94
|
#
|
94
|
-
#
|
95
|
+
# Sends an ephemeral message to a user in a channel.
|
95
96
|
#
|
96
97
|
# @option options [Object] :attachments
|
97
98
|
# A JSON-based array of structured attachments, presented as a URL-encoded string.
|
98
99
|
# @option options [channel] :channel
|
99
100
|
# Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name.
|
100
101
|
# @option options [Object] :text
|
101
|
-
#
|
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.
|
102
103
|
# @option options [user] :user
|
103
104
|
# id of the user who will receive the ephemeral message. The user should be in the channel specified by the channel argument.
|
104
105
|
# @option options [Object] :as_user
|
@@ -140,22 +141,22 @@ module Slack
|
|
140
141
|
end
|
141
142
|
|
142
143
|
#
|
143
|
-
#
|
144
|
+
# Sends a message to a channel.
|
144
145
|
#
|
145
146
|
# @option options [channel] :channel
|
146
147
|
# Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name. See below for more details.
|
147
148
|
# @option options [Object] :text
|
148
|
-
#
|
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.
|
149
150
|
# @option options [Object] :as_user
|
150
|
-
# 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.
|
151
152
|
# @option options [Object] :attachments
|
152
153
|
# A JSON-based array of structured attachments, presented as a URL-encoded string.
|
153
154
|
# @option options [Object] :blocks
|
154
155
|
# A JSON-based array of structured blocks, presented as a URL-encoded string.
|
155
156
|
# @option options [Object] :icon_emoji
|
156
|
-
# Emoji to use as the icon for this message. Overrides icon_url.
|
157
|
+
# Emoji to use as the icon for this message. Overrides icon_url. See authorship below. Use with bot tokens requires chat:write.customize.
|
157
158
|
# @option options [Object] :icon_url
|
158
|
-
# URL to an image to use as the icon for this message.
|
159
|
+
# URL to an image to use as the icon for this message. See authorship below. Use with bot tokens requires chat:write.customize.
|
159
160
|
# @option options [Object] :link_names
|
160
161
|
# Find and link channel names and usernames.
|
161
162
|
# @option options [Object] :mrkdwn
|
@@ -171,7 +172,7 @@ module Slack
|
|
171
172
|
# @option options [Object] :unfurl_media
|
172
173
|
# Pass false to disable unfurling of media content.
|
173
174
|
# @option options [Object] :username
|
174
|
-
# Set your bot's user name.
|
175
|
+
# Set your bot's user name. See authorship below. Use with bot tokens requires chat:write.customize.
|
175
176
|
# @see https://api.slack.com/methods/chat.postMessage
|
176
177
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/chat/chat.postMessage.json
|
177
178
|
def chat_postMessage(options = {})
|
@@ -193,16 +194,16 @@ module Slack
|
|
193
194
|
end
|
194
195
|
|
195
196
|
#
|
196
|
-
#
|
197
|
+
# Schedules a message to be sent to a channel.
|
197
198
|
#
|
198
199
|
# @option options [channel] :channel
|
199
200
|
# Channel, private group, or DM channel to send message to. Can be an encoded ID, or a name. See below for more details.
|
200
201
|
# @option options [Object] :post_at
|
201
202
|
# Unix EPOCH timestamp of time in future to send the message.
|
202
203
|
# @option options [Object] :text
|
203
|
-
#
|
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.
|
204
205
|
# @option options [Object] :as_user
|
205
|
-
# 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.
|
206
207
|
# @option options [Object] :attachments
|
207
208
|
# A JSON-based array of structured attachments, presented as a URL-encoded string.
|
208
209
|
# @option options [Object] :blocks
|
@@ -210,7 +211,7 @@ module Slack
|
|
210
211
|
# @option options [Object] :link_names
|
211
212
|
# Find and link channel names and usernames.
|
212
213
|
# @option options [Object] :parse
|
213
|
-
# Change how messages are treated. Defaults to none. See
|
214
|
+
# Change how messages are treated. Defaults to none. See chat.postMessage.
|
214
215
|
# @option options [Object] :reply_broadcast
|
215
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.
|
216
217
|
# @option options [Object] :thread_ts
|
@@ -229,7 +230,7 @@ module Slack
|
|
229
230
|
end
|
230
231
|
|
231
232
|
#
|
232
|
-
#
|
233
|
+
# Provide custom unfurl behavior for user-posted URLs
|
233
234
|
#
|
234
235
|
# @option options [channel] :channel
|
235
236
|
# Channel ID of the message.
|
@@ -249,36 +250,36 @@ module Slack
|
|
249
250
|
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
250
251
|
throw ArgumentError.new('Required arguments :ts missing') if options[:ts].nil?
|
251
252
|
throw ArgumentError.new('Required arguments :unfurls missing') if options[:unfurls].nil?
|
252
|
-
options = options.merge(channel:
|
253
|
+
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
253
254
|
post('chat.unfurl', options)
|
254
255
|
end
|
255
256
|
|
256
257
|
#
|
257
|
-
#
|
258
|
+
# Updates a message.
|
258
259
|
#
|
259
260
|
# @option options [channel] :channel
|
260
261
|
# Channel containing the message to be updated.
|
261
|
-
# @option options [Object] :text
|
262
|
-
# New text for the message, using the default formatting rules. It's not required when presenting attachments.
|
263
262
|
# @option options [timestamp] :ts
|
264
263
|
# Timestamp of the message to be updated.
|
265
264
|
# @option options [Object] :as_user
|
266
265
|
# Pass true to update the message as the authed user. Bot users in this context are considered authed users.
|
267
266
|
# @option options [Object] :attachments
|
268
|
-
# 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.
|
269
268
|
# @option options [Object] :blocks
|
270
|
-
# 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.
|
271
270
|
# @option options [Object] :link_names
|
272
|
-
# 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.
|
273
272
|
# @option options [Object] :parse
|
274
|
-
# 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.
|
275
276
|
# @see https://api.slack.com/methods/chat.update
|
276
277
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/chat/chat.update.json
|
277
278
|
def chat_update(options = {})
|
278
279
|
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
279
280
|
throw ArgumentError.new('Required arguments :text, :attachments or :blocks missing') if options[:text].nil? && options[:attachments].nil? && options[:blocks].nil?
|
280
281
|
throw ArgumentError.new('Required arguments :ts missing') if options[:ts].nil?
|
281
|
-
options = options.merge(channel:
|
282
|
+
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
282
283
|
# attachments must be passed as an encoded JSON string
|
283
284
|
if options.key?(:attachments)
|
284
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.
|
@@ -18,10 +19,12 @@ module Slack
|
|
18
19
|
# Maximum number of original entries to return.
|
19
20
|
# @option options [timestamp] :oldest
|
20
21
|
# A UNIX timestamp of the oldest value in the time range.
|
22
|
+
# @option options [Object] :team_id
|
23
|
+
# encoded team id to list channels in, required if org token is used.
|
21
24
|
# @see https://api.slack.com/methods/chat.scheduledMessages.list
|
22
25
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/chat.scheduledMessages/chat.scheduledMessages.list.json
|
23
26
|
def chat_scheduledMessages_list(options = {})
|
24
|
-
options = options.merge(channel:
|
27
|
+
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
25
28
|
if block_given?
|
26
29
|
Pagination::Cursor.new(self, :chat_scheduledMessages_list, options).each do |page|
|
27
30
|
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,19 @@ 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] :
|
42
|
-
#
|
42
|
+
# @option options [Object] :team_id
|
43
|
+
# encoded team id to create the channel in, required if org token is used.
|
43
44
|
# @see https://api.slack.com/methods/conversations.create
|
44
45
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.create.json
|
45
46
|
def conversations_create(options = {})
|
@@ -48,7 +49,7 @@ module Slack
|
|
48
49
|
end
|
49
50
|
|
50
51
|
#
|
51
|
-
#
|
52
|
+
# Fetches a conversation's history of messages and events.
|
52
53
|
#
|
53
54
|
# @option options [channel] :channel
|
54
55
|
# Conversation ID to fetch history for.
|
@@ -66,7 +67,7 @@ module Slack
|
|
66
67
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.history.json
|
67
68
|
def conversations_history(options = {})
|
68
69
|
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
69
|
-
options = options.merge(channel:
|
70
|
+
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
70
71
|
if block_given?
|
71
72
|
Pagination::Cursor.new(self, :conversations_history, options).each do |page|
|
72
73
|
yield page
|
@@ -77,7 +78,7 @@ module Slack
|
|
77
78
|
end
|
78
79
|
|
79
80
|
#
|
80
|
-
#
|
81
|
+
# Retrieve information about a conversation.
|
81
82
|
#
|
82
83
|
# @option options [channel] :channel
|
83
84
|
# Conversation ID to learn more about.
|
@@ -89,28 +90,28 @@ module Slack
|
|
89
90
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.info.json
|
90
91
|
def conversations_info(options = {})
|
91
92
|
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
92
|
-
options = options.merge(channel:
|
93
|
+
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
93
94
|
post('conversations.info', options)
|
94
95
|
end
|
95
96
|
|
96
97
|
#
|
97
|
-
#
|
98
|
+
# Invites users to a channel.
|
98
99
|
#
|
99
100
|
# @option options [channel] :channel
|
100
101
|
# The ID of the public or private channel to invite user(s) to.
|
101
102
|
# @option options [Object] :users
|
102
|
-
# A comma separated list of user IDs. Up to
|
103
|
+
# A comma separated list of user IDs. Up to 1000 users may be listed.
|
103
104
|
# @see https://api.slack.com/methods/conversations.invite
|
104
105
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.invite.json
|
105
106
|
def conversations_invite(options = {})
|
106
107
|
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
107
108
|
throw ArgumentError.new('Required arguments :users missing') if options[:users].nil?
|
108
|
-
options = options.merge(channel:
|
109
|
+
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
109
110
|
post('conversations.invite', options)
|
110
111
|
end
|
111
112
|
|
112
113
|
#
|
113
|
-
#
|
114
|
+
# Joins an existing conversation.
|
114
115
|
#
|
115
116
|
# @option options [channel] :channel
|
116
117
|
# ID of conversation to join.
|
@@ -118,12 +119,12 @@ module Slack
|
|
118
119
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.join.json
|
119
120
|
def conversations_join(options = {})
|
120
121
|
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
121
|
-
options = options.merge(channel:
|
122
|
+
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
122
123
|
post('conversations.join', options)
|
123
124
|
end
|
124
125
|
|
125
126
|
#
|
126
|
-
#
|
127
|
+
# Removes a user from a conversation.
|
127
128
|
#
|
128
129
|
# @option options [channel] :channel
|
129
130
|
# ID of conversation to remove user from.
|
@@ -134,13 +135,13 @@ module Slack
|
|
134
135
|
def conversations_kick(options = {})
|
135
136
|
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
136
137
|
throw ArgumentError.new('Required arguments :user missing') if options[:user].nil?
|
137
|
-
options = options.merge(channel:
|
138
|
+
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
138
139
|
options = options.merge(user: users_id(options)['user']['id']) if options[:user]
|
139
140
|
post('conversations.kick', options)
|
140
141
|
end
|
141
142
|
|
142
143
|
#
|
143
|
-
#
|
144
|
+
# Leaves a conversation.
|
144
145
|
#
|
145
146
|
# @option options [channel] :channel
|
146
147
|
# Conversation to leave.
|
@@ -148,12 +149,12 @@ module Slack
|
|
148
149
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.leave.json
|
149
150
|
def conversations_leave(options = {})
|
150
151
|
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
151
|
-
options = options.merge(channel:
|
152
|
+
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
152
153
|
post('conversations.leave', options)
|
153
154
|
end
|
154
155
|
|
155
156
|
#
|
156
|
-
#
|
157
|
+
# Lists all channels in a Slack team.
|
157
158
|
#
|
158
159
|
# @option options [Object] :cursor
|
159
160
|
# 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,6 +162,8 @@ module Slack
|
|
161
162
|
# Set to true to exclude archived channels from the list.
|
162
163
|
# @option options [Object] :limit
|
163
164
|
# 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 [Object] :team_id
|
166
|
+
# encoded team id to list channels in, required if org token is used.
|
164
167
|
# @option options [Object] :types
|
165
168
|
# Mix and match channel types by providing a comma-separated list of any combination of public_channel, private_channel, mpim, im.
|
166
169
|
# @see https://api.slack.com/methods/conversations.list
|
@@ -176,7 +179,23 @@ module Slack
|
|
176
179
|
end
|
177
180
|
|
178
181
|
#
|
179
|
-
#
|
182
|
+
# Sets the read cursor in a channel.
|
183
|
+
#
|
184
|
+
# @option options [channel] :channel
|
185
|
+
# Channel or conversation to set the read cursor for.
|
186
|
+
# @option options [timestamp] :ts
|
187
|
+
# Unique identifier of message you want marked as most recently seen in this conversation.
|
188
|
+
# @see https://api.slack.com/methods/conversations.mark
|
189
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.mark.json
|
190
|
+
def conversations_mark(options = {})
|
191
|
+
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
192
|
+
throw ArgumentError.new('Required arguments :ts missing') if options[:ts].nil?
|
193
|
+
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
194
|
+
post('conversations.mark', options)
|
195
|
+
end
|
196
|
+
|
197
|
+
#
|
198
|
+
# Retrieve members of a conversation.
|
180
199
|
#
|
181
200
|
# @option options [channel] :channel
|
182
201
|
# ID of the conversation to retrieve members for.
|
@@ -188,7 +207,7 @@ module Slack
|
|
188
207
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.members.json
|
189
208
|
def conversations_members(options = {})
|
190
209
|
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
191
|
-
options = options.merge(channel:
|
210
|
+
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
192
211
|
if block_given?
|
193
212
|
Pagination::Cursor.new(self, :conversations_members, options).each do |page|
|
194
213
|
yield page
|
@@ -199,7 +218,7 @@ module Slack
|
|
199
218
|
end
|
200
219
|
|
201
220
|
#
|
202
|
-
#
|
221
|
+
# Opens or resumes a direct message or multi-person direct message.
|
203
222
|
#
|
204
223
|
# @option options [channel] :channel
|
205
224
|
# Resume a conversation by supplying an im or mpim's ID. Or provide the users field instead.
|
@@ -210,12 +229,12 @@ module Slack
|
|
210
229
|
# @see https://api.slack.com/methods/conversations.open
|
211
230
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.open.json
|
212
231
|
def conversations_open(options = {})
|
213
|
-
options = options.merge(channel:
|
232
|
+
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
214
233
|
post('conversations.open', options)
|
215
234
|
end
|
216
235
|
|
217
236
|
#
|
218
|
-
#
|
237
|
+
# Renames a conversation.
|
219
238
|
#
|
220
239
|
# @option options [channel] :channel
|
221
240
|
# ID of conversation to rename.
|
@@ -226,17 +245,17 @@ module Slack
|
|
226
245
|
def conversations_rename(options = {})
|
227
246
|
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
228
247
|
throw ArgumentError.new('Required arguments :name missing') if options[:name].nil?
|
229
|
-
options = options.merge(channel:
|
248
|
+
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
230
249
|
post('conversations.rename', options)
|
231
250
|
end
|
232
251
|
|
233
252
|
#
|
234
|
-
#
|
253
|
+
# Retrieve a thread of messages posted to a conversation
|
235
254
|
#
|
236
255
|
# @option options [channel] :channel
|
237
256
|
# Conversation ID to fetch thread from.
|
238
257
|
# @option options [timestamp] :ts
|
239
|
-
# Unique identifier of a thread's parent message.
|
258
|
+
# Unique identifier of a thread's parent message. 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.
|
240
259
|
# @option options [Object] :cursor
|
241
260
|
# 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.
|
242
261
|
# @option options [Object] :inclusive
|
@@ -252,7 +271,7 @@ module Slack
|
|
252
271
|
def conversations_replies(options = {})
|
253
272
|
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
254
273
|
throw ArgumentError.new('Required arguments :ts missing') if options[:ts].nil?
|
255
|
-
options = options.merge(channel:
|
274
|
+
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
256
275
|
if block_given?
|
257
276
|
Pagination::Cursor.new(self, :conversations_replies, options).each do |page|
|
258
277
|
yield page
|
@@ -263,7 +282,7 @@ module Slack
|
|
263
282
|
end
|
264
283
|
|
265
284
|
#
|
266
|
-
#
|
285
|
+
# Sets the purpose for a conversation.
|
267
286
|
#
|
268
287
|
# @option options [channel] :channel
|
269
288
|
# Conversation to set the purpose of.
|
@@ -274,12 +293,12 @@ module Slack
|
|
274
293
|
def conversations_setPurpose(options = {})
|
275
294
|
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
276
295
|
throw ArgumentError.new('Required arguments :purpose missing') if options[:purpose].nil?
|
277
|
-
options = options.merge(channel:
|
296
|
+
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
278
297
|
post('conversations.setPurpose', options)
|
279
298
|
end
|
280
299
|
|
281
300
|
#
|
282
|
-
#
|
301
|
+
# Sets the topic for a conversation.
|
283
302
|
#
|
284
303
|
# @option options [channel] :channel
|
285
304
|
# Conversation to set the topic of.
|
@@ -290,12 +309,12 @@ module Slack
|
|
290
309
|
def conversations_setTopic(options = {})
|
291
310
|
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
292
311
|
throw ArgumentError.new('Required arguments :topic missing') if options[:topic].nil?
|
293
|
-
options = options.merge(channel:
|
312
|
+
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
294
313
|
post('conversations.setTopic', options)
|
295
314
|
end
|
296
315
|
|
297
316
|
#
|
298
|
-
#
|
317
|
+
# Reverses conversation archival.
|
299
318
|
#
|
300
319
|
# @option options [channel] :channel
|
301
320
|
# ID of conversation to unarchive.
|
@@ -303,7 +322,7 @@ module Slack
|
|
303
322
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.unarchive.json
|
304
323
|
def conversations_unarchive(options = {})
|
305
324
|
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
306
|
-
options = options.merge(channel:
|
325
|
+
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
307
326
|
post('conversations.unarchive', options)
|
308
327
|
end
|
309
328
|
end
|