Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
### 0.10.1 (next)

* Your contribution here.
* [#177](https://github.com/slack-ruby/slack-ruby-client/pull/177): Fix api ref repo - [@manuelmeurer](https://github.com/manuelmeurer).
* [#176](https://github.com/slack-ruby/slack-ruby-client/issues/176): Drop dependency on json gem - [@seuros](https://github.com/seuros).
* [#173](https://github.com/slack-ruby/slack-ruby-client/issues/173): Updated to latest slack-api-ref => we have Dialogs!; Added dialog.1.open-json-support patch to apply the JSON fix to :dialog param - [@alexagranov](https://github.com/alexagranov).

Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Make sure that `bundle exec rake` completes without errors.

### Update Slack Web API

Slack Web API is updated from https://github.com/dblock/slack-api-ref, a maintained, machine-readable version of Slack API Docs, generated by scraping [api.slack.com](https://api.slack.com). To update the Web API from the latest definition run the following Rake task.
Slack Web API is updated from https://github.com/slack-ruby/slack-api-ref, a maintained, machine-readable version of Slack API Docs, generated by scraping [api.slack.com](https://api.slack.com). To update the Web API from the latest definition run the following Rake task.

```
rake slack:api:update
Expand Down
2 changes: 1 addition & 1 deletion lib/slack/real_time/api/templates/event_handler.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# <%= desc %>
# @see https://api.slack.com/events/<%= name %>
# @see https://github.com/dblock/slack-api-ref/blob/master/events/<%= name %>.json
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/<%= name %>.json
# on :<%= name %> do |data|
152 changes: 76 additions & 76 deletions lib/slack/real_time/stores/starter.rb

Large diffs are not rendered by default.

156 changes: 78 additions & 78 deletions lib/slack/real_time/stores/store.rb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/slack/web/api/endpoints/api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module Api
# @option options [Object] :foo
# example property to return.
# @see https://api.slack.com/methods/api.test
# @see https://github.com/dblock/slack-api-ref/blob/master/methods/api/api.test.json
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/api/api.test.json
def api_test(options = {})
post('api.test', options)
end
Expand Down
4 changes: 2 additions & 2 deletions lib/slack/web/api/endpoints/apps_permissions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module AppsPermissions
# Returns list of permissions this app has on a team.
#
# @see https://api.slack.com/methods/apps.permissions.info
# @see https://github.com/dblock/slack-api-ref/blob/master/methods/apps.permissions/apps.permissions.info.json
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/apps.permissions/apps.permissions.info.json
def apps_permissions_info(options = {})
post('apps.permissions.info', options)
end
Expand All @@ -22,7 +22,7 @@ def apps_permissions_info(options = {})
# @option options [Object] :trigger_id
# Token used to trigger the permissions API.
# @see https://api.slack.com/methods/apps.permissions.request
# @see https://github.com/dblock/slack-api-ref/blob/master/methods/apps.permissions/apps.permissions.request.json
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/apps.permissions/apps.permissions.request.json
def apps_permissions_request(options = {})
throw ArgumentError.new('Required arguments :scopes missing') if options[:scopes].nil?
throw ArgumentError.new('Required arguments :trigger_id missing') if options[:trigger_id].nil?
Expand Down
4 changes: 2 additions & 2 deletions lib/slack/web/api/endpoints/auth.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module Auth
# @option options [Object] :test
# Setting this parameter to 1 triggers a testing mode where the specified token will not actually be revoked.
# @see https://api.slack.com/methods/auth.revoke
# @see https://github.com/dblock/slack-api-ref/blob/master/methods/auth/auth.revoke.json
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/auth/auth.revoke.json
def auth_revoke(options = {})
post('auth.revoke', options)
end
Expand All @@ -20,7 +20,7 @@ def auth_revoke(options = {})
# Checks authentication & identity.
#
# @see https://api.slack.com/methods/auth.test
# @see https://github.com/dblock/slack-api-ref/blob/master/methods/auth/auth.test.json
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/auth/auth.test.json
def auth_test(options = {})
post('auth.test', options)
end
Expand Down
2 changes: 1 addition & 1 deletion lib/slack/web/api/endpoints/bots.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module Bots
# @option options [Object] :bot
# Bot user to get info on.
# @see https://api.slack.com/methods/bots.info
# @see https://github.com/dblock/slack-api-ref/blob/master/methods/bots/bots.info.json
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/bots/bots.info.json
def bots_info(options = {})
post('bots.info', options)
end
Expand Down
30 changes: 15 additions & 15 deletions lib/slack/web/api/endpoints/channels.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module Channels
# @option options [channel] :channel
# Channel to archive.
# @see https://api.slack.com/methods/channels.archive
# @see https://github.com/dblock/slack-api-ref/blob/master/methods/channels/channels.archive.json
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/channels/channels.archive.json
def channels_archive(options = {})
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
Expand All @@ -26,7 +26,7 @@ def channels_archive(options = {})
# @option options [Object] :validate
# Whether to return errors on invalid channel name instead of modifying it to meet the specified criteria.
# @see https://api.slack.com/methods/channels.create
# @see https://github.com/dblock/slack-api-ref/blob/master/methods/channels/channels.create.json
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/channels/channels.create.json
def channels_create(options = {})
throw ArgumentError.new('Required arguments :name missing') if options[:name].nil?
post('channels.create', options)
Expand All @@ -46,7 +46,7 @@ def channels_create(options = {})
# @option options [Object] :unreads
# Include unread_count_display in the output?.
# @see https://api.slack.com/methods/channels.history
# @see https://github.com/dblock/slack-api-ref/blob/master/methods/channels/channels.history.json
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/channels/channels.history.json
def channels_history(options = {})
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
Expand All @@ -61,7 +61,7 @@ def channels_history(options = {})
# @option options [Object] :include_locale
# Set this to true to receive the locale for this channel. Defaults to false.
# @see https://api.slack.com/methods/channels.info
# @see https://github.com/dblock/slack-api-ref/blob/master/methods/channels/channels.info.json
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/channels/channels.info.json
def channels_info(options = {})
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
Expand All @@ -76,7 +76,7 @@ def channels_info(options = {})
# @option options [user] :user
# User to invite to channel.
# @see https://api.slack.com/methods/channels.invite
# @see https://github.com/dblock/slack-api-ref/blob/master/methods/channels/channels.invite.json
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/channels/channels.invite.json
def channels_invite(options = {})
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
throw ArgumentError.new('Required arguments :user missing') if options[:user].nil?
Expand All @@ -93,7 +93,7 @@ def channels_invite(options = {})
# @option options [Object] :validate
# Whether to return errors on invalid channel name instead of modifying it to meet the specified criteria.
# @see https://api.slack.com/methods/channels.join
# @see https://github.com/dblock/slack-api-ref/blob/master/methods/channels/channels.join.json
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/channels/channels.join.json
def channels_join(options = {})
throw ArgumentError.new('Required arguments :name missing') if options[:name].nil?
post('channels.join', options)
Expand All @@ -107,7 +107,7 @@ def channels_join(options = {})
# @option options [user] :user
# User to remove from channel.
# @see https://api.slack.com/methods/channels.kick
# @see https://github.com/dblock/slack-api-ref/blob/master/methods/channels/channels.kick.json
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/channels/channels.kick.json
def channels_kick(options = {})
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
throw ArgumentError.new('Required arguments :user missing') if options[:user].nil?
Expand All @@ -122,7 +122,7 @@ def channels_kick(options = {})
# @option options [channel] :channel
# Channel to leave.
# @see https://api.slack.com/methods/channels.leave
# @see https://github.com/dblock/slack-api-ref/blob/master/methods/channels/channels.leave.json
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/channels/channels.leave.json
def channels_leave(options = {})
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
Expand All @@ -141,7 +141,7 @@ def channels_leave(options = {})
# @option options [Object] :limit
# 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.
# @see https://api.slack.com/methods/channels.list
# @see https://github.com/dblock/slack-api-ref/blob/master/methods/channels/channels.list.json
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/channels/channels.list.json
def channels_list(options = {})
if block_given?
Pagination::Cursor.new(self, :channels_list, options).each do |page|
Expand All @@ -160,7 +160,7 @@ def channels_list(options = {})
# @option options [timestamp] :ts
# Timestamp of the most recently seen message.
# @see https://api.slack.com/methods/channels.mark
# @see https://github.com/dblock/slack-api-ref/blob/master/methods/channels/channels.mark.json
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/channels/channels.mark.json
def channels_mark(options = {})
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
throw ArgumentError.new('Required arguments :ts missing') if options[:ts].nil?
Expand All @@ -178,7 +178,7 @@ def channels_mark(options = {})
# @option options [Object] :validate
# Whether to return errors on invalid channel name instead of modifying it to meet the specified criteria.
# @see https://api.slack.com/methods/channels.rename
# @see https://github.com/dblock/slack-api-ref/blob/master/methods/channels/channels.rename.json
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/channels/channels.rename.json
def channels_rename(options = {})
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
throw ArgumentError.new('Required arguments :name missing') if options[:name].nil?
Expand All @@ -194,7 +194,7 @@ def channels_rename(options = {})
# @option options [Object] :thread_ts
# Unique identifier of a thread's parent message.
# @see https://api.slack.com/methods/channels.replies
# @see https://github.com/dblock/slack-api-ref/blob/master/methods/channels/channels.replies.json
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/channels/channels.replies.json
def channels_replies(options = {})
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
throw ArgumentError.new('Required arguments :thread_ts missing') if options[:thread_ts].nil?
Expand All @@ -210,7 +210,7 @@ def channels_replies(options = {})
# @option options [Object] :purpose
# The new purpose.
# @see https://api.slack.com/methods/channels.setPurpose
# @see https://github.com/dblock/slack-api-ref/blob/master/methods/channels/channels.setPurpose.json
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/channels/channels.setPurpose.json
def channels_setPurpose(options = {})
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
throw ArgumentError.new('Required arguments :purpose missing') if options[:purpose].nil?
Expand All @@ -226,7 +226,7 @@ def channels_setPurpose(options = {})
# @option options [Object] :topic
# The new topic.
# @see https://api.slack.com/methods/channels.setTopic
# @see https://github.com/dblock/slack-api-ref/blob/master/methods/channels/channels.setTopic.json
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/channels/channels.setTopic.json
def channels_setTopic(options = {})
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
throw ArgumentError.new('Required arguments :topic missing') if options[:topic].nil?
Expand All @@ -240,7 +240,7 @@ def channels_setTopic(options = {})
# @option options [channel] :channel
# Channel to unarchive.
# @see https://api.slack.com/methods/channels.unarchive
# @see https://github.com/dblock/slack-api-ref/blob/master/methods/channels/channels.unarchive.json
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/channels/channels.unarchive.json
def channels_unarchive(options = {})
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
Expand Down
12 changes: 6 additions & 6 deletions lib/slack/web/api/endpoints/chat.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module Chat
# @option options [Object] :as_user
# Pass true to delete the message as the authed user. Bot users in this context are considered authed users.
# @see https://api.slack.com/methods/chat.delete
# @see https://github.com/dblock/slack-api-ref/blob/master/methods/chat/chat.delete.json
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/chat/chat.delete.json
def chat_delete(options = {})
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
throw ArgumentError.new('Required arguments :ts missing') if options[:ts].nil?
Expand All @@ -31,7 +31,7 @@ def chat_delete(options = {})
# @option options [Object] :text
# Text of the message to send.
# @see https://api.slack.com/methods/chat.meMessage
# @see https://github.com/dblock/slack-api-ref/blob/master/methods/chat/chat.meMessage.json
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/chat/chat.meMessage.json
def chat_meMessage(options = {})
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
throw ArgumentError.new('Required arguments :text missing') if options[:text].nil?
Expand All @@ -56,7 +56,7 @@ def chat_meMessage(options = {})
# @option options [Object] :parse
# Change how messages are treated. Defaults to none. See below.
# @see https://api.slack.com/methods/chat.postEphemeral
# @see https://github.com/dblock/slack-api-ref/blob/master/methods/chat/chat.postEphemeral.json
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/chat/chat.postEphemeral.json
def chat_postEphemeral(options = {})
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
throw ArgumentError.new('Required arguments :text missing') if options[:text].nil?
Expand Down Expand Up @@ -101,7 +101,7 @@ def chat_postEphemeral(options = {})
# @option options [Object] :username
# Set your bot's user name. Must be used in conjunction with as_user set to false, otherwise ignored. See authorship below.
# @see https://api.slack.com/methods/chat.postMessage
# @see https://github.com/dblock/slack-api-ref/blob/master/methods/chat/chat.postMessage.json
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/chat/chat.postMessage.json
def chat_postMessage(options = {})
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
throw ArgumentError.new('Required arguments :text or :attachments missing') if options[:text].nil? && options[:attachments].nil?
Expand Down Expand Up @@ -130,7 +130,7 @@ def chat_postMessage(options = {})
# @option options [Object] :user_auth_url
# Send users to this custom URL where they will complete authentication in your app to fully trigger unfurling. Value should be properly URL-encoded.
# @see https://api.slack.com/methods/chat.unfurl
# @see https://github.com/dblock/slack-api-ref/blob/master/methods/chat/chat.unfurl.json
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/chat/chat.unfurl.json
def chat_unfurl(options = {})
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
throw ArgumentError.new('Required arguments :ts missing') if options[:ts].nil?
Expand All @@ -157,7 +157,7 @@ def chat_unfurl(options = {})
# @option options [Object] :parse
# Change how messages are treated. Defaults to client, unlike chat.postMessage. See below.
# @see https://api.slack.com/methods/chat.update
# @see https://github.com/dblock/slack-api-ref/blob/master/methods/chat/chat.update.json
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/chat/chat.update.json
def chat_update(options = {})
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
throw ArgumentError.new('Required arguments :text or :attachments missing') if options[:text].nil? && options[:attachments].nil?
Expand Down
Loading