slack-ruby-client 0.14.6 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (274) hide show
  1. checksums.yaml +4 -4
  2. data/.github/FUNDING.yml +1 -0
  3. data/.rubocop.yml +15 -3
  4. data/.rubocop_todo.yml +110 -38
  5. data/.travis.yml +2 -5
  6. data/CHANGELOG.md +42 -0
  7. data/CONTRIBUTING.md +19 -8
  8. data/Dangerfile +1 -1
  9. data/Gemfile +1 -2
  10. data/LICENSE.md +1 -1
  11. data/README.md +38 -36
  12. data/RELEASING.md +1 -1
  13. data/UPGRADING.md +62 -2
  14. data/bin/commands/admin_analytics.rb +16 -0
  15. data/bin/commands/admin_apps.rb +26 -2
  16. data/bin/commands/admin_apps_requests.rb +1 -0
  17. data/bin/commands/admin_auth_policy.rb +39 -0
  18. data/bin/commands/admin_barriers.rb +47 -0
  19. data/bin/commands/admin_conversations.rb +155 -3
  20. data/bin/commands/admin_conversations_ekm.rb +17 -0
  21. data/bin/commands/admin_conversations_restrictAccess.rb +37 -0
  22. data/bin/commands/admin_conversations_whitelist.rb +37 -0
  23. data/bin/commands/admin_emoji.rb +1 -1
  24. data/bin/commands/admin_teams.rb +1 -1
  25. data/bin/commands/admin_usergroups.rb +48 -0
  26. data/bin/commands/admin_users.rb +3 -2
  27. data/bin/commands/admin_users_session.rb +62 -0
  28. data/bin/commands/api.rb +0 -1
  29. data/bin/commands/apps_connections.rb +13 -0
  30. data/bin/commands/apps_event_authorizations.rb +16 -0
  31. data/bin/commands/apps_manifest.rb +51 -0
  32. data/bin/commands/auth_teams.rb +16 -0
  33. data/bin/commands/bots.rb +1 -0
  34. data/bin/commands/calls.rb +52 -0
  35. data/bin/commands/calls_participants.rb +25 -0
  36. data/bin/commands/channels.rb +1 -155
  37. data/bin/commands/chat.rb +17 -12
  38. data/bin/commands/chat_scheduledMessages.rb +1 -0
  39. data/bin/commands/conversations.rb +71 -3
  40. data/bin/commands/dnd.rb +2 -0
  41. data/bin/commands/files.rb +6 -4
  42. data/bin/commands/files_remote.rb +2 -2
  43. data/bin/commands/groups.rb +1 -162
  44. data/bin/commands/im.rb +1 -63
  45. data/bin/commands/migration.rb +1 -0
  46. data/bin/commands/mpim.rb +1 -61
  47. data/bin/commands/oauth.rb +0 -13
  48. data/bin/commands/oauth_v2.rb +13 -1
  49. data/bin/commands/openid_connect.rb +27 -0
  50. data/bin/commands/pins.rb +2 -4
  51. data/bin/commands/reactions.rb +1 -0
  52. data/bin/commands/reminders.rb +6 -0
  53. data/bin/commands/rtm.rb +2 -2
  54. data/bin/commands/search.rb +4 -0
  55. data/bin/commands/stars.rb +7 -6
  56. data/bin/commands/team.rb +3 -0
  57. data/bin/commands/team_billing.rb +13 -0
  58. data/bin/commands/team_preferences.rb +13 -0
  59. data/bin/commands/tooling_tokens.rb +14 -0
  60. data/bin/commands/usergroups.rb +5 -0
  61. data/bin/commands/usergroups_users.rb +2 -0
  62. data/bin/commands/users.rb +4 -2
  63. data/bin/commands/users_profile.rb +5 -5
  64. data/bin/commands/views.rb +2 -2
  65. data/bin/commands/workflows.rb +38 -0
  66. data/bin/commands.rb +17 -8
  67. data/lib/slack/config.rb +1 -2
  68. data/lib/slack/events/request.rb +10 -4
  69. data/lib/slack/messages/message.rb +0 -4
  70. data/lib/slack/real_time/client.rb +6 -6
  71. data/lib/slack/real_time/concurrency/async.rb +7 -11
  72. data/lib/slack/real_time/concurrency.rb +0 -2
  73. data/lib/slack/real_time/config.rb +5 -14
  74. data/lib/slack/real_time/models/base.rb +0 -4
  75. data/lib/slack/real_time/socket.rb +3 -4
  76. data/lib/slack/real_time/stores/base.rb +4 -7
  77. data/lib/slack/real_time/stores/starter.rb +6 -3
  78. data/lib/slack/real_time/stores/store.rb +5 -0
  79. data/lib/slack/version.rb +1 -1
  80. data/lib/slack/web/api/endpoints/admin_analytics.rb +28 -0
  81. data/lib/slack/web/api/endpoints/admin_apps.rb +42 -6
  82. data/lib/slack/web/api/endpoints/admin_apps_approved.rb +2 -2
  83. data/lib/slack/web/api/endpoints/admin_apps_requests.rb +4 -2
  84. data/lib/slack/web/api/endpoints/admin_apps_restricted.rb +2 -2
  85. data/lib/slack/web/api/endpoints/admin_auth_policy.rb +72 -0
  86. data/lib/slack/web/api/endpoints/admin_barriers.rb +82 -0
  87. data/lib/slack/web/api/endpoints/admin_conversations.rb +234 -4
  88. data/lib/slack/web/api/endpoints/admin_conversations_ekm.rb +35 -0
  89. data/lib/slack/web/api/endpoints/admin_conversations_restrictAccess.rb +61 -0
  90. data/lib/slack/web/api/endpoints/admin_conversations_whitelist.rb +64 -0
  91. data/lib/slack/web/api/endpoints/admin_emoji.rb +10 -10
  92. data/lib/slack/web/api/endpoints/admin_inviteRequests.rb +7 -7
  93. data/lib/slack/web/api/endpoints/admin_inviteRequests_approved.rb +3 -3
  94. data/lib/slack/web/api/endpoints/admin_inviteRequests_denied.rb +2 -2
  95. data/lib/slack/web/api/endpoints/admin_teams.rb +7 -7
  96. data/lib/slack/web/api/endpoints/admin_teams_admins.rb +2 -2
  97. data/lib/slack/web/api/endpoints/admin_teams_owners.rb +2 -2
  98. data/lib/slack/web/api/endpoints/admin_teams_settings.rb +5 -5
  99. data/lib/slack/web/api/endpoints/admin_usergroups.rb +77 -0
  100. data/lib/slack/web/api/endpoints/admin_users.rb +23 -23
  101. data/lib/slack/web/api/endpoints/admin_users_session.rb +97 -3
  102. data/lib/slack/web/api/endpoints/api.rb +1 -3
  103. data/lib/slack/web/api/endpoints/apps.rb +2 -2
  104. data/lib/slack/web/api/endpoints/apps_connections.rb +21 -0
  105. data/lib/slack/web/api/endpoints/apps_event_authorizations.rb +34 -0
  106. data/lib/slack/web/api/endpoints/apps_manifest.rb +75 -0
  107. data/lib/slack/web/api/endpoints/auth.rb +1 -1
  108. data/lib/slack/web/api/endpoints/auth_teams.rb +33 -0
  109. data/lib/slack/web/api/endpoints/bots.rb +3 -1
  110. data/lib/slack/web/api/endpoints/calls.rb +83 -0
  111. data/lib/slack/web/api/endpoints/calls_participants.rb +42 -0
  112. data/lib/slack/web/api/endpoints/channels.rb +1 -245
  113. data/lib/slack/web/api/endpoints/chat.rb +76 -66
  114. data/lib/slack/web/api/endpoints/chat_scheduledMessages.rb +5 -3
  115. data/lib/slack/web/api/endpoints/conversations.rb +149 -41
  116. data/lib/slack/web/api/endpoints/dialog.rb +2 -2
  117. data/lib/slack/web/api/endpoints/dnd.rb +6 -3
  118. data/lib/slack/web/api/endpoints/files.rb +21 -17
  119. data/lib/slack/web/api/endpoints/files_comments.rb +1 -1
  120. data/lib/slack/web/api/endpoints/files_remote.rb +23 -23
  121. data/lib/slack/web/api/endpoints/groups.rb +0 -253
  122. data/lib/slack/web/api/endpoints/im.rb +0 -101
  123. data/lib/slack/web/api/endpoints/migration.rb +4 -2
  124. data/lib/slack/web/api/endpoints/mpim.rb +0 -96
  125. data/lib/slack/web/api/endpoints/oauth.rb +5 -30
  126. data/lib/slack/web/api/endpoints/oauth_v2.rb +24 -6
  127. data/lib/slack/web/api/endpoints/openid_connect.rb +42 -0
  128. data/lib/slack/web/api/endpoints/pins.rb +7 -12
  129. data/lib/slack/web/api/endpoints/reactions.rb +16 -14
  130. data/lib/slack/web/api/endpoints/reminders.rb +17 -5
  131. data/lib/slack/web/api/endpoints/rtm.rb +10 -10
  132. data/lib/slack/web/api/endpoints/search.rb +27 -13
  133. data/lib/slack/web/api/endpoints/stars.rb +13 -11
  134. data/lib/slack/web/api/endpoints/team.rb +11 -5
  135. data/lib/slack/web/api/endpoints/team_billing.rb +21 -0
  136. data/lib/slack/web/api/endpoints/team_preferences.rb +21 -0
  137. data/lib/slack/web/api/endpoints/team_profile.rb +1 -1
  138. data/lib/slack/web/api/endpoints/tooling_tokens.rb +24 -0
  139. data/lib/slack/web/api/endpoints/usergroups.rb +26 -16
  140. data/lib/slack/web/api/endpoints/usergroups_users.rb +9 -5
  141. data/lib/slack/web/api/endpoints/users.rb +20 -18
  142. data/lib/slack/web/api/endpoints/users_profile.rb +7 -7
  143. data/lib/slack/web/api/endpoints/views.rb +13 -13
  144. data/lib/slack/web/api/endpoints/workflows.rb +61 -0
  145. data/lib/slack/web/api/endpoints.rb +35 -18
  146. data/lib/slack/web/api/errors/server_error.rb +37 -0
  147. data/lib/slack/web/api/errors/too_many_requests_error.rb +1 -4
  148. data/lib/slack/web/api/errors.rb +486 -12
  149. data/lib/slack/web/api/mixins/{channels.id.rb → conversations.id.rb} +3 -5
  150. data/lib/slack/web/api/mixins/ids.id.rb +3 -5
  151. data/lib/slack/web/api/mixins/users.id.rb +1 -3
  152. data/lib/slack/web/api/mixins.rb +1 -2
  153. data/lib/slack/web/api/patches/{chat.6.block-kit-support.patch → chat.1.patch} +25 -24
  154. data/lib/slack/web/api/templates/endpoints.erb +1 -2
  155. data/lib/slack/web/api/templates/method.erb +4 -1
  156. data/lib/slack/web/api/templates/method_spec.erb +1 -1
  157. data/lib/slack/web/config.rb +2 -0
  158. data/lib/slack/web/faraday/connection.rb +23 -20
  159. data/lib/slack/web/faraday/request.rb +2 -1
  160. data/lib/slack/web/faraday/response/raise_error.rb +12 -1
  161. data/lib/slack/web/faraday/response/wrap_error.rb +24 -0
  162. data/lib/slack/web/pagination/cursor.rb +3 -7
  163. data/lib/slack-ruby-client.rb +4 -4
  164. data/lib/tasks/web.rake +11 -3
  165. data/slack-ruby-client.gemspec +6 -7
  166. data/spec/fixtures/slack/web/429_error.yml +50 -54
  167. data/spec/fixtures/slack/web/auth_test_error.yml +51 -18
  168. data/spec/fixtures/slack/web/auth_test_success.yml +50 -26
  169. data/spec/fixtures/slack/web/conversations_info.yml +167 -0
  170. data/spec/fixtures/slack/web/conversations_setTopic.yml +84 -0
  171. data/spec/fixtures/slack/web/conversations_setTopic_one_page.yml +172 -0
  172. data/spec/fixtures/slack/web/conversations_setTopic_paginated.yml +253 -0
  173. data/spec/fixtures/slack/web/paginated_users_list.yml +501 -69
  174. data/spec/fixtures/slack/web/rtm_connect.yml +267 -30
  175. data/spec/fixtures/slack/web/rtm_start.yml +771 -60
  176. data/spec/fixtures/slack/web/users_info.yml +153 -69
  177. data/spec/fixtures/slack/web/users_list.yml +102 -41
  178. data/spec/fixtures/slack/web/views_open_error.yml +49 -42
  179. data/spec/slack/events/request_spec.rb +13 -8
  180. data/spec/slack/real_time/client_spec.rb +35 -22
  181. data/spec/slack/real_time/concurrency/with_concurrency_spec.rb +10 -0
  182. data/spec/slack/real_time/concurrency/without_concurrency_spec.rb +10 -0
  183. data/spec/slack/real_time/event_handlers/bot_spec.rb +1 -1
  184. data/spec/slack/real_time/event_handlers/channel_spec.rb +1 -1
  185. data/spec/slack/real_time/event_handlers/im_spec.rb +5 -5
  186. data/spec/slack/real_time/event_handlers/user_spec.rb +2 -2
  187. data/spec/slack/real_time/rtm_connect_spec.rb +1 -1
  188. data/spec/slack/real_time/rtm_start_spec.rb +1 -1
  189. data/spec/slack/slack_spec.rb +3 -1
  190. data/spec/slack/web/api/endpoints/admin_analytics_spec.rb +13 -0
  191. data/spec/slack/web/api/endpoints/admin_apps_spec.rb +10 -0
  192. data/spec/slack/web/api/endpoints/admin_auth_policy_spec.rb +35 -0
  193. data/spec/slack/web/api/endpoints/admin_barriers_spec.rb +38 -0
  194. data/spec/slack/web/api/endpoints/{apps_permissions_scopes_spec.rb → admin_conversations_ekm_spec.rb} +1 -1
  195. data/spec/slack/web/api/endpoints/admin_conversations_restrictAccess_spec.rb +32 -0
  196. data/spec/slack/web/api/endpoints/admin_conversations_spec.rb +85 -0
  197. data/spec/slack/web/api/endpoints/admin_emoji_spec.rb +6 -6
  198. data/spec/slack/web/api/endpoints/admin_teams_settings_spec.rb +10 -10
  199. data/spec/slack/web/api/endpoints/admin_teams_spec.rb +2 -2
  200. data/spec/slack/web/api/endpoints/admin_usergroups_spec.rb +37 -0
  201. data/spec/slack/web/api/endpoints/admin_users_session_spec.rb +28 -0
  202. data/spec/slack/web/api/endpoints/admin_users_spec.rb +15 -23
  203. data/spec/slack/web/api/endpoints/{apps_permissions_resources_spec.rb → apps_connections_spec.rb} +1 -1
  204. data/spec/slack/web/api/endpoints/apps_event_authorizations_spec.rb +13 -0
  205. data/spec/slack/web/api/endpoints/apps_manifest_spec.rb +36 -0
  206. data/spec/slack/web/api/endpoints/apps_spec.rb +2 -2
  207. data/spec/slack/web/api/endpoints/auth_teams_spec.rb +8 -0
  208. data/spec/slack/web/api/endpoints/calls_participants_spec.rb +24 -0
  209. data/spec/slack/web/api/endpoints/calls_spec.rb +31 -0
  210. data/spec/slack/web/api/endpoints/custom_specs/auth_spec.rb +4 -6
  211. data/spec/slack/web/api/endpoints/custom_specs/conversations_spec.rb +13 -0
  212. data/spec/slack/web/api/endpoints/custom_specs/users_spec.rb +2 -2
  213. data/spec/slack/web/api/endpoints/dnd_spec.rb +0 -5
  214. data/spec/slack/web/api/endpoints/files_comments_spec.rb +2 -2
  215. data/spec/slack/web/api/endpoints/files_remote_spec.rb +3 -3
  216. data/spec/slack/web/api/endpoints/files_spec.rb +4 -4
  217. data/spec/slack/web/api/endpoints/oauth_spec.rb +0 -22
  218. data/spec/slack/web/api/endpoints/oauth_v2_spec.rb +6 -3
  219. data/spec/slack/web/api/endpoints/openid_connect_spec.rb +8 -0
  220. data/spec/slack/web/api/endpoints/pins_spec.rb +1 -4
  221. data/spec/slack/web/api/endpoints/reactions_spec.rb +3 -3
  222. data/spec/slack/web/api/endpoints/reminders_spec.rb +2 -2
  223. data/spec/slack/web/api/endpoints/team_billing_spec.rb +8 -0
  224. data/spec/slack/web/api/endpoints/team_preferences_spec.rb +8 -0
  225. data/spec/slack/web/api/endpoints/tooling_tokens_spec.rb +13 -0
  226. data/spec/slack/web/api/endpoints/usergroups_users_spec.rb +2 -2
  227. data/spec/slack/web/api/endpoints/workflows_spec.rb +26 -0
  228. data/spec/slack/web/api/error_spec.rb +5 -7
  229. data/spec/slack/web/api/errors/slack_error_spec.rb +21 -26
  230. data/spec/slack/web/api/mixins/conversations_list_spec.rb +21 -0
  231. data/spec/slack/web/api/mixins/{channels_spec.rb → conversations_spec.rb} +8 -8
  232. data/spec/slack/web/api/mixins/users_spec.rb +1 -1
  233. data/spec/slack/web/api/pagination/cursor_spec.rb +1 -3
  234. data/spec/slack/web/client_spec.rb +123 -1
  235. data/spec/slack/web/faraday/request_spec.rb +80 -0
  236. data/spec/slack/web/faraday/response/raise_error_spec.rb +8 -6
  237. data/spec/spec_helper.rb +1 -1
  238. data/spec/support/real_time/connected_client.rb +1 -7
  239. data/spec/support/vcr.rb +36 -1
  240. metadata +95 -173
  241. data/examples/hi_real_time/Gemfile +0 -6
  242. data/examples/hi_real_time/hi.gif +0 -0
  243. data/examples/hi_real_time/hi.rb +0 -41
  244. data/examples/hi_real_time_async_celluloid/Gemfile +0 -7
  245. data/examples/hi_real_time_async_celluloid/Procfile +0 -2
  246. data/examples/hi_real_time_async_celluloid/hi.rb +0 -39
  247. data/examples/hi_real_time_async_eventmachine/Gemfile +0 -7
  248. data/examples/hi_real_time_async_eventmachine/Procfile +0 -2
  249. data/examples/hi_real_time_async_eventmachine/hi.rb +0 -39
  250. data/lib/slack/real_time/concurrency/celluloid.rb +0 -142
  251. data/lib/slack/real_time/concurrency/eventmachine.rb +0 -85
  252. data/lib/slack/web/api/mixins/channels.id.json +0 -20
  253. data/lib/slack/web/api/mixins/groups.id.json +0 -20
  254. data/lib/slack/web/api/mixins/groups.id.rb +0 -27
  255. data/lib/slack/web/api/patches/chat.1.text-attachments-required.patch +0 -13
  256. data/lib/slack/web/api/patches/chat.2.attachments-json.patch +0 -17
  257. data/lib/slack/web/api/patches/chat.3.update-attachments-support.patch +0 -21
  258. data/lib/slack/web/api/patches/chat.4.postEphemeral-attachments-support.patch +0 -17
  259. data/lib/slack/web/api/patches/chat.5.postEphemeral-text-or-attachments.patch +0 -15
  260. data/spec/fixtures/slack/web/503_error.yml +0 -14
  261. data/spec/fixtures/slack/web/channels_info.yml +0 -46
  262. data/spec/fixtures/slack/web/groups_info.yml +0 -43
  263. data/spec/slack/real_time/concurrency/celluloid_spec.rb +0 -116
  264. data/spec/slack/real_time/concurrency/eventmachine_spec.rb +0 -57
  265. data/spec/slack/web/api/endpoints/apps_permissions_spec.rb +0 -16
  266. data/spec/slack/web/api/endpoints/apps_permissions_users_spec.rb +0 -19
  267. data/spec/slack/web/api/endpoints/conversations_spec.rb +0 -101
  268. data/spec/slack/web/api/endpoints/custom_specs/channels_spec.rb +0 -13
  269. data/spec/slack/web/api/endpoints/custom_specs/groups_spec.rb +0 -13
  270. data/spec/slack/web/api/endpoints/im_spec.rb +0 -39
  271. data/spec/slack/web/api/endpoints/mpim_spec.rb +0 -39
  272. data/spec/slack/web/api/endpoints/views_spec.rb +0 -29
  273. data/spec/slack/web/api/errors/service_unavailable_spec.rb +0 -17
  274. data/spec/slack/web/api/mixins/groups_spec.rb +0 -43
@@ -6,33 +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: channels_id(options)['channel']['id']) if options[:channel]
19
- post('channels.archive', options)
20
- end
21
-
22
- #
23
- # Creates a channel.
24
- #
25
- # @option options [Object] :name
26
- # Name of channel to create.
27
- # @option options [Object] :validate
28
- # Whether to return errors on invalid channel name instead of modifying it to meet the specified criteria.
29
- # @see https://api.slack.com/methods/channels.create
30
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/channels/channels.create.json
31
- def channels_create(options = {})
32
- throw ArgumentError.new('Required arguments :name missing') if options[:name].nil?
33
- post('channels.create', options)
34
- end
35
-
36
9
  #
37
10
  # Delete a channel (undocumented)
38
11
  #
@@ -41,227 +14,10 @@ module Slack
41
14
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/undocumented/channels/channels.delete.json
42
15
  def channels_delete(options = {})
43
16
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
44
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
17
+ options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
45
18
  logger.warn('The channels.delete method is undocumented.')
46
19
  post('channels.delete', options)
47
20
  end
48
-
49
- #
50
- # Fetches history of messages and events from a channel.
51
- #
52
- # @option options [channel] :channel
53
- # Channel to fetch history for.
54
- # @option options [Object] :inclusive
55
- # Include messages with latest or oldest timestamp in results.
56
- # @option options [timestamp] :latest
57
- # End of time range of messages to include in results.
58
- # @option options [timestamp] :oldest
59
- # Start of time range of messages to include in results.
60
- # @option options [Object] :unreads
61
- # Include unread_count_display in the output?.
62
- # @see https://api.slack.com/methods/channels.history
63
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/channels/channels.history.json
64
- def channels_history(options = {})
65
- throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
66
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
67
- post('channels.history', options)
68
- end
69
-
70
- #
71
- # Gets information about a channel.
72
- #
73
- # @option options [channel] :channel
74
- # Channel to get info on.
75
- # @option options [Object] :include_locale
76
- # Set this to true to receive the locale for this channel. Defaults to false.
77
- # @see https://api.slack.com/methods/channels.info
78
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/channels/channels.info.json
79
- def channels_info(options = {})
80
- throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
81
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
82
- post('channels.info', options)
83
- end
84
-
85
- #
86
- # Invites a user to a channel.
87
- #
88
- # @option options [channel] :channel
89
- # Channel to invite user to.
90
- # @option options [user] :user
91
- # User to invite to channel.
92
- # @see https://api.slack.com/methods/channels.invite
93
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/channels/channels.invite.json
94
- def channels_invite(options = {})
95
- throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
96
- throw ArgumentError.new('Required arguments :user missing') if options[:user].nil?
97
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
98
- options = options.merge(user: users_id(options)['user']['id']) if options[:user]
99
- post('channels.invite', options)
100
- end
101
-
102
- #
103
- # Joins a channel, creating it if needed.
104
- #
105
- # @option options [Object] :name
106
- # Name of channel to join.
107
- # @option options [Object] :validate
108
- # Whether to return errors on invalid channel name instead of modifying it to meet the specified criteria.
109
- # @see https://api.slack.com/methods/channels.join
110
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/channels/channels.join.json
111
- def channels_join(options = {})
112
- throw ArgumentError.new('Required arguments :name missing') if options[:name].nil?
113
- post('channels.join', options)
114
- end
115
-
116
- #
117
- # Removes a user from a channel.
118
- #
119
- # @option options [channel] :channel
120
- # Channel to remove user from.
121
- # @option options [user] :user
122
- # User to remove from channel.
123
- # @see https://api.slack.com/methods/channels.kick
124
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/channels/channels.kick.json
125
- def channels_kick(options = {})
126
- throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
127
- throw ArgumentError.new('Required arguments :user missing') if options[:user].nil?
128
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
129
- options = options.merge(user: users_id(options)['user']['id']) if options[:user]
130
- post('channels.kick', options)
131
- end
132
-
133
- #
134
- # Leaves a channel.
135
- #
136
- # @option options [channel] :channel
137
- # Channel to leave.
138
- # @see https://api.slack.com/methods/channels.leave
139
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/channels/channels.leave.json
140
- def channels_leave(options = {})
141
- throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
142
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
143
- post('channels.leave', options)
144
- end
145
-
146
- #
147
- # Lists all channels in a Slack team.
148
- #
149
- # @option options [Object] :cursor
150
- # 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.
151
- # @option options [Object] :exclude_archived
152
- # Exclude archived channels from the list.
153
- # @option options [Object] :exclude_members
154
- # Exclude the members collection from each channel.
155
- # @option options [Object] :limit
156
- # 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.
157
- # @see https://api.slack.com/methods/channels.list
158
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/channels/channels.list.json
159
- def channels_list(options = {})
160
- if block_given?
161
- Pagination::Cursor.new(self, :channels_list, options).each do |page|
162
- yield page
163
- end
164
- else
165
- post('channels.list', options)
166
- end
167
- end
168
-
169
- #
170
- # Sets the read cursor in a channel.
171
- #
172
- # @option options [channel] :channel
173
- # Channel to set reading cursor in.
174
- # @option options [timestamp] :ts
175
- # Timestamp of the most recently seen message.
176
- # @see https://api.slack.com/methods/channels.mark
177
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/channels/channels.mark.json
178
- def channels_mark(options = {})
179
- throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
180
- throw ArgumentError.new('Required arguments :ts missing') if options[:ts].nil?
181
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
182
- post('channels.mark', options)
183
- end
184
-
185
- #
186
- # Renames a channel.
187
- #
188
- # @option options [channel] :channel
189
- # Channel to rename.
190
- # @option options [Object] :name
191
- # New name for channel.
192
- # @option options [Object] :validate
193
- # Whether to return errors on invalid channel name instead of modifying it to meet the specified criteria.
194
- # @see https://api.slack.com/methods/channels.rename
195
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/channels/channels.rename.json
196
- def channels_rename(options = {})
197
- throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
198
- throw ArgumentError.new('Required arguments :name missing') if options[:name].nil?
199
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
200
- post('channels.rename', options)
201
- end
202
-
203
- #
204
- # Retrieve a thread of messages posted to a channel
205
- #
206
- # @option options [channel] :channel
207
- # Channel to fetch thread from.
208
- # @option options [Object] :thread_ts
209
- # Unique identifier of a thread's parent message.
210
- # @see https://api.slack.com/methods/channels.replies
211
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/channels/channels.replies.json
212
- def channels_replies(options = {})
213
- throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
214
- throw ArgumentError.new('Required arguments :thread_ts missing') if options[:thread_ts].nil?
215
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
216
- post('channels.replies', options)
217
- end
218
-
219
- #
220
- # Sets the purpose for a channel.
221
- #
222
- # @option options [channel] :channel
223
- # Channel to set the purpose of.
224
- # @option options [Object] :purpose
225
- # The new purpose.
226
- # @option options [Object] :name_tagging
227
- # if it is true, treat this like a message and not an unescaped thing.
228
- # @see https://api.slack.com/methods/channels.setPurpose
229
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/channels/channels.setPurpose.json
230
- def channels_setPurpose(options = {})
231
- throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
232
- throw ArgumentError.new('Required arguments :purpose missing') if options[:purpose].nil?
233
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
234
- post('channels.setPurpose', options)
235
- end
236
-
237
- #
238
- # Sets the topic for a channel.
239
- #
240
- # @option options [channel] :channel
241
- # Channel to set the topic of.
242
- # @option options [Object] :topic
243
- # The new topic.
244
- # @see https://api.slack.com/methods/channels.setTopic
245
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/channels/channels.setTopic.json
246
- def channels_setTopic(options = {})
247
- throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
248
- throw ArgumentError.new('Required arguments :topic missing') if options[:topic].nil?
249
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
250
- post('channels.setTopic', options)
251
- end
252
-
253
- #
254
- # Unarchives a channel.
255
- #
256
- # @option options [channel] :channel
257
- # Channel to unarchive.
258
- # @see https://api.slack.com/methods/channels.unarchive
259
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/channels/channels.unarchive.json
260
- def channels_unarchive(options = {})
261
- throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
262
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
263
- post('channels.unarchive', options)
264
- end
265
21
  end
266
22
  end
267
23
  end
@@ -19,7 +19,7 @@ module Slack
19
19
  def chat_command(options = {})
20
20
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
21
21
  throw ArgumentError.new('Required arguments :command missing') if options[:command].nil?
22
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
22
+ options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
23
23
  logger.warn('The chat.command method is undocumented.')
24
24
  post('chat.command', options)
25
25
  end
@@ -31,14 +31,14 @@ 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 [Object] :as_user
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
38
38
  def chat_delete(options = {})
39
39
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
40
40
  throw ArgumentError.new('Required arguments :ts missing') if options[:ts].nil?
41
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
41
+ options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
42
42
  post('chat.delete', options)
43
43
  end
44
44
 
@@ -47,16 +47,16 @@ module Slack
47
47
  #
48
48
  # @option options [channel] :channel
49
49
  # The channel the scheduled_message is posting to.
50
- # @option options [Object] :scheduled_message_id
50
+ # @option options [string] :scheduled_message_id
51
51
  # scheduled_message_id returned from call to chat.scheduleMessage.
52
- # @option options [Object] :as_user
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
56
56
  def chat_deleteScheduledMessage(options = {})
57
57
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
58
58
  throw ArgumentError.new('Required arguments :scheduled_message_id missing') if options[:scheduled_message_id].nil?
59
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
59
+ options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
60
60
  post('chat.deleteScheduledMessage', options)
61
61
  end
62
62
 
@@ -65,14 +65,14 @@ 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 [Object] :message_ts
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
72
72
  def chat_getPermalink(options = {})
73
73
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
74
74
  throw ArgumentError.new('Required arguments :message_ts missing') if options[:message_ts].nil?
75
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
75
+ options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
76
76
  post('chat.getPermalink', options)
77
77
  end
78
78
 
@@ -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 [Object] :text
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 [Object] :text
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 [Object] :as_user
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 [Object] :blocks
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 [Object] :icon_emoji
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 [Object] :icon_url
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 [Object] :link_names
113
+ # @option options [boolean] :link_names
114
114
  # Find and link channel names and usernames.
115
- # @option options [Object] :parse
115
+ # @option options [string] :parse
116
116
  # Change how messages are treated. Defaults to none. See below.
117
- # @option options [Object] :thread_ts
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 [Object] :username
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,33 +145,33 @@ 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 [Object] :text
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 [Object] :blocks
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 [Object] :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. This argument may not be used with newer bot tokens.
158
- # @option options [Object] :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. This argument may not be used with newer bot tokens.
160
- # @option options [Object] :link_names
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 [Object] :mrkdwn
162
+ # @option options [boolean] :mrkdwn
163
163
  # Disable Slack markup parsing by setting to false. Enabled by default.
164
- # @option options [Object] :parse
164
+ # @option options [string] :parse
165
165
  # Change how messages are treated. Defaults to none. See below.
166
- # @option options [Object] :reply_broadcast
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 [Object] :thread_ts
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 [Object] :unfurl_links
170
+ # @option options [boolean] :unfurl_links
171
171
  # Pass true to enable unfurling of primarily text-based content.
172
- # @option options [Object] :unfurl_media
172
+ # @option options [boolean] :unfurl_media
173
173
  # Pass false to disable unfurling of media content.
174
- # @option options [Object] :username
174
+ # @option options [string] :username
175
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
@@ -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 [Object] :post_at
201
+ # @option options [integer] :post_at
202
202
  # Unix EPOCH timestamp of time in future to send the message.
203
- # @option options [Object] :text
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 [Object] :as_user
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 [Object] :attachments
207
+ # @option options [string] :attachments
208
208
  # A JSON-based array of structured attachments, presented as a URL-encoded string.
209
- # @option options [Object] :blocks
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 [Object] :link_names
211
+ # @option options [boolean] :link_names
212
212
  # Find and link channel names and usernames.
213
- # @option options [Object] :parse
213
+ # @option options [string] :parse
214
214
  # Change how messages are treated. Defaults to none. See chat.postMessage.
215
- # @option options [Object] :reply_broadcast
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 [Object] :thread_ts
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 [Object] :unfurl_links
219
+ # @option options [boolean] :unfurl_links
220
220
  # Pass true to enable unfurling of primarily text-based content.
221
- # @option options [Object] :unfurl_media
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 [Object] :unfurls
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 [Object] :user_auth_required
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.
@@ -250,7 +256,7 @@ module Slack
250
256
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
251
257
  throw ArgumentError.new('Required arguments :ts missing') if options[:ts].nil?
252
258
  throw ArgumentError.new('Required arguments :unfurls missing') if options[:unfurls].nil?
253
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
259
+ options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
254
260
  post('chat.unfurl', options)
255
261
  end
256
262
 
@@ -259,27 +265,31 @@ module Slack
259
265
  #
260
266
  # @option options [channel] :channel
261
267
  # Channel containing the message to be updated.
262
- # @option options [Object] :text
263
- # New text for the message, using the default formatting rules. It's not required when presenting attachments.
264
268
  # @option options [timestamp] :ts
265
269
  # Timestamp of the message to be updated.
266
- # @option options [Object] :as_user
270
+ # @option options [boolean] :as_user
267
271
  # Pass true to update the message as the authed user. Bot users in this context are considered authed users.
268
- # @option options [Object] :attachments
269
- # A JSON-based array of structured attachments, presented as a URL-encoded string. This field is required when not presenting text.
270
- # @option options [Object] :blocks
271
- # A JSON-based array of structured blocks, presented as a URL-encoded string.
272
- # @option options [Object] :link_names
273
- # Find and link channel names and usernames. Defaults to none. See below.
274
- # @option options [Object] :parse
275
- # Change how messages are treated. Defaults to client, unlike chat.postMessage. See below.
272
+ # @option options [string] :attachments
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.
274
+ # @option options [blocks[] as string] :blocks
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.
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
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.
280
+ # @option options [string] :parse
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.
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
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
290
  throw ArgumentError.new('Required arguments :text, :attachments or :blocks missing') if options[:text].nil? && options[:attachments].nil? && options[:blocks].nil?
281
291
  throw ArgumentError.new('Required arguments :ts missing') if options[:ts].nil?
282
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
292
+ options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
283
293
  # attachments must be passed as an encoded JSON string
284
294
  if options.key?(:attachments)
285
295
  attachments = options[:attachments]
@@ -11,18 +11,20 @@ module Slack
11
11
  #
12
12
  # @option options [channel] :channel
13
13
  # The channel of the scheduled messages.
14
- # @option options [Object] :cursor
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 [Object] :limit
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 [string] :team_id
23
+ # encoded team id to list channels in, required if org token is used.
22
24
  # @see https://api.slack.com/methods/chat.scheduledMessages.list
23
25
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/chat.scheduledMessages/chat.scheduledMessages.list.json
24
26
  def chat_scheduledMessages_list(options = {})
25
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
27
+ options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
26
28
  if block_given?
27
29
  Pagination::Cursor.new(self, :chat_scheduledMessages_list, options).each do |page|
28
30
  yield page