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
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ cache: bundler

matrix:
include:
- rvm: 2.3.0
- rvm: 2.3.1
script:
- bundle exec danger
- rvm: 2.3.0
- rvm: 2.3.1
env: CONCURRENCY=celluloid-io
- rvm: 2.3.0
- rvm: 2.3.1
env: CONCURRENCY=faye-websocket
- rvm: 2.2
- rvm: 2.1
Expand Down
8 changes: 6 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
### 0.7.8 (Next)

* [#127](https://github.com/slack-ruby/slack-ruby-client/pull/127): Added `thread_ts` and `reply_broadcast` options to `chat_postMessage` in Web API - [@dblock](https://github.com/dblock).
* [#127](https://github.com/slack-ruby/slack-ruby-client/pull/127): Added `channels_replies`, `groups_replies` and `im_replies` to Web API - [@dblock](https://github.com/dblock).
* [#127](https://github.com/slack-ruby/slack-ruby-client/pull/127): Added `goodbye` event to the RTM API - [@dblock](https://github.com/dblock).
* [#127](https://github.com/slack-ruby/slack-ruby-client/pull/127): Added `before` to `team_accessLogs` - [@dblock](https://github.com/dblock).
* [#108](https://github.com/slack-ruby/slack-ruby-client/pull/108): Use slack-ruby-danger gem - [@dblock](https://github.com/dblock).
* [#116](https://github.com/slack-ruby/slack-ruby-client/pull/116): Use [slack-ruby/slack-api-ref](https://github.com/slack-ruby/slack-api-ref) as machine API reference - [@dblock](https://github.com/dblock).
* [#116](https://github.com/slack-ruby/slack-ruby-client/pull/116): Added `users_setPhoto` and `users_deletePhoto` to Web API - [@dblock](https://github.com/dblock).
Expand Down Expand Up @@ -28,7 +32,7 @@

### 0.7.4 (5/28/2016)

* [#93](https://github.com/slack-ruby/slack-ruby-client/pull/93): Fix: When using Celluloid concurrency, handle input from the TCP socket asynchronously from reading more. - [@benzrf](https://github.com/benzrf).
* [#93](https://github.com/slack-ruby/slack-ruby-client/pull/93): Fix: When using Celluloid concurrency, handle input from the TCP socket asynchronously from reading more - [@benzrf](https://github.com/benzrf).
* Added `auth_revoke` and `users_identity` to Web API - [@dblock](https://github.com/dblock).
* Added `channel` parameter to `files_comments_add` Web API - [@dblock](https://github.com/dblock).

Expand Down Expand Up @@ -68,7 +72,7 @@

* [#45](https://github.com/slack-ruby/slack-ruby-client/issues/45): Added `channels_id`, `groups_id` and `users_id` - [@dblock](https://github.com/dblock).
* [#45](https://github.com/slack-ruby/slack-ruby-client/issues/45): Automatically lookup channel, group and user ID in Web API methods when Slack API doesn't accept #channel or @user names - [@dblock](https://github.com/dblock).
* [#49](https://github.com/slack-ruby/slack-ruby-client/pull/49): Fix: Celluloid `#connected?` method. - [@mikz](https://github.com/mikz), [@kandadaboggu](https://github.com/kandadaboggu).
* [#49](https://github.com/slack-ruby/slack-ruby-client/pull/49): Fix: Celluloid `#connected?` method - [@mikz](https://github.com/mikz), [@kandadaboggu](https://github.com/kandadaboggu).

### 0.5.3 (1/11/2016)

Expand Down
10 changes: 10 additions & 0 deletions bin/commands/channels.rb
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,16 @@
end
end

g.desc 'This method returns an entire thread (a message plus all the messages in reply to it).'
g.long_desc %( This method returns an entire thread (a message plus all the messages in reply to it). )
g.command 'replies' do |c|
c.flag 'channel', desc: 'Channel to fetch thread from.'
c.flag 'thread_ts', desc: "Unique identifier of a thread's parent message."
c.action do |_global_options, options, _args|
puts JSON.dump($client.channels_replies(options))
end
end

g.desc 'This method is used to change the purpose of a channel. The calling user must be a member of the channel.'
g.long_desc %( This method is used to change the purpose of a channel. The calling user must be a member of the channel. )
g.command 'setPurpose' do |c|
Expand Down
4 changes: 3 additions & 1 deletion bin/commands/chat.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@
c.flag 'username', desc: "Set your bot's user name. Must be used in conjunction with as_user set to false, otherwise ignored. See authorship below."
c.flag 'as_user', desc: 'Pass true to post the message as the authed user, instead of as a bot. Defaults to false. See authorship below.'
c.flag 'icon_url', desc: '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.'
c.flag 'icon_emoji', desc: '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.'
c.flag 'icon_emoji', desc: '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.'
c.flag 'thread_ts', desc: "Provide another message's ts value to make this message a reply. Avoid using a reply's ts value; use its parent instead."
c.flag 'reply_broadcast', desc: 'Used in conjunction with thread_ts and indicates whether reply should be made visible to everyone in the channel or conversation. Defaults to false.'
c.action do |_global_options, options, _args|
puts JSON.dump($client.chat_postMessage(options))
end
Expand Down
10 changes: 10 additions & 0 deletions bin/commands/groups.rb
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,16 @@
end
end

g.desc 'This method returns an entire thread (a message plus all the messages in reply to it).'
g.long_desc %( This method returns an entire thread (a message plus all the messages in reply to it). )
g.command 'replies' do |c|
c.flag 'channel', desc: 'Private channel to fetch thread from.'
c.flag 'thread_ts', desc: "Unique identifier of a thread's parent message."
c.action do |_global_options, options, _args|
puts JSON.dump($client.groups_replies(options))
end
end

g.desc 'This method is used to change the purpose of a private channel. The calling user must be a member of the private channel.'
g.long_desc %( This method is used to change the purpose of a private channel. The calling user must be a member of the private channel. )
g.command 'setPurpose' do |c|
Expand Down
10 changes: 10 additions & 0 deletions bin/commands/im.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,14 @@
puts JSON.dump($client.im_open(options))
end
end

g.desc 'This method returns an entire thread (a message plus all the messages in reply to it).'
g.long_desc %( This method returns an entire thread (a message plus all the messages in reply to it). )
g.command 'replies' do |c|
c.flag 'channel', desc: 'Direct message channel to fetch thread from.'
c.flag 'thread_ts', desc: "Unique identifier of a thread's parent message."
c.action do |_global_options, options, _args|
puts JSON.dump($client.im_replies(options))
end
end
end
10 changes: 10 additions & 0 deletions bin/commands/mpim.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,14 @@
puts JSON.dump($client.mpim_open(options))
end
end

g.desc 'This method returns an entire thread (a message plus all the messages in reply to it).'
g.long_desc %( This method returns an entire thread (a message plus all the messages in reply to it). )
g.command 'replies' do |c|
c.flag 'channel', desc: 'Multiparty direct message channel to fetch thread from.'
c.flag 'thread_ts', desc: "Unique identifier of a thread's parent message."
c.action do |_global_options, options, _args|
puts JSON.dump($client.mpim_replies(options))
end
end
end
1 change: 1 addition & 0 deletions bin/commands/team.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
g.desc 'This method is used to get the access logs for users on a team.'
g.long_desc %( This method is used to get the access logs for users on a team. )
g.command 'accessLogs' do |c|
c.flag 'before', desc: 'End of time range of logs to include in results (inclusive).'
c.action do |_global_options, options, _args|
puts JSON.dump($client.team_accessLogs(options))
end
Expand Down
5 changes: 5 additions & 0 deletions lib/slack/real_time/stores/starter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ def initialize(attrs)

### RealTime Events

# The server intends to close the connection soon..
# @see https://api.slack.com/events/goodbye
# @see https://github.com/dblock/slack-api-ref/blob/master/events/goodbye.json
# on :goodbye do |data|

# Verifies ownership of an Events API Request URL.
# @see https://api.slack.com/events/url_verification
# @see https://github.com/dblock/slack-api-ref/blob/master/events/url_verification.json
Expand Down
5 changes: 5 additions & 0 deletions lib/slack/real_time/stores/store.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ def initialize(attrs)

### RealTime Events

# The server intends to close the connection soon..
# @see https://api.slack.com/events/goodbye
# @see https://github.com/dblock/slack-api-ref/blob/master/events/goodbye.json
# on :goodbye do |data|

# Verifies ownership of an Events API Request URL.
# @see https://api.slack.com/events/url_verification
# @see https://github.com/dblock/slack-api-ref/blob/master/events/url_verification.json
Expand Down
16 changes: 16 additions & 0 deletions lib/slack/web/api/endpoints/channels.rb
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,22 @@ def channels_rename(options = {})
post('channels.rename', options)
end

#
# This method returns an entire thread (a message plus all the messages in reply to it).
#
# @option options [channel] :channel
# Channel to fetch thread from.
# @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
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?
options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
post('channels.replies', options)
end

#
# This method is used to change the purpose of a channel. The calling user must be a member of the channel.
#
Expand Down
6 changes: 5 additions & 1 deletion lib/slack/web/api/endpoints/chat.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,11 @@ def chat_meMessage(options = {})
# @option options [Object] :icon_url
# 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.
# @option options [Object] :icon_emoji
# 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.
# 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.
# @option options [Object] :thread_ts
# Provide another message's ts value to make this message a reply. Avoid using a reply's ts value; use its parent instead.
# @option options [Object] :reply_broadcast
# Used in conjunction with thread_ts and indicates whether reply should be made visible to everyone in the channel or conversation. Defaults to false.
# @see https://api.slack.com/methods/chat.postMessage
# @see https://github.com/dblock/slack-api-ref/blob/master/methods/chat/chat.postMessage.json
def chat_postMessage(options = {})
Expand Down
16 changes: 16 additions & 0 deletions lib/slack/web/api/endpoints/groups.rb
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,22 @@ def groups_rename(options = {})
post('groups.rename', options)
end

#
# This method returns an entire thread (a message plus all the messages in reply to it).
#
# @option options [group] :channel
# Private channel to fetch thread from.
# @option options [Object] :thread_ts
# Unique identifier of a thread's parent message.
# @see https://api.slack.com/methods/groups.replies
# @see https://github.com/dblock/slack-api-ref/blob/master/methods/groups/groups.replies.json
def groups_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?
options = options.merge(channel: groups_id(options)['group']['id']) if options[:channel]
post('groups.replies', options)
end

#
# This method is used to change the purpose of a private channel. The calling user must be a member of the private channel.
#
Expand Down
16 changes: 16 additions & 0 deletions lib/slack/web/api/endpoints/im.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,22 @@ def im_open(options = {})
options = options.merge(user: users_id(options)['user']['id']) if options[:user]
post('im.open', options)
end

#
# This method returns an entire thread (a message plus all the messages in reply to it).
#
# @option options [im] :channel
# Direct message channel to fetch thread from.
# @option options [Object] :thread_ts
# Unique identifier of a thread's parent message.
# @see https://api.slack.com/methods/im.replies
# @see https://github.com/dblock/slack-api-ref/blob/master/methods/im/im.replies.json
def im_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?
options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
post('im.replies', options)
end
end
end
end
Expand Down
16 changes: 16 additions & 0 deletions lib/slack/web/api/endpoints/mpim.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,22 @@ def mpim_open(options = {})
throw ArgumentError.new('Required arguments :users missing') if options[:users].nil?
post('mpim.open', options)
end

#
# This method returns an entire thread (a message plus all the messages in reply to it).
#
# @option options [channel] :channel
# Multiparty direct message channel to fetch thread from.
# @option options [Object] :thread_ts
# Unique identifier of a thread's parent message.
# @see https://api.slack.com/methods/mpim.replies
# @see https://github.com/dblock/slack-api-ref/blob/master/methods/mpim/mpim.replies.json
def mpim_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?
options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
post('mpim.replies', options)
end
end
end
end
Expand Down
2 changes: 2 additions & 0 deletions lib/slack/web/api/endpoints/team.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ module Team
#
# This method is used to get the access logs for users on a team.
#
# @option options [Object] :before
# End of time range of logs to include in results (inclusive).
# @see https://api.slack.com/methods/team.accessLogs
# @see https://github.com/dblock/slack-api-ref/blob/master/methods/team/team.accessLogs.json
def team_accessLogs(options = {})
Expand Down
2 changes: 1 addition & 1 deletion lib/slack/web/api/slack-api-ref
Submodule slack-api-ref updated 87 files
+9 −0 events/accounts_changed.json
+17 −0 events/bot_added.json
+17 −0 events/bot_changed.json
+1 −1 events/channel_archive.json
+1 −1 events/channel_created.json
+1 −1 events/channel_deleted.json
+1 −1 events/channel_history_changed.json
+2 −2 events/channel_joined.json
+10 −0 events/channel_left.json
+11 −0 events/channel_marked.json
+1 −1 events/channel_rename.json
+1 −1 events/channel_unarchive.json
+10 −0 events/commands_changed.json
+1 −1 events/dnd_updated.json
+1 −1 events/dnd_updated_user.json
+1 −1 events/email_domain_changed.json
+1 −1 events/emoji_changed.json
+1 −1 events/file_change.json
+1 −1 events/file_comment_added.json
+1 −1 events/file_comment_deleted.json
+1 −1 events/file_comment_edited.json
+1 −1 events/file_created.json
+1 −1 events/file_deleted.json
+1 −1 events/file_public.json
+1 −1 events/file_shared.json
+1 −1 events/file_unshared.json
+9 −0 events/goodbye.json
+1 −1 events/group_archive.json
+1 −1 events/group_close.json
+1 −1 events/group_history_changed.json
+10 −0 events/group_joined.json
+10 −0 events/group_left.json
+11 −0 events/group_marked.json
+1 −1 events/group_open.json
+1 −1 events/group_rename.json
+1 −1 events/group_unarchive.json
+9 −0 events/hello.json
+1 −1 events/im_close.json
+1 −1 events/im_created.json
+1 −1 events/im_history_changed.json
+11 −0 events/im_marked.json
+1 −1 events/im_open.json
+10 −0 events/manual_presence_change.json
+0 −13 events/message.channels.json
+0 −13 events/message.groups.json
+0 −13 events/message.im.json
+6 −0 events/message.json
+0 −13 events/message.mpim.json
+1 −1 events/pin_added.json
+1 −1 events/pin_removed.json
+11 −0 events/pref_change.json
+11 −0 events/presence_change.json
+1 −1 events/reaction_added.json
+1 −1 events/reaction_removed.json
+9 −0 events/reconnect_url.json
+2 −2 events/star_added.json
+1 −1 events/star_removed.json
+1 −1 events/subteam_created.json
+1 −1 events/subteam_self_added.json
+1 −1 events/subteam_self_removed.json
+1 −1 events/subteam_updated.json
+1 −1 events/team_domain_change.json
+1 −1 events/team_join.json
+9 −0 events/team_migration_started.json
+10 −0 events/team_plan_change.json
+11 −0 events/team_pref_change.json
+16 −0 events/team_profile_change.json
+14 −0 events/team_profile_delete.json
+17 −0 events/team_profile_reorder.json
+1 −1 events/team_rename.json
+0 −6 events/url_verification.json
+1 −1 events/user_change.json
+11 −0 events/user_typing.json
+0 −1 methods/channels/channels.invite.json
+1 −1 methods/channels/channels.join.json
+33 −0 methods/channels/channels.replies.json
+11 −1 methods/chat/chat.postMessage.json
+1 −1 methods/groups/groups.info.json
+1 −1 methods/groups/groups.rename.json
+33 −0 methods/groups/groups.replies.json
+1 −1 methods/groups/groups.setPurpose.json
+1 −1 methods/groups/groups.setTopic.json
+33 −0 methods/im/im.replies.json
+33 −0 methods/mpim/mpim.replies.json
+5 −0 methods/team/team.accessLogs.json
+1 −0 methods/users/users.profile.set.json
+3 −2 tasks/lib/slack_api/events_spider.rb
8 changes: 8 additions & 0 deletions spec/slack/web/api/endpoints/im_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,12 @@
expect { client.im_open }.to raise_error ArgumentError, /Required arguments :user missing/
end
end
context 'im_replies' do
it 'requires channel' do
expect { client.im_replies(thread_ts: '1234567890.123456') }.to raise_error ArgumentError, /Required arguments :channel missing/
end
it 'requires thread_ts' do
expect { client.im_replies(channel: 'C1234567890') }.to raise_error ArgumentError, /Required arguments :thread_ts missing/
end
end
end
8 changes: 8 additions & 0 deletions spec/slack/web/api/endpoints/mpim_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,12 @@
expect { client.mpim_open }.to raise_error ArgumentError, /Required arguments :users missing/
end
end
context 'mpim_replies' do
it 'requires channel' do
expect { client.mpim_replies(thread_ts: '1234567890.123456') }.to raise_error ArgumentError, /Required arguments :channel missing/
end
it 'requires thread_ts' do
expect { client.mpim_replies(channel: 'C1234567890') }.to raise_error ArgumentError, /Required arguments :thread_ts missing/
end
end
end