slack-ruby-client 0.6.0 → 0.7.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 (127) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop_todo.yml +19 -17
  3. data/.travis.yml +1 -0
  4. data/CHANGELOG.md +8 -0
  5. data/README.md +24 -4
  6. data/bin/commands/chat.rb +10 -9
  7. data/bin/commands/files.rb +19 -1
  8. data/examples/hi_real_time/hi.rb +2 -0
  9. data/lib/slack-ruby-client.rb +4 -2
  10. data/lib/slack/config.rb +4 -0
  11. data/lib/slack/logger.rb +13 -0
  12. data/lib/slack/messages/message.rb +6 -0
  13. data/lib/slack/real_time/api/schema/event.json +1 -0
  14. data/lib/slack/real_time/api/templates/event_handler.erb +4 -18
  15. data/lib/slack/real_time/client.rb +29 -5
  16. data/lib/slack/real_time/concurrency/celluloid.rb +6 -0
  17. data/lib/slack/real_time/concurrency/eventmachine.rb +22 -1
  18. data/lib/slack/real_time/config.rb +5 -1
  19. data/lib/slack/real_time/socket.rb +5 -0
  20. data/lib/slack/real_time/stores.rb +10 -0
  21. data/lib/slack/real_time/stores/base.rb +34 -0
  22. data/lib/slack/real_time/stores/starter.rb +361 -0
  23. data/lib/slack/real_time/stores/store.rb +479 -0
  24. data/lib/slack/version.rb +1 -1
  25. data/lib/slack/web/api/endpoints/api.rb +1 -1
  26. data/lib/slack/web/api/endpoints/auth.rb +1 -1
  27. data/lib/slack/web/api/endpoints/channels.rb +14 -14
  28. data/lib/slack/web/api/endpoints/chat.rb +15 -13
  29. data/lib/slack/web/api/endpoints/dnd.rb +5 -5
  30. data/lib/slack/web/api/endpoints/emoji.rb +1 -1
  31. data/lib/slack/web/api/endpoints/files.rb +30 -6
  32. data/lib/slack/web/api/endpoints/groups.rb +16 -16
  33. data/lib/slack/web/api/endpoints/im.rb +5 -5
  34. data/lib/slack/web/api/endpoints/mpim.rb +5 -5
  35. data/lib/slack/web/api/endpoints/oauth.rb +1 -1
  36. data/lib/slack/web/api/endpoints/pins.rb +3 -3
  37. data/lib/slack/web/api/endpoints/reactions.rb +4 -4
  38. data/lib/slack/web/api/endpoints/rtm.rb +1 -1
  39. data/lib/slack/web/api/endpoints/search.rb +3 -3
  40. data/lib/slack/web/api/endpoints/stars.rb +3 -3
  41. data/lib/slack/web/api/endpoints/team.rb +3 -3
  42. data/lib/slack/web/api/endpoints/usergroups.rb +6 -6
  43. data/lib/slack/web/api/endpoints/users.rb +5 -5
  44. data/lib/slack/web/api/patches/chat.1.text-attachments-required.patch +1 -1
  45. data/lib/slack/web/api/templates/method.erb +1 -1
  46. data/lib/slack/web/client.rb +1 -0
  47. data/lib/tasks/real_time.rake +27 -21
  48. data/slack-ruby-client.gemspec +1 -0
  49. data/spec/integration/integration_spec.rb +13 -1
  50. data/spec/slack/real_time/client_spec.rb +40 -5
  51. data/spec/slack/real_time/concurrency/celluloid_spec.rb +2 -1
  52. data/spec/slack/real_time/concurrency/eventmachine_spec.rb +3 -2
  53. data/spec/slack/real_time/event_handlers/event_handlers_spec.rb +15 -0
  54. data/spec/slack/real_time/event_handlers/team_spec.rb +54 -52
  55. data/spec/slack/web/api/endpoints/files_spec.rb +10 -0
  56. data/spec/slack/web/client_spec.rb +1 -1
  57. data/spec/support/real_time/connected_client.rb +3 -3
  58. metadata +23 -71
  59. data/lib/slack/real_time/api/templates/event_handlers.erb +0 -5
  60. data/lib/slack/real_time/event_handlers.rb +0 -66
  61. data/lib/slack/real_time/event_handlers/accounts_changed.rb +0 -18
  62. data/lib/slack/real_time/event_handlers/bot_added.rb +0 -16
  63. data/lib/slack/real_time/event_handlers/bot_changed.rb +0 -17
  64. data/lib/slack/real_time/event_handlers/channel_archive.rb +0 -17
  65. data/lib/slack/real_time/event_handlers/channel_created.rb +0 -17
  66. data/lib/slack/real_time/event_handlers/channel_deleted.rb +0 -16
  67. data/lib/slack/real_time/event_handlers/channel_history_changed.rb +0 -18
  68. data/lib/slack/real_time/event_handlers/channel_joined.rb +0 -22
  69. data/lib/slack/real_time/event_handlers/channel_left.rb +0 -17
  70. data/lib/slack/real_time/event_handlers/channel_marked.rb +0 -18
  71. data/lib/slack/real_time/event_handlers/channel_rename.rb +0 -17
  72. data/lib/slack/real_time/event_handlers/channel_unarchive.rb +0 -17
  73. data/lib/slack/real_time/event_handlers/commands_changed.rb +0 -18
  74. data/lib/slack/real_time/event_handlers/dnd_updated.rb +0 -18
  75. data/lib/slack/real_time/event_handlers/dnd_updated_user.rb +0 -18
  76. data/lib/slack/real_time/event_handlers/email_domain_changed.rb +0 -16
  77. data/lib/slack/real_time/event_handlers/emoji_changed.rb +0 -18
  78. data/lib/slack/real_time/event_handlers/file_change.rb +0 -18
  79. data/lib/slack/real_time/event_handlers/file_comment_added.rb +0 -18
  80. data/lib/slack/real_time/event_handlers/file_comment_deleted.rb +0 -18
  81. data/lib/slack/real_time/event_handlers/file_comment_edited.rb +0 -18
  82. data/lib/slack/real_time/event_handlers/file_created.rb +0 -18
  83. data/lib/slack/real_time/event_handlers/file_deleted.rb +0 -18
  84. data/lib/slack/real_time/event_handlers/file_private.rb +0 -18
  85. data/lib/slack/real_time/event_handlers/file_public.rb +0 -18
  86. data/lib/slack/real_time/event_handlers/file_shared.rb +0 -18
  87. data/lib/slack/real_time/event_handlers/file_unshared.rb +0 -18
  88. data/lib/slack/real_time/event_handlers/group_archive.rb +0 -17
  89. data/lib/slack/real_time/event_handlers/group_close.rb +0 -16
  90. data/lib/slack/real_time/event_handlers/group_history_changed.rb +0 -18
  91. data/lib/slack/real_time/event_handlers/group_joined.rb +0 -16
  92. data/lib/slack/real_time/event_handlers/group_left.rb +0 -17
  93. data/lib/slack/real_time/event_handlers/group_marked.rb +0 -18
  94. data/lib/slack/real_time/event_handlers/group_open.rb +0 -16
  95. data/lib/slack/real_time/event_handlers/group_rename.rb +0 -17
  96. data/lib/slack/real_time/event_handlers/group_unarchive.rb +0 -17
  97. data/lib/slack/real_time/event_handlers/im_close.rb +0 -16
  98. data/lib/slack/real_time/event_handlers/im_created.rb +0 -16
  99. data/lib/slack/real_time/event_handlers/im_history_changed.rb +0 -18
  100. data/lib/slack/real_time/event_handlers/im_marked.rb +0 -18
  101. data/lib/slack/real_time/event_handlers/im_open.rb +0 -16
  102. data/lib/slack/real_time/event_handlers/manual_presence_change.rb +0 -16
  103. data/lib/slack/real_time/event_handlers/pin_added.rb +0 -18
  104. data/lib/slack/real_time/event_handlers/pin_removed.rb +0 -18
  105. data/lib/slack/real_time/event_handlers/pref_change.rb +0 -16
  106. data/lib/slack/real_time/event_handlers/presence_change.rb +0 -17
  107. data/lib/slack/real_time/event_handlers/reaction_added.rb +0 -18
  108. data/lib/slack/real_time/event_handlers/reaction_removed.rb +0 -18
  109. data/lib/slack/real_time/event_handlers/reconnect_url.rb +0 -18
  110. data/lib/slack/real_time/event_handlers/star_added.rb +0 -18
  111. data/lib/slack/real_time/event_handlers/star_removed.rb +0 -18
  112. data/lib/slack/real_time/event_handlers/subteam_created.rb +0 -18
  113. data/lib/slack/real_time/event_handlers/subteam_self_added.rb +0 -18
  114. data/lib/slack/real_time/event_handlers/subteam_self_removed.rb +0 -18
  115. data/lib/slack/real_time/event_handlers/subteam_updated.rb +0 -18
  116. data/lib/slack/real_time/event_handlers/team_domain_change.rb +0 -17
  117. data/lib/slack/real_time/event_handlers/team_join.rb +0 -16
  118. data/lib/slack/real_time/event_handlers/team_migration_started.rb +0 -18
  119. data/lib/slack/real_time/event_handlers/team_plan_change.rb +0 -16
  120. data/lib/slack/real_time/event_handlers/team_pref_change.rb +0 -16
  121. data/lib/slack/real_time/event_handlers/team_profile_change.rb +0 -18
  122. data/lib/slack/real_time/event_handlers/team_profile_delete.rb +0 -18
  123. data/lib/slack/real_time/event_handlers/team_profile_reorder.rb +0 -18
  124. data/lib/slack/real_time/event_handlers/team_rename.rb +0 -16
  125. data/lib/slack/real_time/event_handlers/user_change.rb +0 -16
  126. data/lib/slack/real_time/event_handlers/user_typing.rb +0 -18
  127. data/lib/slack/real_time/store.rb +0 -47
@@ -1,3 +1,3 @@
1
1
  module Slack
2
- VERSION = '0.6.0'
2
+ VERSION = '0.7.0'
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.test.json
16
+ # @see https://github.com/dblock/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
  # This method checks authentication and tells you who you are.
10
10
  #
11
11
  # @see https://api.slack.com/methods/auth.test
12
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/auth.test.json
12
+ # @see https://github.com/dblock/slack-api-ref/blob/master/methods/auth/auth.test.json
13
13
  def auth_test(options = {})
14
14
  post('auth.test', options)
15
15
  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.archive.json
14
+ # @see https://github.com/dblock/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]
@@ -24,7 +24,7 @@ module Slack
24
24
  # @option options [Object] :name
25
25
  # Name of channel to create.
26
26
  # @see https://api.slack.com/methods/channels.create
27
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/channels.create.json
27
+ # @see https://github.com/dblock/slack-api-ref/blob/master/methods/channels/channels.create.json
28
28
  def channels_create(options = {})
29
29
  throw ArgumentError.new('Required arguments :name missing') if options[:name].nil?
30
30
  post('channels.create', options)
@@ -44,7 +44,7 @@ module Slack
44
44
  # @option options [Object] :unreads
45
45
  # Include unread_count_display in the output?.
46
46
  # @see https://api.slack.com/methods/channels.history
47
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/channels.history.json
47
+ # @see https://github.com/dblock/slack-api-ref/blob/master/methods/channels/channels.history.json
48
48
  def channels_history(options = {})
49
49
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
50
50
  options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
@@ -57,7 +57,7 @@ module Slack
57
57
  # @option options [channel] :channel
58
58
  # Channel to get info on.
59
59
  # @see https://api.slack.com/methods/channels.info
60
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/channels.info.json
60
+ # @see https://github.com/dblock/slack-api-ref/blob/master/methods/channels/channels.info.json
61
61
  def channels_info(options = {})
62
62
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
63
63
  options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
@@ -72,7 +72,7 @@ module Slack
72
72
  # @option options [user] :user
73
73
  # User to invite to channel.
74
74
  # @see https://api.slack.com/methods/channels.invite
75
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/channels.invite.json
75
+ # @see https://github.com/dblock/slack-api-ref/blob/master/methods/channels/channels.invite.json
76
76
  def channels_invite(options = {})
77
77
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
78
78
  throw ArgumentError.new('Required arguments :user missing') if options[:user].nil?
@@ -88,7 +88,7 @@ module Slack
88
88
  # @option options [Object] :name
89
89
  # Name of channel to join.
90
90
  # @see https://api.slack.com/methods/channels.join
91
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/channels.join.json
91
+ # @see https://github.com/dblock/slack-api-ref/blob/master/methods/channels/channels.join.json
92
92
  def channels_join(options = {})
93
93
  throw ArgumentError.new('Required arguments :name missing') if options[:name].nil?
94
94
  post('channels.join', options)
@@ -102,7 +102,7 @@ module Slack
102
102
  # @option options [user] :user
103
103
  # User to remove from channel.
104
104
  # @see https://api.slack.com/methods/channels.kick
105
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/channels.kick.json
105
+ # @see https://github.com/dblock/slack-api-ref/blob/master/methods/channels/channels.kick.json
106
106
  def channels_kick(options = {})
107
107
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
108
108
  throw ArgumentError.new('Required arguments :user missing') if options[:user].nil?
@@ -117,7 +117,7 @@ module Slack
117
117
  # @option options [channel] :channel
118
118
  # Channel to leave.
119
119
  # @see https://api.slack.com/methods/channels.leave
120
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/channels.leave.json
120
+ # @see https://github.com/dblock/slack-api-ref/blob/master/methods/channels/channels.leave.json
121
121
  def channels_leave(options = {})
122
122
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
123
123
  options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
@@ -130,7 +130,7 @@ module Slack
130
130
  # @option options [Object] :exclude_archived
131
131
  # Don't return archived channels.
132
132
  # @see https://api.slack.com/methods/channels.list
133
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/channels.list.json
133
+ # @see https://github.com/dblock/slack-api-ref/blob/master/methods/channels/channels.list.json
134
134
  def channels_list(options = {})
135
135
  post('channels.list', options)
136
136
  end
@@ -143,7 +143,7 @@ module Slack
143
143
  # @option options [timestamp] :ts
144
144
  # Timestamp of the most recently seen message.
145
145
  # @see https://api.slack.com/methods/channels.mark
146
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/channels.mark.json
146
+ # @see https://github.com/dblock/slack-api-ref/blob/master/methods/channels/channels.mark.json
147
147
  def channels_mark(options = {})
148
148
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
149
149
  throw ArgumentError.new('Required arguments :ts missing') if options[:ts].nil?
@@ -159,7 +159,7 @@ module Slack
159
159
  # @option options [Object] :name
160
160
  # New name for channel.
161
161
  # @see https://api.slack.com/methods/channels.rename
162
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/channels.rename.json
162
+ # @see https://github.com/dblock/slack-api-ref/blob/master/methods/channels/channels.rename.json
163
163
  def channels_rename(options = {})
164
164
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
165
165
  throw ArgumentError.new('Required arguments :name missing') if options[:name].nil?
@@ -175,7 +175,7 @@ module Slack
175
175
  # @option options [Object] :purpose
176
176
  # The new purpose.
177
177
  # @see https://api.slack.com/methods/channels.setPurpose
178
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/channels.setPurpose.json
178
+ # @see https://github.com/dblock/slack-api-ref/blob/master/methods/channels/channels.setPurpose.json
179
179
  def channels_setPurpose(options = {})
180
180
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
181
181
  throw ArgumentError.new('Required arguments :purpose missing') if options[:purpose].nil?
@@ -191,7 +191,7 @@ module Slack
191
191
  # @option options [Object] :topic
192
192
  # The new topic.
193
193
  # @see https://api.slack.com/methods/channels.setTopic
194
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/channels.setTopic.json
194
+ # @see https://github.com/dblock/slack-api-ref/blob/master/methods/channels/channels.setTopic.json
195
195
  def channels_setTopic(options = {})
196
196
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
197
197
  throw ArgumentError.new('Required arguments :topic missing') if options[:topic].nil?
@@ -205,7 +205,7 @@ module Slack
205
205
  # @option options [channel] :channel
206
206
  # Channel to unarchive.
207
207
  # @see https://api.slack.com/methods/channels.unarchive
208
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/channels.unarchive.json
208
+ # @see https://github.com/dblock/slack-api-ref/blob/master/methods/channels/channels.unarchive.json
209
209
  def channels_unarchive(options = {})
210
210
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
211
211
  options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
@@ -13,7 +13,7 @@ module Slack
13
13
  # @option options [channel] :channel
14
14
  # Channel containing the message to be deleted.
15
15
  # @see https://api.slack.com/methods/chat.delete
16
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/chat.delete.json
16
+ # @see https://github.com/dblock/slack-api-ref/blob/master/methods/chat/chat.delete.json
17
17
  def chat_delete(options = {})
18
18
  throw ArgumentError.new('Required arguments :ts missing') if options[:ts].nil?
19
19
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
@@ -28,12 +28,8 @@ module Slack
28
28
  # Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name. See below for more details.
29
29
  # @option options [Object] :text
30
30
  # Text of the message to send. See below for an explanation of formatting.
31
- # @option options [Object] :username
32
- # Name of bot.
33
- # @option options [Object] :as_user
34
- # Pass true to post the message as the authed user, instead of as a bot.
35
31
  # @option options [Object] :parse
36
- # Change how messages are treated. See below.
32
+ # Change how messages are treated. Defaults to none. See below.
37
33
  # @option options [Object] :link_names
38
34
  # Find and link channel names and usernames.
39
35
  # @option options [Object] :attachments
@@ -42,12 +38,16 @@ module Slack
42
38
  # Pass true to enable unfurling of primarily text-based content.
43
39
  # @option options [Object] :unfurl_media
44
40
  # Pass false to disable unfurling of media content.
41
+ # @option options [Object] :username
42
+ # Set your bot's user name. Must be used in conjunction with as_user set to false, otherwise ignored. See authorship below.
43
+ # @option options [Object] :as_user
44
+ # Pass true to post the message as the authed user, instead of as a bot. Defaults to false. See authorship below.
45
45
  # @option options [Object] :icon_url
46
- # URL to an image to use as the icon for this message.
46
+ # 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.
47
47
  # @option options [Object] :icon_emoji
48
- # emoji to use as the icon for this message. Overrides icon_url.
48
+ # 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.
49
49
  # @see https://api.slack.com/methods/chat.postMessage
50
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/chat.postMessage.json
50
+ # @see https://github.com/dblock/slack-api-ref/blob/master/methods/chat/chat.postMessage.json
51
51
  def chat_postMessage(options = {})
52
52
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
53
53
  throw ArgumentError.new('Required arguments :text or :attachments missing') if options[:text].nil? && options[:attachments].nil?
@@ -61,7 +61,7 @@ module Slack
61
61
  end
62
62
 
63
63
  #
64
- # This method updates a message in a channel.
64
+ # This method updates a message in a channel. Though related to chat.postMessage, some parameters of chat.update are handled differently.
65
65
  #
66
66
  # @option options [timestamp] :ts
67
67
  # Timestamp of the message to be updated.
@@ -72,11 +72,13 @@ module Slack
72
72
  # @option options [Object] :attachments
73
73
  # Structured message attachments.
74
74
  # @option options [Object] :parse
75
- # Change how messages are treated. See below.
75
+ # Change how messages are treated. Defaults to client, unlike chat.postMessage. See below.
76
76
  # @option options [Object] :link_names
77
- # Find and link channel names and usernames.
77
+ # 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.
78
+ # @option options [Object] :as_user
79
+ # Pass true to update the message as the authed user. Bot users in this context are considered authed users.
78
80
  # @see https://api.slack.com/methods/chat.update
79
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/chat.update.json
81
+ # @see https://github.com/dblock/slack-api-ref/blob/master/methods/chat/chat.update.json
80
82
  def chat_update(options = {})
81
83
  throw ArgumentError.new('Required arguments :ts missing') if options[:ts].nil?
82
84
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
@@ -9,7 +9,7 @@ module Slack
9
9
  # Ends the user's currently scheduled Do Not Disturb session immediately.
10
10
  #
11
11
  # @see https://api.slack.com/methods/dnd.endDnd
12
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/dnd.endDnd.json
12
+ # @see https://github.com/dblock/slack-api-ref/blob/master/methods/dnd/dnd.endDnd.json
13
13
  def dnd_endDnd(options = {})
14
14
  post('dnd.endDnd', options)
15
15
  end
@@ -18,7 +18,7 @@ module Slack
18
18
  # Ends the current user's snooze mode immediately.
19
19
  #
20
20
  # @see https://api.slack.com/methods/dnd.endSnooze
21
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/dnd.endSnooze.json
21
+ # @see https://github.com/dblock/slack-api-ref/blob/master/methods/dnd/dnd.endSnooze.json
22
22
  def dnd_endSnooze(options = {})
23
23
  post('dnd.endSnooze', options)
24
24
  end
@@ -29,7 +29,7 @@ module Slack
29
29
  # @option options [user] :user
30
30
  # User to fetch status for (defaults to current user).
31
31
  # @see https://api.slack.com/methods/dnd.info
32
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/dnd.info.json
32
+ # @see https://github.com/dblock/slack-api-ref/blob/master/methods/dnd/dnd.info.json
33
33
  def dnd_info(options = {})
34
34
  options = options.merge(user: users_id(options)['user']['id']) if options[:user]
35
35
  post('dnd.info', options)
@@ -41,7 +41,7 @@ module Slack
41
41
  # @option options [Object] :num_minutes
42
42
  # Number of minutes, from now, to snooze until.
43
43
  # @see https://api.slack.com/methods/dnd.setSnooze
44
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/dnd.setSnooze.json
44
+ # @see https://github.com/dblock/slack-api-ref/blob/master/methods/dnd/dnd.setSnooze.json
45
45
  def dnd_setSnooze(options = {})
46
46
  throw ArgumentError.new('Required arguments :num_minutes missing') if options[:num_minutes].nil?
47
47
  post('dnd.setSnooze', options)
@@ -53,7 +53,7 @@ module Slack
53
53
  # @option options [Object] :users
54
54
  # Comma-separated list of users to fetch Do Not Disturb status for.
55
55
  # @see https://api.slack.com/methods/dnd.teamInfo
56
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/dnd.teamInfo.json
56
+ # @see https://github.com/dblock/slack-api-ref/blob/master/methods/dnd/dnd.teamInfo.json
57
57
  def dnd_teamInfo(options = {})
58
58
  post('dnd.teamInfo', options)
59
59
  end
@@ -9,7 +9,7 @@ module Slack
9
9
  # This method lists the custom emoji for a team.
10
10
  #
11
11
  # @see https://api.slack.com/methods/emoji.list
12
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/emoji.list.json
12
+ # @see https://github.com/dblock/slack-api-ref/blob/master/methods/emoji/emoji.list.json
13
13
  def emoji_list(options = {})
14
14
  post('emoji.list', options)
15
15
  end
@@ -15,7 +15,7 @@ module Slack
15
15
  # @option options [Object] :comment
16
16
  # Text of the comment to edit.
17
17
  # @see https://api.slack.com/methods/files.comments
18
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/files.comments.json
18
+ # @see https://github.com/dblock/slack-api-ref/blob/master/methods/files/files.comments.json
19
19
  def files_comments(options = {})
20
20
  throw ArgumentError.new('Required arguments :file missing') if options[:file].nil?
21
21
  throw ArgumentError.new('Required arguments :id missing') if options[:id].nil?
@@ -29,7 +29,7 @@ module Slack
29
29
  # @option options [file] :file
30
30
  # ID of file to delete.
31
31
  # @see https://api.slack.com/methods/files.delete
32
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/files.delete.json
32
+ # @see https://github.com/dblock/slack-api-ref/blob/master/methods/files/files.delete.json
33
33
  def files_delete(options = {})
34
34
  throw ArgumentError.new('Required arguments :file missing') if options[:file].nil?
35
35
  post('files.delete', options)
@@ -39,9 +39,9 @@ module Slack
39
39
  # This method returns information about a file in your team.
40
40
  #
41
41
  # @option options [file] :file
42
- # File to fetch info for.
42
+ # Specify a file by providing its ID.
43
43
  # @see https://api.slack.com/methods/files.info
44
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/files.info.json
44
+ # @see https://github.com/dblock/slack-api-ref/blob/master/methods/files/files.info.json
45
45
  def files_info(options = {})
46
46
  throw ArgumentError.new('Required arguments :file missing') if options[:file].nil?
47
47
  post('files.info', options)
@@ -73,13 +73,37 @@ module Slack
73
73
  # You can pass multiple values in the types argument, like types=posts,snippets.The default value is all, which does not filter the list.
74
74
  # .
75
75
  # @see https://api.slack.com/methods/files.list
76
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/files.list.json
76
+ # @see https://github.com/dblock/slack-api-ref/blob/master/methods/files/files.list.json
77
77
  def files_list(options = {})
78
78
  options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
79
79
  options = options.merge(user: users_id(options)['user']['id']) if options[:user]
80
80
  post('files.list', options)
81
81
  end
82
82
 
83
+ #
84
+ # This method disables public/external sharing for a file.
85
+ #
86
+ # @option options [file] :file
87
+ # File to revoke.
88
+ # @see https://api.slack.com/methods/files.revokePublicURL
89
+ # @see https://github.com/dblock/slack-api-ref/blob/master/methods/files/files.revokePublicURL.json
90
+ def files_revokePublicURL(options = {})
91
+ throw ArgumentError.new('Required arguments :file missing') if options[:file].nil?
92
+ post('files.revokePublicURL', options)
93
+ end
94
+
95
+ #
96
+ # This method enables public/external sharing for a file.
97
+ #
98
+ # @option options [file] :file
99
+ # File to share.
100
+ # @see https://api.slack.com/methods/files.sharedPublicURL
101
+ # @see https://github.com/dblock/slack-api-ref/blob/master/methods/files/files.sharedPublicURL.json
102
+ def files_sharedPublicURL(options = {})
103
+ throw ArgumentError.new('Required arguments :file missing') if options[:file].nil?
104
+ post('files.sharedPublicURL', options)
105
+ end
106
+
83
107
  #
84
108
  # This method allows you to create or upload an existing file.
85
109
  #
@@ -98,7 +122,7 @@ module Slack
98
122
  # @option options [Object] :channels
99
123
  # Comma-separated list of channel names or IDs where the file will be shared.
100
124
  # @see https://api.slack.com/methods/files.upload
101
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/files.upload.json
125
+ # @see https://github.com/dblock/slack-api-ref/blob/master/methods/files/files.upload.json
102
126
  def files_upload(options = {})
103
127
  throw ArgumentError.new('Required arguments :file missing') if options[:file].nil?
104
128
  throw ArgumentError.new('Required arguments :filename missing') if options[:filename].nil?
@@ -11,7 +11,7 @@ module Slack
11
11
  # @option options [group] :channel
12
12
  # Private channel to archive.
13
13
  # @see https://api.slack.com/methods/groups.archive
14
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/groups.archive.json
14
+ # @see https://github.com/dblock/slack-api-ref/blob/master/methods/groups/groups.archive.json
15
15
  def groups_archive(options = {})
16
16
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
17
17
  options = options.merge(channel: groups_id(options)['group']['id']) if options[:channel]
@@ -24,7 +24,7 @@ module Slack
24
24
  # @option options [group] :channel
25
25
  # Private channel to close.
26
26
  # @see https://api.slack.com/methods/groups.close
27
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/groups.close.json
27
+ # @see https://github.com/dblock/slack-api-ref/blob/master/methods/groups/groups.close.json
28
28
  def groups_close(options = {})
29
29
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
30
30
  options = options.merge(channel: groups_id(options)['group']['id']) if options[:channel]
@@ -37,7 +37,7 @@ module Slack
37
37
  # @option options [Object] :name
38
38
  # Name of private channel to create.
39
39
  # @see https://api.slack.com/methods/groups.create
40
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/groups.create.json
40
+ # @see https://github.com/dblock/slack-api-ref/blob/master/methods/groups/groups.create.json
41
41
  def groups_create(options = {})
42
42
  throw ArgumentError.new('Required arguments :name missing') if options[:name].nil?
43
43
  post('groups.create', options)
@@ -49,7 +49,7 @@ module Slack
49
49
  # @option options [group] :channel
50
50
  # Private channel to clone and archive.
51
51
  # @see https://api.slack.com/methods/groups.createChild
52
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/groups.createChild.json
52
+ # @see https://github.com/dblock/slack-api-ref/blob/master/methods/groups/groups.createChild.json
53
53
  def groups_createChild(options = {})
54
54
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
55
55
  options = options.merge(channel: groups_id(options)['group']['id']) if options[:channel]
@@ -72,7 +72,7 @@ module Slack
72
72
  # @option options [Object] :unreads
73
73
  # Include unread_count_display in the output?.
74
74
  # @see https://api.slack.com/methods/groups.history
75
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/groups.history.json
75
+ # @see https://github.com/dblock/slack-api-ref/blob/master/methods/groups/groups.history.json
76
76
  def groups_history(options = {})
77
77
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
78
78
  options = options.merge(channel: groups_id(options)['group']['id']) if options[:channel]
@@ -85,7 +85,7 @@ module Slack
85
85
  # @option options [group] :channel
86
86
  # Private channel to get info on.
87
87
  # @see https://api.slack.com/methods/groups.info
88
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/groups.info.json
88
+ # @see https://github.com/dblock/slack-api-ref/blob/master/methods/groups/groups.info.json
89
89
  def groups_info(options = {})
90
90
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
91
91
  options = options.merge(channel: groups_id(options)['group']['id']) if options[:channel]
@@ -100,7 +100,7 @@ module Slack
100
100
  # @option options [user] :user
101
101
  # User to invite.
102
102
  # @see https://api.slack.com/methods/groups.invite
103
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/groups.invite.json
103
+ # @see https://github.com/dblock/slack-api-ref/blob/master/methods/groups/groups.invite.json
104
104
  def groups_invite(options = {})
105
105
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
106
106
  throw ArgumentError.new('Required arguments :user missing') if options[:user].nil?
@@ -117,7 +117,7 @@ module Slack
117
117
  # @option options [user] :user
118
118
  # User to remove from private channel.
119
119
  # @see https://api.slack.com/methods/groups.kick
120
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/groups.kick.json
120
+ # @see https://github.com/dblock/slack-api-ref/blob/master/methods/groups/groups.kick.json
121
121
  def groups_kick(options = {})
122
122
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
123
123
  throw ArgumentError.new('Required arguments :user missing') if options[:user].nil?
@@ -132,7 +132,7 @@ module Slack
132
132
  # @option options [group] :channel
133
133
  # Private channel to leave.
134
134
  # @see https://api.slack.com/methods/groups.leave
135
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/groups.leave.json
135
+ # @see https://github.com/dblock/slack-api-ref/blob/master/methods/groups/groups.leave.json
136
136
  def groups_leave(options = {})
137
137
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
138
138
  options = options.merge(channel: groups_id(options)['group']['id']) if options[:channel]
@@ -146,7 +146,7 @@ module Slack
146
146
  # @option options [Object] :exclude_archived
147
147
  # Don't return archived private channels.
148
148
  # @see https://api.slack.com/methods/groups.list
149
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/groups.list.json
149
+ # @see https://github.com/dblock/slack-api-ref/blob/master/methods/groups/groups.list.json
150
150
  def groups_list(options = {})
151
151
  post('groups.list', options)
152
152
  end
@@ -159,7 +159,7 @@ module Slack
159
159
  # @option options [timestamp] :ts
160
160
  # Timestamp of the most recently seen message.
161
161
  # @see https://api.slack.com/methods/groups.mark
162
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/groups.mark.json
162
+ # @see https://github.com/dblock/slack-api-ref/blob/master/methods/groups/groups.mark.json
163
163
  def groups_mark(options = {})
164
164
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
165
165
  throw ArgumentError.new('Required arguments :ts missing') if options[:ts].nil?
@@ -173,7 +173,7 @@ module Slack
173
173
  # @option options [group] :channel
174
174
  # Private channel to open.
175
175
  # @see https://api.slack.com/methods/groups.open
176
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/groups.open.json
176
+ # @see https://github.com/dblock/slack-api-ref/blob/master/methods/groups/groups.open.json
177
177
  def groups_open(options = {})
178
178
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
179
179
  options = options.merge(channel: groups_id(options)['group']['id']) if options[:channel]
@@ -188,7 +188,7 @@ module Slack
188
188
  # @option options [Object] :name
189
189
  # New name for private channel.
190
190
  # @see https://api.slack.com/methods/groups.rename
191
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/groups.rename.json
191
+ # @see https://github.com/dblock/slack-api-ref/blob/master/methods/groups/groups.rename.json
192
192
  def groups_rename(options = {})
193
193
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
194
194
  throw ArgumentError.new('Required arguments :name missing') if options[:name].nil?
@@ -204,7 +204,7 @@ module Slack
204
204
  # @option options [Object] :purpose
205
205
  # The new purpose.
206
206
  # @see https://api.slack.com/methods/groups.setPurpose
207
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/groups.setPurpose.json
207
+ # @see https://github.com/dblock/slack-api-ref/blob/master/methods/groups/groups.setPurpose.json
208
208
  def groups_setPurpose(options = {})
209
209
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
210
210
  throw ArgumentError.new('Required arguments :purpose missing') if options[:purpose].nil?
@@ -220,7 +220,7 @@ module Slack
220
220
  # @option options [Object] :topic
221
221
  # The new topic.
222
222
  # @see https://api.slack.com/methods/groups.setTopic
223
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/groups.setTopic.json
223
+ # @see https://github.com/dblock/slack-api-ref/blob/master/methods/groups/groups.setTopic.json
224
224
  def groups_setTopic(options = {})
225
225
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
226
226
  throw ArgumentError.new('Required arguments :topic missing') if options[:topic].nil?
@@ -234,7 +234,7 @@ module Slack
234
234
  # @option options [group] :channel
235
235
  # Private channel to unarchive.
236
236
  # @see https://api.slack.com/methods/groups.unarchive
237
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/groups.unarchive.json
237
+ # @see https://github.com/dblock/slack-api-ref/blob/master/methods/groups/groups.unarchive.json
238
238
  def groups_unarchive(options = {})
239
239
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
240
240
  options = options.merge(channel: groups_id(options)['group']['id']) if options[:channel]