slack-ruby-client 0.10.0 → 0.11.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (108) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/.rubocop.yml +3 -0
  4. data/.rubocop_todo.yml +30 -34
  5. data/.travis.yml +0 -1
  6. data/CHANGELOG.md +9 -0
  7. data/CONTRIBUTING.md +2 -2
  8. data/Gemfile +3 -1
  9. data/README.md +1 -1
  10. data/Rakefile +1 -1
  11. data/bin/commands/channels.rb +18 -9
  12. data/bin/commands/chat.rb +24 -3
  13. data/bin/commands/dialog.rb +14 -0
  14. data/bin/commands/files.rb +21 -0
  15. data/bin/commands/groups.rb +10 -10
  16. data/bin/commands/migration.rb +14 -0
  17. data/bin/commands/rtm.rb +2 -4
  18. data/bin/commands/users.rb +18 -18
  19. data/bin/commands/users_admin.rb +28 -0
  20. data/bin/commands/users_prefs.rb +12 -0
  21. data/bin/commands.rb +5 -1
  22. data/bin/slack +1 -1
  23. data/examples/hi_real_time/hi.rb +1 -1
  24. data/examples/hi_real_time_and_web/hi.rb +1 -1
  25. data/examples/hi_real_time_async_celluloid/hi.rb +1 -1
  26. data/examples/hi_real_time_async_eventmachine/hi.rb +1 -1
  27. data/examples/hi_web/hi.rb +1 -1
  28. data/examples/new_ticket/new_ticket.rb +1 -1
  29. data/lib/slack/messages/formatting.rb +4 -4
  30. data/lib/slack/messages/message.rb +1 -2
  31. data/lib/slack/real_time/api/templates/event_handler.erb +1 -1
  32. data/lib/slack/real_time/client.rb +10 -9
  33. data/lib/slack/real_time/concurrency/celluloid.rb +5 -1
  34. data/lib/slack/real_time/config.rb +11 -11
  35. data/lib/slack/real_time/models/base.rb +1 -2
  36. data/lib/slack/real_time/socket.rb +2 -2
  37. data/lib/slack/real_time/stores/base.rb +1 -2
  38. data/lib/slack/real_time/stores/starter.rb +76 -76
  39. data/lib/slack/real_time/stores/store.rb +104 -94
  40. data/lib/slack/version.rb +1 -1
  41. data/lib/slack/web/api/endpoints/api.rb +1 -1
  42. data/lib/slack/web/api/endpoints/apps_permissions.rb +2 -2
  43. data/lib/slack/web/api/endpoints/auth.rb +2 -2
  44. data/lib/slack/web/api/endpoints/bots.rb +1 -1
  45. data/lib/slack/web/api/endpoints/channels.rb +27 -15
  46. data/lib/slack/web/api/endpoints/chat.rb +42 -9
  47. data/lib/slack/web/api/endpoints/conversations.rb +17 -17
  48. data/lib/slack/web/api/endpoints/dialog.rb +32 -0
  49. data/lib/slack/web/api/endpoints/dnd.rb +5 -5
  50. data/lib/slack/web/api/endpoints/emoji.rb +1 -1
  51. data/lib/slack/web/api/endpoints/files.rb +37 -6
  52. data/lib/slack/web/api/endpoints/files_comments.rb +3 -3
  53. data/lib/slack/web/api/endpoints/groups.rb +17 -17
  54. data/lib/slack/web/api/endpoints/im.rb +6 -6
  55. data/lib/slack/web/api/endpoints/migration.rb +25 -0
  56. data/lib/slack/web/api/endpoints/mpim.rb +6 -6
  57. data/lib/slack/web/api/endpoints/oauth.rb +2 -2
  58. data/lib/slack/web/api/endpoints/pins.rb +3 -3
  59. data/lib/slack/web/api/endpoints/presence.rb +1 -1
  60. data/lib/slack/web/api/endpoints/reactions.rb +4 -4
  61. data/lib/slack/web/api/endpoints/reminders.rb +5 -5
  62. data/lib/slack/web/api/endpoints/rtm.rb +3 -7
  63. data/lib/slack/web/api/endpoints/search.rb +3 -3
  64. data/lib/slack/web/api/endpoints/stars.rb +3 -3
  65. data/lib/slack/web/api/endpoints/team.rb +4 -4
  66. data/lib/slack/web/api/endpoints/team_profile.rb +1 -1
  67. data/lib/slack/web/api/endpoints/usergroups.rb +5 -5
  68. data/lib/slack/web/api/endpoints/usergroups_users.rb +2 -2
  69. data/lib/slack/web/api/endpoints/users.rb +8 -8
  70. data/lib/slack/web/api/endpoints/users_admin.rb +46 -0
  71. data/lib/slack/web/api/endpoints/users_prefs.rb +19 -0
  72. data/lib/slack/web/api/endpoints/users_profile.rb +2 -2
  73. data/lib/slack/web/api/endpoints.rb +10 -2
  74. data/lib/slack/web/api/mixins/ids.id.rb +1 -1
  75. data/lib/slack/web/api/mixins/users.search.rb +38 -36
  76. data/lib/slack/web/api/patches/chat.1.text-attachments-required.patch +1 -1
  77. data/lib/slack/web/api/patches/chat.3.update-attachments-support.patch +1 -1
  78. data/lib/slack/web/api/patches/dialog.1.open-json-support.patch +17 -0
  79. data/lib/slack/web/api/templates/command.erb +2 -1
  80. data/lib/slack/web/api/templates/commands.erb +1 -1
  81. data/lib/slack/web/api/templates/endpoints.erb +2 -2
  82. data/lib/slack/web/api/templates/method.erb +8 -3
  83. data/lib/slack/web/api/templates/method_spec.erb +1 -1
  84. data/lib/slack/web/config.rb +12 -12
  85. data/lib/slack/web/faraday/response/raise_error.rb +3 -3
  86. data/lib/tasks/git.rake +1 -1
  87. data/lib/tasks/real_time.rake +1 -1
  88. data/lib/tasks/web.rake +4 -1
  89. data/slack-ruby-client.gemspec +2 -3
  90. data/spec/slack/messages/formatting_spec.rb +1 -1
  91. data/spec/slack/real_time/client_spec.rb +3 -2
  92. data/spec/slack/real_time/concurrency/celluloid_spec.rb +1 -1
  93. data/spec/slack/real_time/concurrency/it_behaves_like_a_realtime_socket.rb +1 -1
  94. data/spec/slack/real_time/event_handlers/bot_spec.rb +4 -2
  95. data/spec/slack/real_time/event_handlers/event_handlers_spec.rb +1 -1
  96. data/spec/slack/real_time/event_handlers/user_spec.rb +4 -2
  97. data/spec/slack/web/api/endpoints/custom_specs/dialog_spec.rb +28 -0
  98. data/spec/slack/web/api/endpoints/custom_specs/users_spec.rb +8 -6
  99. data/spec/slack/web/api/endpoints/files_spec.rb +16 -0
  100. data/spec/slack/web/api/endpoints/migration_spec.rb +12 -0
  101. data/spec/slack/web/api/endpoints/users_admin_spec.rb +17 -0
  102. data/spec/slack/web/api/endpoints/users_prefs_spec.rb +7 -0
  103. data/spec/slack/web/api/error_spec.rb +1 -1
  104. data/spec/slack/web/api/errors/slack_error_spec.rb +1 -1
  105. data/spec/slack/web/api/mixins/users_spec.rb +6 -4
  106. data/spec/support/queue_with_timeout.rb +1 -1
  107. data/spec/support/real_time/concurrency/mock.rb +1 -2
  108. metadata +34 -31
data/lib/slack/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Slack
2
- VERSION = '0.10.0'.freeze
2
+ VERSION = '0.11.0'.freeze
3
3
  end
@@ -13,7 +13,7 @@ module Slack
13
13
  # @option options [Object] :foo
14
14
  # example property to return.
15
15
  # @see https://api.slack.com/methods/api.test
16
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/api/api.test.json
16
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/api/api.test.json
17
17
  def api_test(options = {})
18
18
  post('api.test', options)
19
19
  end
@@ -9,7 +9,7 @@ module Slack
9
9
  # Returns list of permissions this app has on a team.
10
10
  #
11
11
  # @see https://api.slack.com/methods/apps.permissions.info
12
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/apps.permissions/apps.permissions.info.json
12
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/apps.permissions/apps.permissions.info.json
13
13
  def apps_permissions_info(options = {})
14
14
  post('apps.permissions.info', options)
15
15
  end
@@ -22,7 +22,7 @@ module Slack
22
22
  # @option options [Object] :trigger_id
23
23
  # Token used to trigger the permissions API.
24
24
  # @see https://api.slack.com/methods/apps.permissions.request
25
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/apps.permissions/apps.permissions.request.json
25
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/apps.permissions/apps.permissions.request.json
26
26
  def apps_permissions_request(options = {})
27
27
  throw ArgumentError.new('Required arguments :scopes missing') if options[:scopes].nil?
28
28
  throw ArgumentError.new('Required arguments :trigger_id missing') if options[:trigger_id].nil?
@@ -11,7 +11,7 @@ module Slack
11
11
  # @option options [Object] :test
12
12
  # Setting this parameter to 1 triggers a testing mode where the specified token will not actually be revoked.
13
13
  # @see https://api.slack.com/methods/auth.revoke
14
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/auth/auth.revoke.json
14
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/auth/auth.revoke.json
15
15
  def auth_revoke(options = {})
16
16
  post('auth.revoke', options)
17
17
  end
@@ -20,7 +20,7 @@ module Slack
20
20
  # Checks authentication & identity.
21
21
  #
22
22
  # @see https://api.slack.com/methods/auth.test
23
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/auth/auth.test.json
23
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/auth/auth.test.json
24
24
  def auth_test(options = {})
25
25
  post('auth.test', options)
26
26
  end
@@ -11,7 +11,7 @@ module Slack
11
11
  # @option options [Object] :bot
12
12
  # Bot user to get info on.
13
13
  # @see https://api.slack.com/methods/bots.info
14
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/bots/bots.info.json
14
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/bots/bots.info.json
15
15
  def bots_info(options = {})
16
16
  post('bots.info', options)
17
17
  end
@@ -11,7 +11,7 @@ module Slack
11
11
  # @option options [channel] :channel
12
12
  # Channel to archive.
13
13
  # @see https://api.slack.com/methods/channels.archive
14
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/channels/channels.archive.json
14
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/channels/channels.archive.json
15
15
  def channels_archive(options = {})
16
16
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
17
17
  options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
@@ -26,12 +26,24 @@ module Slack
26
26
  # @option options [Object] :validate
27
27
  # Whether to return errors on invalid channel name instead of modifying it to meet the specified criteria.
28
28
  # @see https://api.slack.com/methods/channels.create
29
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/channels/channels.create.json
29
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/channels/channels.create.json
30
30
  def channels_create(options = {})
31
31
  throw ArgumentError.new('Required arguments :name missing') if options[:name].nil?
32
32
  post('channels.create', options)
33
33
  end
34
34
 
35
+ #
36
+ # Delete a channel (undocumented)
37
+ #
38
+ # @option options [channel] :channel
39
+ # Channel to delete.
40
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/undocumented/channels/channels.delete.json
41
+ def channels_delete(options = {})
42
+ throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
43
+ options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
44
+ post('channels.delete', options)
45
+ end
46
+
35
47
  #
36
48
  # Fetches history of messages and events from a channel.
37
49
  #
@@ -46,7 +58,7 @@ module Slack
46
58
  # @option options [Object] :unreads
47
59
  # Include unread_count_display in the output?.
48
60
  # @see https://api.slack.com/methods/channels.history
49
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/channels/channels.history.json
61
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/channels/channels.history.json
50
62
  def channels_history(options = {})
51
63
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
52
64
  options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
@@ -61,7 +73,7 @@ module Slack
61
73
  # @option options [Object] :include_locale
62
74
  # Set this to true to receive the locale for this channel. Defaults to false.
63
75
  # @see https://api.slack.com/methods/channels.info
64
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/channels/channels.info.json
76
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/channels/channels.info.json
65
77
  def channels_info(options = {})
66
78
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
67
79
  options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
@@ -76,7 +88,7 @@ module Slack
76
88
  # @option options [user] :user
77
89
  # User to invite to channel.
78
90
  # @see https://api.slack.com/methods/channels.invite
79
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/channels/channels.invite.json
91
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/channels/channels.invite.json
80
92
  def channels_invite(options = {})
81
93
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
82
94
  throw ArgumentError.new('Required arguments :user missing') if options[:user].nil?
@@ -93,7 +105,7 @@ module Slack
93
105
  # @option options [Object] :validate
94
106
  # Whether to return errors on invalid channel name instead of modifying it to meet the specified criteria.
95
107
  # @see https://api.slack.com/methods/channels.join
96
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/channels/channels.join.json
108
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/channels/channels.join.json
97
109
  def channels_join(options = {})
98
110
  throw ArgumentError.new('Required arguments :name missing') if options[:name].nil?
99
111
  post('channels.join', options)
@@ -107,7 +119,7 @@ module Slack
107
119
  # @option options [user] :user
108
120
  # User to remove from channel.
109
121
  # @see https://api.slack.com/methods/channels.kick
110
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/channels/channels.kick.json
122
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/channels/channels.kick.json
111
123
  def channels_kick(options = {})
112
124
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
113
125
  throw ArgumentError.new('Required arguments :user missing') if options[:user].nil?
@@ -122,7 +134,7 @@ module Slack
122
134
  # @option options [channel] :channel
123
135
  # Channel to leave.
124
136
  # @see https://api.slack.com/methods/channels.leave
125
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/channels/channels.leave.json
137
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/channels/channels.leave.json
126
138
  def channels_leave(options = {})
127
139
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
128
140
  options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
@@ -141,7 +153,7 @@ module Slack
141
153
  # @option options [Object] :limit
142
154
  # 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.
143
155
  # @see https://api.slack.com/methods/channels.list
144
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/channels/channels.list.json
156
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/channels/channels.list.json
145
157
  def channels_list(options = {})
146
158
  if block_given?
147
159
  Pagination::Cursor.new(self, :channels_list, options).each do |page|
@@ -160,7 +172,7 @@ module Slack
160
172
  # @option options [timestamp] :ts
161
173
  # Timestamp of the most recently seen message.
162
174
  # @see https://api.slack.com/methods/channels.mark
163
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/channels/channels.mark.json
175
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/channels/channels.mark.json
164
176
  def channels_mark(options = {})
165
177
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
166
178
  throw ArgumentError.new('Required arguments :ts missing') if options[:ts].nil?
@@ -178,7 +190,7 @@ module Slack
178
190
  # @option options [Object] :validate
179
191
  # Whether to return errors on invalid channel name instead of modifying it to meet the specified criteria.
180
192
  # @see https://api.slack.com/methods/channels.rename
181
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/channels/channels.rename.json
193
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/channels/channels.rename.json
182
194
  def channels_rename(options = {})
183
195
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
184
196
  throw ArgumentError.new('Required arguments :name missing') if options[:name].nil?
@@ -194,7 +206,7 @@ module Slack
194
206
  # @option options [Object] :thread_ts
195
207
  # Unique identifier of a thread's parent message.
196
208
  # @see https://api.slack.com/methods/channels.replies
197
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/channels/channels.replies.json
209
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/channels/channels.replies.json
198
210
  def channels_replies(options = {})
199
211
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
200
212
  throw ArgumentError.new('Required arguments :thread_ts missing') if options[:thread_ts].nil?
@@ -210,7 +222,7 @@ module Slack
210
222
  # @option options [Object] :purpose
211
223
  # The new purpose.
212
224
  # @see https://api.slack.com/methods/channels.setPurpose
213
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/channels/channels.setPurpose.json
225
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/channels/channels.setPurpose.json
214
226
  def channels_setPurpose(options = {})
215
227
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
216
228
  throw ArgumentError.new('Required arguments :purpose missing') if options[:purpose].nil?
@@ -226,7 +238,7 @@ module Slack
226
238
  # @option options [Object] :topic
227
239
  # The new topic.
228
240
  # @see https://api.slack.com/methods/channels.setTopic
229
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/channels/channels.setTopic.json
241
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/channels/channels.setTopic.json
230
242
  def channels_setTopic(options = {})
231
243
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
232
244
  throw ArgumentError.new('Required arguments :topic missing') if options[:topic].nil?
@@ -240,7 +252,7 @@ module Slack
240
252
  # @option options [channel] :channel
241
253
  # Channel to unarchive.
242
254
  # @see https://api.slack.com/methods/channels.unarchive
243
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/channels/channels.unarchive.json
255
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/channels/channels.unarchive.json
244
256
  def channels_unarchive(options = {})
245
257
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
246
258
  options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
@@ -5,6 +5,23 @@ module Slack
5
5
  module Api
6
6
  module Endpoints
7
7
  module Chat
8
+ #
9
+ # Execute a slash command in a public channel (undocumented)
10
+ #
11
+ # @option options [channel] :channel
12
+ # Channel to execute the command in.
13
+ # @option options [Object] :command
14
+ # Slash command to be executed. Leading backslash is required.
15
+ # @option options [Object] :text
16
+ # Additional parameters provided to the slash command.
17
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/undocumented/chat/chat.command.json
18
+ def chat_command(options = {})
19
+ throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
20
+ throw ArgumentError.new('Required arguments :command missing') if options[:command].nil?
21
+ options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
22
+ post('chat.command', options)
23
+ end
24
+
8
25
  #
9
26
  # Deletes a message.
10
27
  #
@@ -13,9 +30,9 @@ module Slack
13
30
  # @option options [timestamp] :ts
14
31
  # Timestamp of the message to be deleted.
15
32
  # @option options [Object] :as_user
16
- # Pass true to delete the message as the authed user. Bot users in this context are considered authed users.
33
+ # 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.
17
34
  # @see https://api.slack.com/methods/chat.delete
18
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/chat/chat.delete.json
35
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/chat/chat.delete.json
19
36
  def chat_delete(options = {})
20
37
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
21
38
  throw ArgumentError.new('Required arguments :ts missing') if options[:ts].nil?
@@ -23,6 +40,22 @@ module Slack
23
40
  post('chat.delete', options)
24
41
  end
25
42
 
43
+ #
44
+ # Retrieve a permalink URL for a specific extant message
45
+ #
46
+ # @option options [channel] :channel
47
+ # The ID of the conversation or channel containing the message.
48
+ # @option options [Object] :message_ts
49
+ # A message's ts value, uniquely identifying it within a channel.
50
+ # @see https://api.slack.com/methods/chat.getPermalink
51
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/chat/chat.getPermalink.json
52
+ def chat_getPermalink(options = {})
53
+ throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
54
+ throw ArgumentError.new('Required arguments :message_ts missing') if options[:message_ts].nil?
55
+ options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
56
+ post('chat.getPermalink', options)
57
+ end
58
+
26
59
  #
27
60
  # Share a me message into a channel.
28
61
  #
@@ -31,7 +64,7 @@ module Slack
31
64
  # @option options [Object] :text
32
65
  # Text of the message to send.
33
66
  # @see https://api.slack.com/methods/chat.meMessage
34
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/chat/chat.meMessage.json
67
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/chat/chat.meMessage.json
35
68
  def chat_meMessage(options = {})
36
69
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
37
70
  throw ArgumentError.new('Required arguments :text missing') if options[:text].nil?
@@ -56,7 +89,7 @@ module Slack
56
89
  # @option options [Object] :parse
57
90
  # Change how messages are treated. Defaults to none. See below.
58
91
  # @see https://api.slack.com/methods/chat.postEphemeral
59
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/chat/chat.postEphemeral.json
92
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/chat/chat.postEphemeral.json
60
93
  def chat_postEphemeral(options = {})
61
94
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
62
95
  throw ArgumentError.new('Required arguments :text missing') if options[:text].nil?
@@ -101,7 +134,7 @@ module Slack
101
134
  # @option options [Object] :username
102
135
  # Set your bot's user name. Must be used in conjunction with as_user set to false, otherwise ignored. See authorship below.
103
136
  # @see https://api.slack.com/methods/chat.postMessage
104
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/chat/chat.postMessage.json
137
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/chat/chat.postMessage.json
105
138
  def chat_postMessage(options = {})
106
139
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
107
140
  throw ArgumentError.new('Required arguments :text or :attachments missing') if options[:text].nil? && options[:attachments].nil?
@@ -130,7 +163,7 @@ module Slack
130
163
  # @option options [Object] :user_auth_url
131
164
  # Send users to this custom URL where they will complete authentication in your app to fully trigger unfurling. Value should be properly URL-encoded.
132
165
  # @see https://api.slack.com/methods/chat.unfurl
133
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/chat/chat.unfurl.json
166
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/chat/chat.unfurl.json
134
167
  def chat_unfurl(options = {})
135
168
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
136
169
  throw ArgumentError.new('Required arguments :ts missing') if options[:ts].nil?
@@ -145,19 +178,19 @@ module Slack
145
178
  # @option options [channel] :channel
146
179
  # Channel containing the message to be updated.
147
180
  # @option options [Object] :text
148
- # New text for the message, using the default formatting rules.
181
+ # New text for the message, using the default formatting rules. It's not required when presenting attachments.
149
182
  # @option options [timestamp] :ts
150
183
  # Timestamp of the message to be updated.
151
184
  # @option options [Object] :as_user
152
185
  # Pass true to update the message as the authed user. Bot users in this context are considered authed users.
153
186
  # @option options [Object] :attachments
154
- # A JSON-based array of structured attachments, presented as a URL-encoded string.
187
+ # A JSON-based array of structured attachments, presented as a URL-encoded string. This field is required when not presenting text.
155
188
  # @option options [Object] :link_names
156
189
  # Find and link channel names and usernames. Defaults to none. This parameter should be used in conjunction with parse. To set link_names to 1, specify a parse mode of full.
157
190
  # @option options [Object] :parse
158
191
  # Change how messages are treated. Defaults to client, unlike chat.postMessage. See below.
159
192
  # @see https://api.slack.com/methods/chat.update
160
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/chat/chat.update.json
193
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/chat/chat.update.json
161
194
  def chat_update(options = {})
162
195
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
163
196
  throw ArgumentError.new('Required arguments :text or :attachments missing') if options[:text].nil? && options[:attachments].nil?
@@ -11,7 +11,7 @@ module Slack
11
11
  # @option options [channel] :channel
12
12
  # ID of conversation to archive.
13
13
  # @see https://api.slack.com/methods/conversations.archive
14
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/conversations/conversations.archive.json
14
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.archive.json
15
15
  def conversations_archive(options = {})
16
16
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
17
17
  options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
@@ -24,7 +24,7 @@ module Slack
24
24
  # @option options [channel] :channel
25
25
  # Conversation to close.
26
26
  # @see https://api.slack.com/methods/conversations.close
27
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/conversations/conversations.close.json
27
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.close.json
28
28
  def conversations_close(options = {})
29
29
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
30
30
  options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
@@ -39,7 +39,7 @@ module Slack
39
39
  # @option options [Object] :is_private
40
40
  # Create a private channel instead of a public one.
41
41
  # @see https://api.slack.com/methods/conversations.create
42
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/conversations/conversations.create.json
42
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.create.json
43
43
  def conversations_create(options = {})
44
44
  throw ArgumentError.new('Required arguments :name missing') if options[:name].nil?
45
45
  post('conversations.create', options)
@@ -59,7 +59,7 @@ module Slack
59
59
  # @option options [timestamp] :oldest
60
60
  # Start of time range of messages to include in results.
61
61
  # @see https://api.slack.com/methods/conversations.history
62
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/conversations/conversations.history.json
62
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.history.json
63
63
  def conversations_history(options = {})
64
64
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
65
65
  options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
@@ -80,7 +80,7 @@ module Slack
80
80
  # @option options [Object] :include_locale
81
81
  # Set this to true to receive the locale for this conversation. Defaults to false.
82
82
  # @see https://api.slack.com/methods/conversations.info
83
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/conversations/conversations.info.json
83
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.info.json
84
84
  def conversations_info(options = {})
85
85
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
86
86
  options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
@@ -95,7 +95,7 @@ module Slack
95
95
  # @option options [Object] :users
96
96
  # A comma separated list of user IDs. Up to 30 users may be listed.
97
97
  # @see https://api.slack.com/methods/conversations.invite
98
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/conversations/conversations.invite.json
98
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.invite.json
99
99
  def conversations_invite(options = {})
100
100
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
101
101
  throw ArgumentError.new('Required arguments :users missing') if options[:users].nil?
@@ -109,7 +109,7 @@ module Slack
109
109
  # @option options [channel] :channel
110
110
  # ID of conversation to join.
111
111
  # @see https://api.slack.com/methods/conversations.join
112
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/conversations/conversations.join.json
112
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.join.json
113
113
  def conversations_join(options = {})
114
114
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
115
115
  options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
@@ -124,7 +124,7 @@ module Slack
124
124
  # @option options [user] :user
125
125
  # User ID to be removed.
126
126
  # @see https://api.slack.com/methods/conversations.kick
127
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/conversations/conversations.kick.json
127
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.kick.json
128
128
  def conversations_kick(options = {})
129
129
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
130
130
  throw ArgumentError.new('Required arguments :user missing') if options[:user].nil?
@@ -139,7 +139,7 @@ module Slack
139
139
  # @option options [channel] :channel
140
140
  # Conversation to leave.
141
141
  # @see https://api.slack.com/methods/conversations.leave
142
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/conversations/conversations.leave.json
142
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.leave.json
143
143
  def conversations_leave(options = {})
144
144
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
145
145
  options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
@@ -158,7 +158,7 @@ module Slack
158
158
  # @option options [Object] :types
159
159
  # Mix and match channel types by providing a comma-separated list of any combination of public_channel, private_channel, mpim, im.
160
160
  # @see https://api.slack.com/methods/conversations.list
161
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/conversations/conversations.list.json
161
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.list.json
162
162
  def conversations_list(options = {})
163
163
  if block_given?
164
164
  Pagination::Cursor.new(self, :conversations_list, options).each do |page|
@@ -179,7 +179,7 @@ module Slack
179
179
  # @option options [Object] :limit
180
180
  # 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.
181
181
  # @see https://api.slack.com/methods/conversations.members
182
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/conversations/conversations.members.json
182
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.members.json
183
183
  def conversations_members(options = {})
184
184
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
185
185
  options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
@@ -202,7 +202,7 @@ module Slack
202
202
  # @option options [Object] :users
203
203
  # Comma separated lists of users. If only one user is included, this creates a 1:1 DM. The ordering of the users is preserved whenever a multi-person direct message is returned. Supply a channel when not supplying users.
204
204
  # @see https://api.slack.com/methods/conversations.open
205
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/conversations/conversations.open.json
205
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.open.json
206
206
  def conversations_open(options = {})
207
207
  options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
208
208
  post('conversations.open', options)
@@ -216,7 +216,7 @@ module Slack
216
216
  # @option options [Object] :name
217
217
  # New name for conversation.
218
218
  # @see https://api.slack.com/methods/conversations.rename
219
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/conversations/conversations.rename.json
219
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.rename.json
220
220
  def conversations_rename(options = {})
221
221
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
222
222
  throw ArgumentError.new('Required arguments :name missing') if options[:name].nil?
@@ -236,7 +236,7 @@ module Slack
236
236
  # @option options [Object] :limit
237
237
  # 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.
238
238
  # @see https://api.slack.com/methods/conversations.replies
239
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/conversations/conversations.replies.json
239
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.replies.json
240
240
  def conversations_replies(options = {})
241
241
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
242
242
  throw ArgumentError.new('Required arguments :ts missing') if options[:ts].nil?
@@ -258,7 +258,7 @@ module Slack
258
258
  # @option options [Object] :purpose
259
259
  # A new, specialer purpose.
260
260
  # @see https://api.slack.com/methods/conversations.setPurpose
261
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/conversations/conversations.setPurpose.json
261
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.setPurpose.json
262
262
  def conversations_setPurpose(options = {})
263
263
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
264
264
  throw ArgumentError.new('Required arguments :purpose missing') if options[:purpose].nil?
@@ -274,7 +274,7 @@ module Slack
274
274
  # @option options [Object] :topic
275
275
  # The new topic string. Does not support formatting or linkification.
276
276
  # @see https://api.slack.com/methods/conversations.setTopic
277
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/conversations/conversations.setTopic.json
277
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.setTopic.json
278
278
  def conversations_setTopic(options = {})
279
279
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
280
280
  throw ArgumentError.new('Required arguments :topic missing') if options[:topic].nil?
@@ -288,7 +288,7 @@ module Slack
288
288
  # @option options [channel] :channel
289
289
  # ID of conversation to unarchive.
290
290
  # @see https://api.slack.com/methods/conversations.unarchive
291
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/conversations/conversations.unarchive.json
291
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.unarchive.json
292
292
  def conversations_unarchive(options = {})
293
293
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
294
294
  options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]