slack-ruby-client 0.16.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/danger.yml +19 -0
- data/.github/workflows/integtest.yml +25 -0
- data/.github/workflows/rubocop.yml +13 -0
- data/.github/workflows/test.yml +34 -0
- data/.gitignore +5 -3
- data/.rubocop.yml +6 -0
- data/.rubocop_todo.yml +137 -43
- data/CHANGELOG.md +34 -3
- data/CONTRIBUTING.md +4 -4
- data/Gemfile +18 -1
- data/Gemfile.danger +6 -0
- data/LICENSE.md +1 -1
- data/README.md +13 -12
- data/RELEASING.md +1 -1
- data/UPGRADING.md +42 -0
- data/bin/commands/admin_analytics.rb +2 -1
- data/bin/commands/admin_apps.rb +11 -0
- data/bin/commands/admin_apps_requests.rb +12 -0
- data/bin/commands/admin_auth_policy.rb +39 -0
- data/bin/commands/admin_conversations.rb +2 -1
- data/bin/commands/admin_conversations_restrictAccess.rb +1 -1
- data/bin/commands/admin_emoji.rb +2 -2
- data/bin/commands/admin_teams.rb +1 -1
- data/bin/commands/admin_users.rb +1 -0
- data/bin/commands/admin_users_session.rb +40 -0
- data/bin/commands/admin_users_unsupportedVersions.rb +15 -0
- data/bin/commands/apps_manifest.rb +52 -0
- data/bin/commands/bookmarks.rb +52 -0
- data/bin/commands/channels.rb +0 -157
- data/bin/commands/chat.rb +14 -9
- data/bin/commands/conversations.rb +61 -4
- data/bin/commands/dnd.rb +3 -1
- data/bin/commands/files.rb +2 -1
- data/bin/commands/groups.rb +0 -163
- data/bin/commands/im.rb +0 -62
- data/bin/commands/mpim.rb +0 -60
- data/bin/commands/oauth.rb +0 -13
- data/bin/commands/oauth_v2.rb +13 -1
- data/bin/commands/openid_connect.rb +27 -0
- data/bin/commands/pins.rb +2 -2
- data/bin/commands/reminders.rb +6 -0
- data/bin/commands/rtm.rb +2 -2
- data/bin/commands/search.rb +2 -1
- data/bin/commands/stars.rb +7 -6
- data/bin/commands/team.rb +1 -0
- data/bin/commands/team_billing.rb +13 -0
- data/bin/commands/team_preferences.rb +13 -0
- data/bin/commands/tooling_tokens.rb +14 -0
- data/bin/commands/usergroups.rb +1 -1
- data/bin/commands/users.rb +1 -1
- data/bin/commands/views.rb +1 -1
- data/bin/commands.rb +8 -9
- data/lib/slack/config.rb +1 -2
- data/lib/slack/events/request.rb +5 -3
- data/lib/slack/real_time/client.rb +6 -7
- data/lib/slack/real_time/concurrency/async.rb +6 -8
- data/lib/slack/real_time/config.rb +3 -13
- data/lib/slack/real_time/socket.rb +1 -2
- data/lib/slack/real_time/stores/base.rb +1 -6
- data/lib/slack/real_time/stores/starter.rb +6 -3
- data/lib/slack/real_time/stores/store.rb +5 -0
- data/lib/slack/version.rb +1 -1
- data/lib/slack/web/api/endpoints/admin_analytics.rb +5 -3
- data/lib/slack/web/api/endpoints/admin_apps.rb +21 -5
- data/lib/slack/web/api/endpoints/admin_apps_approved.rb +2 -2
- data/lib/slack/web/api/endpoints/admin_apps_requests.rb +20 -2
- data/lib/slack/web/api/endpoints/admin_apps_restricted.rb +2 -2
- data/lib/slack/web/api/endpoints/admin_auth_policy.rb +72 -0
- data/lib/slack/web/api/endpoints/admin_barriers.rb +6 -6
- data/lib/slack/web/api/endpoints/admin_conversations.rb +28 -26
- data/lib/slack/web/api/endpoints/admin_conversations_ekm.rb +4 -4
- data/lib/slack/web/api/endpoints/admin_emoji.rb +11 -11
- data/lib/slack/web/api/endpoints/admin_inviteRequests.rb +7 -7
- data/lib/slack/web/api/endpoints/admin_inviteRequests_approved.rb +3 -3
- data/lib/slack/web/api/endpoints/admin_inviteRequests_denied.rb +2 -2
- data/lib/slack/web/api/endpoints/admin_teams.rb +7 -7
- data/lib/slack/web/api/endpoints/admin_teams_admins.rb +2 -2
- data/lib/slack/web/api/endpoints/admin_teams_owners.rb +2 -2
- data/lib/slack/web/api/endpoints/admin_teams_settings.rb +5 -5
- data/lib/slack/web/api/endpoints/admin_usergroups.rb +10 -10
- data/lib/slack/web/api/endpoints/admin_users.rb +20 -18
- data/lib/slack/web/api/endpoints/admin_users_session.rb +65 -9
- data/lib/slack/web/api/endpoints/admin_users_unsupportedVersions.rb +25 -0
- data/lib/slack/web/api/endpoints/api.rb +1 -1
- data/lib/slack/web/api/endpoints/apps.rb +2 -2
- data/lib/slack/web/api/endpoints/apps_event_authorizations.rb +3 -3
- data/lib/slack/web/api/endpoints/apps_manifest.rb +77 -0
- data/lib/slack/web/api/endpoints/auth.rb +1 -1
- data/lib/slack/web/api/endpoints/auth_teams.rb +3 -3
- data/lib/slack/web/api/endpoints/bookmarks.rb +86 -0
- data/lib/slack/web/api/endpoints/bots.rb +2 -2
- data/lib/slack/web/api/endpoints/calls.rb +15 -15
- data/lib/slack/web/api/endpoints/calls_participants.rb +4 -4
- data/lib/slack/web/api/endpoints/channels.rb +0 -265
- data/lib/slack/web/api/endpoints/chat.rb +67 -57
- data/lib/slack/web/api/endpoints/chat_scheduledMessages.rb +3 -3
- data/lib/slack/web/api/endpoints/conversations.rb +117 -27
- data/lib/slack/web/api/endpoints/dialog.rb +2 -2
- data/lib/slack/web/api/endpoints/dnd.rb +6 -3
- data/lib/slack/web/api/endpoints/files.rb +16 -14
- data/lib/slack/web/api/endpoints/files_comments.rb +1 -1
- data/lib/slack/web/api/endpoints/files_remote.rb +20 -20
- data/lib/slack/web/api/endpoints/groups.rb +0 -273
- data/lib/slack/web/api/endpoints/im.rb +0 -107
- data/lib/slack/web/api/endpoints/migration.rb +3 -3
- data/lib/slack/web/api/endpoints/mpim.rb +0 -102
- data/lib/slack/web/api/endpoints/oauth.rb +5 -27
- data/lib/slack/web/api/endpoints/oauth_v2.rb +24 -6
- data/lib/slack/web/api/endpoints/openid_connect.rb +42 -0
- data/lib/slack/web/api/endpoints/pins.rb +4 -4
- data/lib/slack/web/api/endpoints/reactions.rb +12 -12
- data/lib/slack/web/api/endpoints/reminders.rb +17 -5
- data/lib/slack/web/api/endpoints/rtm.rb +10 -10
- data/lib/slack/web/api/endpoints/search.rb +24 -16
- data/lib/slack/web/api/endpoints/stars.rb +11 -9
- data/lib/slack/web/api/endpoints/team.rb +10 -8
- data/lib/slack/web/api/endpoints/team_billing.rb +21 -0
- data/lib/slack/web/api/endpoints/team_preferences.rb +21 -0
- data/lib/slack/web/api/endpoints/team_profile.rb +1 -1
- data/lib/slack/web/api/endpoints/tooling_tokens.rb +24 -0
- data/lib/slack/web/api/endpoints/usergroups.rb +19 -19
- data/lib/slack/web/api/endpoints/usergroups_users.rb +7 -7
- data/lib/slack/web/api/endpoints/users.rb +16 -16
- data/lib/slack/web/api/endpoints/users_profile.rb +4 -4
- data/lib/slack/web/api/endpoints/views.rb +12 -12
- data/lib/slack/web/api/endpoints/workflows.rb +9 -9
- data/lib/slack/web/api/endpoints.rb +16 -20
- data/lib/slack/web/api/errors/server_error.rb +37 -0
- data/lib/slack/web/api/errors/too_many_requests_error.rb +1 -4
- data/lib/slack/web/api/errors.rb +232 -16
- data/lib/slack/web/api/mixins.rb +0 -2
- data/lib/slack/web/api/patches/chat.1.patch +7 -9
- data/lib/slack/web/api/templates/endpoints.erb +0 -2
- data/lib/slack/web/faraday/connection.rb +5 -5
- data/lib/slack/web/faraday/request.rb +4 -1
- data/lib/slack/web/faraday/response/raise_error.rb +2 -14
- data/lib/slack/web/faraday/response/wrap_error.rb +11 -5
- data/lib/slack/web/pagination/cursor.rb +1 -5
- data/lib/slack-ruby-client.rb +3 -2
- data/lib/tasks/real_time.rake +1 -3
- data/lib/tasks/web.rake +4 -0
- data/slack-ruby-client.gemspec +5 -14
- data/spec/fixtures/slack/web/429_error.yml +50 -54
- data/spec/fixtures/slack/web/auth_test_error.yml +51 -18
- data/spec/fixtures/slack/web/auth_test_success.yml +50 -26
- data/spec/fixtures/slack/web/conversations_info.yml +167 -0
- data/spec/fixtures/slack/web/conversations_setTopic.yml +42 -27
- data/spec/fixtures/slack/web/conversations_setTopic_one_page.yml +89 -59
- data/spec/fixtures/slack/web/conversations_setTopic_paginated.yml +131 -86
- data/spec/fixtures/slack/web/paginated_users_list.yml +501 -69
- data/spec/fixtures/slack/web/rtm_connect.yml +267 -30
- data/spec/fixtures/slack/web/rtm_start.yml +771 -60
- data/spec/fixtures/slack/web/users_info.yml +153 -69
- data/spec/fixtures/slack/web/users_list.yml +102 -41
- data/spec/fixtures/slack/web/views_open_error.yml +49 -42
- data/spec/integration/integration_spec.rb +1 -1
- data/spec/slack/events/request_spec.rb +7 -6
- data/spec/slack/real_time/client_spec.rb +37 -39
- data/spec/slack/real_time/concurrency/with_concurrency_spec.rb +10 -0
- data/spec/slack/real_time/concurrency/without_concurrency_spec.rb +10 -0
- data/spec/slack/real_time/event_handlers/bot_spec.rb +1 -1
- data/spec/slack/real_time/event_handlers/channel_spec.rb +9 -9
- data/spec/slack/real_time/event_handlers/group_spec.rb +2 -2
- data/spec/slack/real_time/event_handlers/im_spec.rb +7 -7
- data/spec/slack/real_time/event_handlers/user_spec.rb +2 -2
- data/spec/slack/real_time/rtm_connect_spec.rb +1 -1
- data/spec/slack/real_time/rtm_start_spec.rb +1 -1
- data/spec/slack/real_time/store_spec.rb +2 -2
- data/spec/slack/slack_spec.rb +7 -5
- data/spec/slack/version_spec.rb +1 -1
- data/spec/slack/web/api/endpoints/admin_apps_requests_spec.rb +5 -0
- data/spec/slack/web/api/endpoints/admin_apps_spec.rb +5 -0
- data/spec/slack/web/api/endpoints/admin_auth_policy_spec.rb +35 -0
- data/spec/slack/web/api/endpoints/admin_conversations_spec.rb +9 -9
- data/spec/slack/web/api/endpoints/admin_teams_settings_spec.rb +1 -1
- data/spec/slack/web/api/endpoints/admin_usergroups_spec.rb +6 -6
- data/spec/slack/web/api/endpoints/admin_users_session_spec.rb +22 -2
- data/spec/slack/web/api/endpoints/admin_users_spec.rb +8 -8
- data/spec/slack/web/api/endpoints/admin_users_unsupportedVersions_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/apps_manifest_spec.rb +36 -0
- data/spec/slack/web/api/endpoints/apps_spec.rb +2 -2
- data/spec/slack/web/api/endpoints/bookmarks_spec.rb +40 -0
- data/spec/slack/web/api/endpoints/calls_participants_spec.rb +4 -4
- data/spec/slack/web/api/endpoints/calls_spec.rb +2 -2
- data/spec/slack/web/api/endpoints/custom_specs/auth_spec.rb +4 -6
- data/spec/slack/web/api/endpoints/custom_specs/chat_spec.rb +28 -16
- data/spec/slack/web/api/endpoints/custom_specs/conversations_spec.rb +13 -0
- data/spec/slack/web/api/endpoints/custom_specs/dialog_spec.rb +4 -2
- data/spec/slack/web/api/endpoints/custom_specs/users_spec.rb +2 -2
- data/spec/slack/web/api/endpoints/custom_specs/views_spec.rb +22 -14
- data/spec/slack/web/api/endpoints/dnd_spec.rb +0 -5
- data/spec/slack/web/api/endpoints/files_comments_spec.rb +2 -2
- data/spec/slack/web/api/endpoints/files_remote_spec.rb +3 -3
- data/spec/slack/web/api/endpoints/oauth_spec.rb +0 -11
- data/spec/slack/web/api/endpoints/oauth_v2_spec.rb +6 -3
- data/spec/slack/web/api/endpoints/{apps_permissions_scopes_spec.rb → openid_connect_spec.rb} +1 -1
- data/spec/slack/web/api/endpoints/reactions_spec.rb +3 -3
- data/spec/slack/web/api/endpoints/reminders_spec.rb +2 -2
- data/spec/slack/web/api/endpoints/{apps_permissions_resources_spec.rb → team_billing_spec.rb} +1 -1
- data/spec/slack/web/api/endpoints/team_preferences_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/tooling_tokens_spec.rb +13 -0
- data/spec/slack/web/api/endpoints/usergroups_users_spec.rb +2 -2
- data/spec/slack/web/api/error_spec.rb +5 -7
- data/spec/slack/web/api/errors/slack_error_spec.rb +21 -26
- data/spec/slack/web/api/mixins/conversations_list_spec.rb +1 -1
- data/spec/slack/web/api/pagination/cursor_spec.rb +8 -10
- data/spec/slack/web/client_spec.rb +46 -32
- data/spec/slack/web/faraday/request_spec.rb +80 -0
- data/spec/slack/web/faraday/response/raise_error_spec.rb +2 -1
- data/spec/spec_helper.rb +1 -1
- data/spec/support/real_time/connected_client.rb +2 -8
- data/spec/support/vcr.rb +33 -2
- metadata +50 -297
- data/.travis.yml +0 -28
- data/lib/slack/web/api/errors/internal_error.rb +0 -14
- data/lib/slack/web/api/mixins/channels.id.json +0 -20
- data/lib/slack/web/api/mixins/channels.id.rb +0 -25
- data/lib/slack/web/api/mixins/groups.id.json +0 -20
- data/lib/slack/web/api/mixins/groups.id.rb +0 -25
- data/spec/fixtures/slack/web/503_error.yml +0 -14
- data/spec/fixtures/slack/web/channels_info.yml +0 -139
- data/spec/fixtures/slack/web/groups_info.yml +0 -43
- data/spec/slack/web/api/endpoints/admin_conversations_whitelist_spec.rb +0 -32
- data/spec/slack/web/api/endpoints/apps_permissions_spec.rb +0 -16
- data/spec/slack/web/api/endpoints/apps_permissions_users_spec.rb +0 -19
- data/spec/slack/web/api/endpoints/conversations_spec.rb +0 -109
- data/spec/slack/web/api/endpoints/custom_specs/channels_spec.rb +0 -13
- data/spec/slack/web/api/endpoints/custom_specs/groups_spec.rb +0 -13
- data/spec/slack/web/api/endpoints/im_spec.rb +0 -39
- data/spec/slack/web/api/endpoints/mpim_spec.rb +0 -39
- data/spec/slack/web/api/endpoints/views_spec.rb +0 -29
- data/spec/slack/web/api/mixins/channels_spec.rb +0 -43
- data/spec/slack/web/api/mixins/groups_spec.rb +0 -43
@@ -6,37 +6,6 @@ module Slack
|
|
6
6
|
module Api
|
7
7
|
module Endpoints
|
8
8
|
module Channels
|
9
|
-
#
|
10
|
-
# Archives a channel.
|
11
|
-
#
|
12
|
-
# @option options [channel] :channel
|
13
|
-
# Channel to archive.
|
14
|
-
# @see https://api.slack.com/methods/channels.archive
|
15
|
-
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/channels/channels.archive.json
|
16
|
-
def channels_archive(options = {})
|
17
|
-
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
18
|
-
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
19
|
-
logger.warn('channels.archive: This method is deprecated. It will stop functioning in February 2021 and will not work with newly created apps after June 10th, 2020. Alternative methods: conversations.archive.')
|
20
|
-
post('channels.archive', options)
|
21
|
-
end
|
22
|
-
|
23
|
-
#
|
24
|
-
# Creates a channel.
|
25
|
-
#
|
26
|
-
# @option options [Object] :name
|
27
|
-
# Name of channel to create.
|
28
|
-
# @option options [Object] :team_id
|
29
|
-
# encoded team id to create the channel in, required if org token is used.
|
30
|
-
# @option options [Object] :validate
|
31
|
-
# Whether to return errors on invalid channel name instead of modifying it to meet the specified criteria.
|
32
|
-
# @see https://api.slack.com/methods/channels.create
|
33
|
-
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/channels/channels.create.json
|
34
|
-
def channels_create(options = {})
|
35
|
-
throw ArgumentError.new('Required arguments :name missing') if options[:name].nil?
|
36
|
-
logger.warn('channels.create: This method is deprecated. It will stop functioning in February 2021 and will not work with newly created apps after June 10th, 2020. Alternative methods: conversations.create.')
|
37
|
-
post('channels.create', options)
|
38
|
-
end
|
39
|
-
|
40
9
|
#
|
41
10
|
# Delete a channel (undocumented)
|
42
11
|
#
|
@@ -49,240 +18,6 @@ module Slack
|
|
49
18
|
logger.warn('The channels.delete method is undocumented.')
|
50
19
|
post('channels.delete', options)
|
51
20
|
end
|
52
|
-
|
53
|
-
#
|
54
|
-
# Fetches history of messages and events from a channel.
|
55
|
-
#
|
56
|
-
# @option options [channel] :channel
|
57
|
-
# Channel to fetch history for.
|
58
|
-
# @option options [Object] :inclusive
|
59
|
-
# Include messages with latest or oldest timestamp in results.
|
60
|
-
# @option options [timestamp] :latest
|
61
|
-
# End of time range of messages to include in results.
|
62
|
-
# @option options [timestamp] :oldest
|
63
|
-
# Start of time range of messages to include in results.
|
64
|
-
# @option options [Object] :unreads
|
65
|
-
# Include unread_count_display in the output?.
|
66
|
-
# @see https://api.slack.com/methods/channels.history
|
67
|
-
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/channels/channels.history.json
|
68
|
-
def channels_history(options = {})
|
69
|
-
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
70
|
-
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
71
|
-
logger.warn('channels.history: This method is deprecated. It will stop functioning in February 2021 and will not work with newly created apps after June 10th, 2020. Alternative methods: conversations.history.')
|
72
|
-
post('channels.history', options)
|
73
|
-
end
|
74
|
-
|
75
|
-
#
|
76
|
-
# Gets information about a channel.
|
77
|
-
#
|
78
|
-
# @option options [channel] :channel
|
79
|
-
# Channel to get info on.
|
80
|
-
# @option options [Object] :include_locale
|
81
|
-
# Set this to true to receive the locale for this channel. Defaults to false.
|
82
|
-
# @see https://api.slack.com/methods/channels.info
|
83
|
-
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/channels/channels.info.json
|
84
|
-
def channels_info(options = {})
|
85
|
-
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
86
|
-
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
87
|
-
logger.warn('channels.info: This method is deprecated. It will stop functioning in February 2021 and will not work with newly created apps after June 10th, 2020. Alternative methods: conversations.info.')
|
88
|
-
post('channels.info', options)
|
89
|
-
end
|
90
|
-
|
91
|
-
#
|
92
|
-
# Invites a user to a channel.
|
93
|
-
#
|
94
|
-
# @option options [channel] :channel
|
95
|
-
# Channel to invite user to.
|
96
|
-
# @option options [user] :user
|
97
|
-
# User to invite to channel.
|
98
|
-
# @see https://api.slack.com/methods/channels.invite
|
99
|
-
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/channels/channels.invite.json
|
100
|
-
def channels_invite(options = {})
|
101
|
-
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
102
|
-
throw ArgumentError.new('Required arguments :user missing') if options[:user].nil?
|
103
|
-
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
104
|
-
options = options.merge(user: users_id(options)['user']['id']) if options[:user]
|
105
|
-
logger.warn('channels.invite: This method is deprecated. It will stop functioning in February 2021 and will not work with newly created apps after June 10th, 2020. Alternative methods: conversations.invite.')
|
106
|
-
post('channels.invite', options)
|
107
|
-
end
|
108
|
-
|
109
|
-
#
|
110
|
-
# Joins a channel, creating it if needed.
|
111
|
-
#
|
112
|
-
# @option options [Object] :name
|
113
|
-
# Name of channel to join.
|
114
|
-
# @option options [Object] :team_id
|
115
|
-
# encoded team id to list channels in, required if org token is used.
|
116
|
-
# @option options [Object] :validate
|
117
|
-
# Whether to return errors on invalid channel name instead of modifying it to meet the specified criteria.
|
118
|
-
# @see https://api.slack.com/methods/channels.join
|
119
|
-
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/channels/channels.join.json
|
120
|
-
def channels_join(options = {})
|
121
|
-
throw ArgumentError.new('Required arguments :name missing') if options[:name].nil?
|
122
|
-
logger.warn('channels.join: This method is deprecated. It will stop functioning in February 2021 and will not work with newly created apps after June 10th, 2020. Alternative methods: conversations.join.')
|
123
|
-
post('channels.join', options)
|
124
|
-
end
|
125
|
-
|
126
|
-
#
|
127
|
-
# Removes a user from a channel.
|
128
|
-
#
|
129
|
-
# @option options [channel] :channel
|
130
|
-
# Channel to remove user from.
|
131
|
-
# @option options [user] :user
|
132
|
-
# User to remove from channel.
|
133
|
-
# @see https://api.slack.com/methods/channels.kick
|
134
|
-
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/channels/channels.kick.json
|
135
|
-
def channels_kick(options = {})
|
136
|
-
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
137
|
-
throw ArgumentError.new('Required arguments :user missing') if options[:user].nil?
|
138
|
-
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
139
|
-
options = options.merge(user: users_id(options)['user']['id']) if options[:user]
|
140
|
-
logger.warn('channels.kick: This method is deprecated. It will stop functioning in February 2021 and will not work with newly created apps after June 10th, 2020. Alternative methods: conversations.kick.')
|
141
|
-
post('channels.kick', options)
|
142
|
-
end
|
143
|
-
|
144
|
-
#
|
145
|
-
# Leaves a channel.
|
146
|
-
#
|
147
|
-
# @option options [channel] :channel
|
148
|
-
# Channel to leave.
|
149
|
-
# @see https://api.slack.com/methods/channels.leave
|
150
|
-
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/channels/channels.leave.json
|
151
|
-
def channels_leave(options = {})
|
152
|
-
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
153
|
-
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
154
|
-
logger.warn('channels.leave: This method is deprecated. It will stop functioning in February 2021 and will not work with newly created apps after June 10th, 2020. Alternative methods: conversations.leave.')
|
155
|
-
post('channels.leave', options)
|
156
|
-
end
|
157
|
-
|
158
|
-
#
|
159
|
-
# Lists all channels in a Slack team.
|
160
|
-
#
|
161
|
-
# @option options [Object] :cursor
|
162
|
-
# 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.
|
163
|
-
# @option options [Object] :exclude_archived
|
164
|
-
# Exclude archived channels from the list.
|
165
|
-
# @option options [Object] :exclude_members
|
166
|
-
# Exclude the members collection from each channel.
|
167
|
-
# @option options [Object] :limit
|
168
|
-
# The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the users list hasn't been reached.
|
169
|
-
# @option options [Object] :team_id
|
170
|
-
# encoded team id to list channels in, required if org token is used.
|
171
|
-
# @see https://api.slack.com/methods/channels.list
|
172
|
-
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/channels/channels.list.json
|
173
|
-
def channels_list(options = {})
|
174
|
-
logger.warn('channels.list: This method is deprecated. It will stop functioning in February 2021 and will not work with newly created apps after June 10th, 2020. Alternative methods: conversations.list, users.conversations.')
|
175
|
-
if block_given?
|
176
|
-
Pagination::Cursor.new(self, :channels_list, options).each do |page|
|
177
|
-
yield page
|
178
|
-
end
|
179
|
-
else
|
180
|
-
post('channels.list', options)
|
181
|
-
end
|
182
|
-
end
|
183
|
-
|
184
|
-
#
|
185
|
-
# Sets the read cursor in a channel.
|
186
|
-
#
|
187
|
-
# @option options [channel] :channel
|
188
|
-
# Channel or conversation to set the read cursor for.
|
189
|
-
# @option options [timestamp] :ts
|
190
|
-
# Unique identifier of message you want marked as most recently seen in this conversation.
|
191
|
-
# @see https://api.slack.com/methods/channels.mark
|
192
|
-
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/channels/channels.mark.json
|
193
|
-
def channels_mark(options = {})
|
194
|
-
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
195
|
-
throw ArgumentError.new('Required arguments :ts missing') if options[:ts].nil?
|
196
|
-
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
197
|
-
logger.warn('channels.mark: This method is deprecated. It will stop functioning in February 2021 and will not work with newly created apps after June 10th, 2020. Alternative methods: conversations.mark.')
|
198
|
-
post('channels.mark', options)
|
199
|
-
end
|
200
|
-
|
201
|
-
#
|
202
|
-
# Renames a channel.
|
203
|
-
#
|
204
|
-
# @option options [channel] :channel
|
205
|
-
# Channel to rename.
|
206
|
-
# @option options [Object] :name
|
207
|
-
# New name for channel.
|
208
|
-
# @option options [Object] :validate
|
209
|
-
# Whether to return errors on invalid channel name instead of modifying it to meet the specified criteria.
|
210
|
-
# @see https://api.slack.com/methods/channels.rename
|
211
|
-
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/channels/channels.rename.json
|
212
|
-
def channels_rename(options = {})
|
213
|
-
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
214
|
-
throw ArgumentError.new('Required arguments :name missing') if options[:name].nil?
|
215
|
-
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
216
|
-
logger.warn('channels.rename: This method is deprecated. It will stop functioning in February 2021 and will not work with newly created apps after June 10th, 2020. Alternative methods: conversations.rename.')
|
217
|
-
post('channels.rename', options)
|
218
|
-
end
|
219
|
-
|
220
|
-
#
|
221
|
-
# Retrieve a thread of messages posted to a channel
|
222
|
-
#
|
223
|
-
# @option options [channel] :channel
|
224
|
-
# Channel to fetch thread from.
|
225
|
-
# @option options [Object] :thread_ts
|
226
|
-
# Unique identifier of a thread's parent message.
|
227
|
-
# @see https://api.slack.com/methods/channels.replies
|
228
|
-
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/channels/channels.replies.json
|
229
|
-
def channels_replies(options = {})
|
230
|
-
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
231
|
-
throw ArgumentError.new('Required arguments :thread_ts missing') if options[:thread_ts].nil?
|
232
|
-
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
233
|
-
logger.warn('channels.replies: This method is deprecated. It will stop functioning in February 2021 and will not work with newly created apps after June 10th, 2020. Alternative methods: conversations.replies.')
|
234
|
-
post('channels.replies', options)
|
235
|
-
end
|
236
|
-
|
237
|
-
#
|
238
|
-
# Sets the purpose for a channel.
|
239
|
-
#
|
240
|
-
# @option options [channel] :channel
|
241
|
-
# Channel to set the purpose of.
|
242
|
-
# @option options [Object] :purpose
|
243
|
-
# The new purpose.
|
244
|
-
# @option options [Object] :name_tagging
|
245
|
-
# if it is true, treat this like a message and not an unescaped thing.
|
246
|
-
# @see https://api.slack.com/methods/channels.setPurpose
|
247
|
-
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/channels/channels.setPurpose.json
|
248
|
-
def channels_setPurpose(options = {})
|
249
|
-
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
250
|
-
throw ArgumentError.new('Required arguments :purpose missing') if options[:purpose].nil?
|
251
|
-
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
252
|
-
logger.warn('channels.setPurpose: This method is deprecated. It will stop functioning in February 2021 and will not work with newly created apps after June 10th, 2020. Alternative methods: conversations.setPurpose.')
|
253
|
-
post('channels.setPurpose', options)
|
254
|
-
end
|
255
|
-
|
256
|
-
#
|
257
|
-
# Sets the topic for a channel.
|
258
|
-
#
|
259
|
-
# @option options [channel] :channel
|
260
|
-
# Channel to set the topic of.
|
261
|
-
# @option options [Object] :topic
|
262
|
-
# The new topic.
|
263
|
-
# @see https://api.slack.com/methods/channels.setTopic
|
264
|
-
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/channels/channels.setTopic.json
|
265
|
-
def channels_setTopic(options = {})
|
266
|
-
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
267
|
-
throw ArgumentError.new('Required arguments :topic missing') if options[:topic].nil?
|
268
|
-
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
269
|
-
logger.warn('channels.setTopic: This method is deprecated. It will stop functioning in February 2021 and will not work with newly created apps after June 10th, 2020. Alternative methods: conversations.setTopic.')
|
270
|
-
post('channels.setTopic', options)
|
271
|
-
end
|
272
|
-
|
273
|
-
#
|
274
|
-
# Unarchives a channel.
|
275
|
-
#
|
276
|
-
# @option options [channel] :channel
|
277
|
-
# Channel to unarchive.
|
278
|
-
# @see https://api.slack.com/methods/channels.unarchive
|
279
|
-
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/channels/channels.unarchive.json
|
280
|
-
def channels_unarchive(options = {})
|
281
|
-
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
282
|
-
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
283
|
-
logger.warn('channels.unarchive: This method is deprecated. It will stop functioning in February 2021 and will not work with newly created apps after June 10th, 2020. Alternative methods: conversations.unarchive.')
|
284
|
-
post('channels.unarchive', options)
|
285
|
-
end
|
286
21
|
end
|
287
22
|
end
|
288
23
|
end
|
@@ -31,7 +31,7 @@ module Slack
|
|
31
31
|
# Channel containing the message to be deleted.
|
32
32
|
# @option options [timestamp] :ts
|
33
33
|
# Timestamp of the message to be deleted.
|
34
|
-
# @option options [
|
34
|
+
# @option options [boolean] :as_user
|
35
35
|
# Pass true to delete the message as the authed user with chat:write:user scope. Bot users in this context are considered authed users. If unused or false, the message will be deleted with chat:write:bot scope.
|
36
36
|
# @see https://api.slack.com/methods/chat.delete
|
37
37
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/chat/chat.delete.json
|
@@ -47,9 +47,9 @@ module Slack
|
|
47
47
|
#
|
48
48
|
# @option options [channel] :channel
|
49
49
|
# The channel the scheduled_message is posting to.
|
50
|
-
# @option options [
|
50
|
+
# @option options [string] :scheduled_message_id
|
51
51
|
# scheduled_message_id returned from call to chat.scheduleMessage.
|
52
|
-
# @option options [
|
52
|
+
# @option options [boolean] :as_user
|
53
53
|
# Pass true to delete the message as the authed user with chat:write:user scope. Bot users in this context are considered authed users. If unused or false, the message will be deleted with chat:write:bot scope.
|
54
54
|
# @see https://api.slack.com/methods/chat.deleteScheduledMessage
|
55
55
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/chat/chat.deleteScheduledMessage.json
|
@@ -65,7 +65,7 @@ module Slack
|
|
65
65
|
#
|
66
66
|
# @option options [channel] :channel
|
67
67
|
# The ID of the conversation or channel containing the message.
|
68
|
-
# @option options [
|
68
|
+
# @option options [string] :message_ts
|
69
69
|
# A message's ts value, uniquely identifying it within a channel.
|
70
70
|
# @see https://api.slack.com/methods/chat.getPermalink
|
71
71
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/chat/chat.getPermalink.json
|
@@ -81,7 +81,7 @@ module Slack
|
|
81
81
|
#
|
82
82
|
# @option options [channel] :channel
|
83
83
|
# Channel to send message to. Can be a public channel, private group or IM channel. Can be an encoded ID, or a name.
|
84
|
-
# @option options [
|
84
|
+
# @option options [string] :text
|
85
85
|
# Text of the message to send.
|
86
86
|
# @see https://api.slack.com/methods/chat.meMessage
|
87
87
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/chat/chat.meMessage.json
|
@@ -94,29 +94,29 @@ module Slack
|
|
94
94
|
#
|
95
95
|
# Sends an ephemeral message to a user in a channel.
|
96
96
|
#
|
97
|
-
# @option options [Object] :attachments
|
98
|
-
# A JSON-based array of structured attachments, presented as a URL-encoded string.
|
99
97
|
# @option options [channel] :channel
|
100
98
|
# Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name.
|
101
|
-
# @option options [
|
99
|
+
# @option options [string] :text
|
102
100
|
# How this field works and whether it is required depends on other fields you use in your API call. See below for more detail.
|
103
101
|
# @option options [user] :user
|
104
102
|
# id of the user who will receive the ephemeral message. The user should be in the channel specified by the channel argument.
|
105
|
-
# @option options [
|
103
|
+
# @option options [boolean] :as_user
|
106
104
|
# 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.
|
107
|
-
# @option options [
|
105
|
+
# @option options [string] :attachments
|
106
|
+
# A JSON-based array of structured attachments, presented as a URL-encoded string.
|
107
|
+
# @option options [blocks[] as string] :blocks
|
108
108
|
# A JSON-based array of structured blocks, presented as a URL-encoded string.
|
109
|
-
# @option options [
|
109
|
+
# @option options [string] :icon_emoji
|
110
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 [
|
111
|
+
# @option options [string] :icon_url
|
112
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.
|
113
|
-
# @option options [
|
113
|
+
# @option options [boolean] :link_names
|
114
114
|
# Find and link channel names and usernames.
|
115
|
-
# @option options [
|
115
|
+
# @option options [string] :parse
|
116
116
|
# Change how messages are treated. Defaults to none. See below.
|
117
|
-
# @option options [
|
117
|
+
# @option options [string] :thread_ts
|
118
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 [
|
119
|
+
# @option options [string] :username
|
120
120
|
# Set your bot's user name. Must be used in conjunction with as_user set to false, otherwise ignored. See authorship below.
|
121
121
|
# @see https://api.slack.com/methods/chat.postEphemeral
|
122
122
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/chat/chat.postEphemeral.json
|
@@ -145,34 +145,34 @@ module Slack
|
|
145
145
|
#
|
146
146
|
# @option options [channel] :channel
|
147
147
|
# Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name. See below for more details.
|
148
|
-
# @option options [
|
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.
|
150
|
-
# @option options [Object] :as_user
|
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.
|
152
|
-
# @option options [Object] :attachments
|
148
|
+
# @option options [string] :attachments
|
153
149
|
# A JSON-based array of structured attachments, presented as a URL-encoded string.
|
154
|
-
# @option options [
|
150
|
+
# @option options [blocks[] as string] :blocks
|
155
151
|
# A JSON-based array of structured blocks, presented as a URL-encoded string.
|
156
|
-
# @option options [
|
157
|
-
#
|
158
|
-
# @option options [
|
159
|
-
#
|
160
|
-
# @option options [
|
152
|
+
# @option options [string] :text
|
153
|
+
# The formatted text of the message to be published. If blocks are included, this will become the fallback text used in notifications.
|
154
|
+
# @option options [boolean] :as_user
|
155
|
+
# Pass true to post the message as the authed user, instead of as a bot. Defaults to false. See authorship below.
|
156
|
+
# @option options [string] :icon_emoji
|
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.
|
158
|
+
# @option options [string] :icon_url
|
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.
|
160
|
+
# @option options [boolean] :link_names
|
161
161
|
# Find and link channel names and usernames.
|
162
|
-
# @option options [
|
162
|
+
# @option options [boolean] :mrkdwn
|
163
163
|
# Disable Slack markup parsing by setting to false. Enabled by default.
|
164
|
-
# @option options [
|
164
|
+
# @option options [string] :parse
|
165
165
|
# Change how messages are treated. Defaults to none. See below.
|
166
|
-
# @option options [
|
166
|
+
# @option options [boolean] :reply_broadcast
|
167
167
|
# Used in conjunction with thread_ts and indicates whether reply should be made visible to everyone in the channel or conversation. Defaults to false.
|
168
|
-
# @option options [
|
168
|
+
# @option options [string] :thread_ts
|
169
169
|
# Provide another message's ts value to make this message a reply. Avoid using a reply's ts value; use its parent instead.
|
170
|
-
# @option options [
|
170
|
+
# @option options [boolean] :unfurl_links
|
171
171
|
# Pass true to enable unfurling of primarily text-based content.
|
172
|
-
# @option options [
|
172
|
+
# @option options [boolean] :unfurl_media
|
173
173
|
# Pass false to disable unfurling of media content.
|
174
|
-
# @option options [
|
175
|
-
# Set your bot's user name.
|
174
|
+
# @option options [string] :username
|
175
|
+
# Set your bot's user name. Must be used in conjunction with as_user set to false, otherwise ignored. See authorship below.
|
176
176
|
# @see https://api.slack.com/methods/chat.postMessage
|
177
177
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/chat/chat.postMessage.json
|
178
178
|
def chat_postMessage(options = {})
|
@@ -198,27 +198,27 @@ module Slack
|
|
198
198
|
#
|
199
199
|
# @option options [channel] :channel
|
200
200
|
# Channel, private group, or DM channel to send message to. Can be an encoded ID, or a name. See below for more details.
|
201
|
-
# @option options [
|
201
|
+
# @option options [integer] :post_at
|
202
202
|
# Unix EPOCH timestamp of time in future to send the message.
|
203
|
-
# @option options [
|
203
|
+
# @option options [string] :text
|
204
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.
|
205
|
-
# @option options [
|
205
|
+
# @option options [boolean] :as_user
|
206
206
|
# Pass true to post the message as the authed user, instead of as a bot. Defaults to false. See chat.postMessage.
|
207
|
-
# @option options [
|
207
|
+
# @option options [string] :attachments
|
208
208
|
# A JSON-based array of structured attachments, presented as a URL-encoded string.
|
209
|
-
# @option options [
|
209
|
+
# @option options [blocks[] as string] :blocks
|
210
210
|
# A JSON-based array of structured blocks, presented as a URL-encoded string.
|
211
|
-
# @option options [
|
211
|
+
# @option options [boolean] :link_names
|
212
212
|
# Find and link channel names and usernames.
|
213
|
-
# @option options [
|
213
|
+
# @option options [string] :parse
|
214
214
|
# Change how messages are treated. Defaults to none. See chat.postMessage.
|
215
|
-
# @option options [
|
215
|
+
# @option options [boolean] :reply_broadcast
|
216
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.
|
217
|
-
# @option options [
|
217
|
+
# @option options [string] :thread_ts
|
218
218
|
# Provide another message's ts value to make this message a reply. Avoid using a reply's ts value; use its parent instead.
|
219
|
-
# @option options [
|
219
|
+
# @option options [boolean] :unfurl_links
|
220
220
|
# Pass true to enable unfurling of primarily text-based content.
|
221
|
-
# @option options [
|
221
|
+
# @option options [boolean] :unfurl_media
|
222
222
|
# Pass false to disable unfurling of media content.
|
223
223
|
# @see https://api.slack.com/methods/chat.scheduleMessage
|
224
224
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/chat/chat.scheduleMessage.json
|
@@ -233,14 +233,20 @@ module Slack
|
|
233
233
|
# Provide custom unfurl behavior for user-posted URLs
|
234
234
|
#
|
235
235
|
# @option options [channel] :channel
|
236
|
-
# Channel ID of the message.
|
236
|
+
# Channel ID of the message. Both channel and ts must be provided together, or unfurl_id and source must be provided together.
|
237
237
|
# @option options [timestamp] :ts
|
238
238
|
# Timestamp of the message to add unfurl behavior to.
|
239
|
-
# @option options [
|
239
|
+
# @option options [string] :unfurls
|
240
240
|
# URL-encoded JSON map with keys set to URLs featured in the the message, pointing to their unfurl blocks or message attachments.
|
241
|
+
# @option options [string] :source
|
242
|
+
# The source of the link to unfurl. The source may either be composer, when the link is inside the message composer, or conversations_history, when the link has been posted to a conversation.
|
243
|
+
# @option options [string] :unfurl_id
|
244
|
+
# The ID of the link to unfurl. Both unfurl_id and source must be provided together, or channel and ts must be provided together.
|
245
|
+
# @option options [Object] :user_auth_blocks
|
246
|
+
# Provide a JSON based array of structured blocks presented as URL-encoded string to send as an ephemeral message to the user as invitation to authenticate further and enable full unfurling behavior.
|
241
247
|
# @option options [Object] :user_auth_message
|
242
|
-
# Provide a simply-formatted string to send as an ephemeral message to the user as invitation to authenticate further and enable full unfurling behavior.
|
243
|
-
# @option options [
|
248
|
+
# Provide a simply-formatted string to send as an ephemeral message to the user as invitation to authenticate further and enable full unfurling behavior. Provides two buttons, Not now or Never ask me again.
|
249
|
+
# @option options [boolean] :user_auth_required
|
244
250
|
# Set to true or 1 to indicate the user must install your Slack app to trigger unfurls for this domain.
|
245
251
|
# @option options [Object] :user_auth_url
|
246
252
|
# Send users to this custom URL where they will complete authentication in your app to fully trigger unfurling. Value should be properly URL-encoded.
|
@@ -261,23 +267,27 @@ module Slack
|
|
261
267
|
# Channel containing the message to be updated.
|
262
268
|
# @option options [timestamp] :ts
|
263
269
|
# Timestamp of the message to be updated.
|
264
|
-
# @option options [
|
270
|
+
# @option options [boolean] :as_user
|
265
271
|
# Pass true to update the message as the authed user. Bot users in this context are considered authed users.
|
266
|
-
# @option options [
|
272
|
+
# @option options [string] :attachments
|
267
273
|
# 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.
|
268
|
-
# @option options [
|
274
|
+
# @option options [blocks[] as string] :blocks
|
269
275
|
# 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.
|
270
|
-
# @option options [
|
276
|
+
# @option options [array] :file_ids
|
277
|
+
# Array of new file ids that will be sent with this message.
|
278
|
+
# @option options [boolean] :link_names
|
271
279
|
# 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.
|
272
|
-
# @option options [
|
280
|
+
# @option options [string] :parse
|
273
281
|
# 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 [
|
282
|
+
# @option options [boolean] :reply_broadcast
|
283
|
+
# Broadcast an existing thread reply to make it visible to everyone in the channel or conversation.
|
284
|
+
# @option options [string] :text
|
275
285
|
# New text for the message, using the default formatting rules. It's not required when presenting blocks or attachments.
|
276
286
|
# @see https://api.slack.com/methods/chat.update
|
277
287
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/chat/chat.update.json
|
278
288
|
def chat_update(options = {})
|
279
289
|
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
280
|
-
throw ArgumentError.new('Required arguments :text, :attachments or :
|
290
|
+
throw ArgumentError.new('Required arguments :text, :attachments, :blocks or :reply_broadcast missing') if options[:text].nil? && options[:attachments].nil? && options[:blocks].nil? && options[:reply_broadcast].nil?
|
281
291
|
throw ArgumentError.new('Required arguments :ts missing') if options[:ts].nil?
|
282
292
|
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
283
293
|
# attachments must be passed as an encoded JSON string
|
@@ -11,15 +11,15 @@ module Slack
|
|
11
11
|
#
|
12
12
|
# @option options [channel] :channel
|
13
13
|
# The channel of the scheduled messages.
|
14
|
-
# @option options [
|
14
|
+
# @option options [string] :cursor
|
15
15
|
# For pagination purposes, this is the cursor value returned from a previous call to chat.scheduledmessages.list indicating where you want to start this call from.
|
16
16
|
# @option options [timestamp] :latest
|
17
17
|
# A UNIX timestamp of the latest value in the time range.
|
18
|
-
# @option options [
|
18
|
+
# @option options [integer] :limit
|
19
19
|
# Maximum number of original entries to return.
|
20
20
|
# @option options [timestamp] :oldest
|
21
21
|
# A UNIX timestamp of the oldest value in the time range.
|
22
|
-
# @option options [
|
22
|
+
# @option options [string] :team_id
|
23
23
|
# encoded team id to list channels in, required if org token is used.
|
24
24
|
# @see https://api.slack.com/methods/chat.scheduledMessages.list
|
25
25
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/chat.scheduledMessages/chat.scheduledMessages.list.json
|