slack-ruby-client 0.9.0 → 0.9.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -8
- data/CHANGELOG.md +4 -0
- data/README.md +1 -1
- data/bin/commands.rb +1 -0
- data/bin/commands/api.rb +2 -2
- data/bin/commands/apps_permissions.rb +22 -0
- data/bin/commands/auth.rb +4 -4
- data/bin/commands/bots.rb +2 -2
- data/bin/commands/channels.rb +31 -31
- data/bin/commands/chat.rb +40 -23
- data/bin/commands/dnd.rb +8 -8
- data/bin/commands/emoji.rb +2 -2
- data/bin/commands/files.rb +17 -17
- data/bin/commands/files_comments.rb +6 -6
- data/bin/commands/groups.rb +36 -35
- data/bin/commands/im.rb +13 -13
- data/bin/commands/mpim.rb +11 -11
- data/bin/commands/oauth.rb +15 -2
- data/bin/commands/pins.rb +6 -6
- data/bin/commands/reactions.rb +13 -13
- data/bin/commands/reminders.rb +10 -10
- data/bin/commands/rtm.rb +10 -6
- data/bin/commands/search.rb +9 -9
- data/bin/commands/stars.rb +8 -8
- data/bin/commands/team.rb +10 -10
- data/bin/commands/team_profile.rb +2 -2
- data/bin/commands/usergroups.rb +16 -16
- data/bin/commands/usergroups_users.rb +4 -4
- data/bin/commands/users.rb +20 -18
- data/bin/commands/users_profile.rb +7 -7
- data/lib/slack/real_time/stores/starter.rb +20 -0
- data/lib/slack/real_time/stores/store.rb +20 -0
- data/lib/slack/version.rb +1 -1
- data/lib/slack/web/api/endpoints.rb +2 -0
- data/lib/slack/web/api/endpoints/api.rb +1 -1
- data/lib/slack/web/api/endpoints/apps_permissions.rb +35 -0
- data/lib/slack/web/api/endpoints/auth.rb +2 -2
- data/lib/slack/web/api/endpoints/bots.rb +1 -1
- data/lib/slack/web/api/endpoints/channels.rb +17 -18
- data/lib/slack/web/api/endpoints/chat.rb +67 -30
- data/lib/slack/web/api/endpoints/dnd.rb +4 -4
- data/lib/slack/web/api/endpoints/emoji.rb +1 -1
- data/lib/slack/web/api/endpoints/files.rb +16 -17
- data/lib/slack/web/api/endpoints/files_comments.rb +8 -8
- data/lib/slack/web/api/endpoints/groups.rb +21 -22
- data/lib/slack/web/api/endpoints/im.rb +8 -10
- data/lib/slack/web/api/endpoints/mpim.rb +7 -9
- data/lib/slack/web/api/endpoints/oauth.rb +23 -2
- data/lib/slack/web/api/endpoints/pins.rb +3 -5
- data/lib/slack/web/api/endpoints/reactions.rb +14 -16
- data/lib/slack/web/api/endpoints/reminders.rb +5 -5
- data/lib/slack/web/api/endpoints/rtm.rb +14 -6
- data/lib/slack/web/api/endpoints/search.rb +9 -9
- data/lib/slack/web/api/endpoints/stars.rb +7 -9
- data/lib/slack/web/api/endpoints/team.rb +8 -9
- data/lib/slack/web/api/endpoints/team_profile.rb +1 -1
- data/lib/slack/web/api/endpoints/usergroups.rb +17 -17
- data/lib/slack/web/api/endpoints/usergroups_users.rb +2 -2
- data/lib/slack/web/api/endpoints/users.rb +15 -15
- data/lib/slack/web/api/endpoints/users_profile.rb +8 -8
- data/lib/slack/web/api/patches/chat.3.update-attachments-support.patch +4 -3
- data/lib/slack/web/api/patches/chat.4.postEphemeral-attachments-support.patch +17 -0
- data/spec/integration/integration_spec.rb +1 -1
- data/spec/slack/web/api/endpoints/apps_permissions_spec.rb +15 -0
- data/spec/slack/web/api/endpoints/custom_specs/chat_spec.rb +37 -1
- data/spec/slack/web/api/endpoints/files_comments_spec.rb +8 -8
- data/spec/slack/web/api/endpoints/files_spec.rb +0 -5
- data/spec/slack/web/api/endpoints/oauth_spec.rb +11 -0
- metadata +7 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fcd1ef609f08b50f10e18a4c6fead723a0479638
|
4
|
+
data.tar.gz: 3740c747309c53870894ff627b5101149881e379
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ff1a0e156c5cd597c7a785dd5c740bea559fb86f83c5955e218a37e4fd827dc7335456f907fbc30ea3d89654c0a4ea154acc3afb3328a014de4a7a9a7877faf5
|
7
|
+
data.tar.gz: 9b62c200399f30be7df84c19da02d52a29585713b7ce0e7cc9ed3b0d97ccc9a19e4f51add07605b7a713988f482ce5f6ed15e27c6b50112718c97e9dfee62778
|
data/.travis.yml
CHANGED
@@ -6,8 +6,7 @@ rvm:
|
|
6
6
|
- 2.2
|
7
7
|
- 2.1
|
8
8
|
- 2.0
|
9
|
-
-
|
10
|
-
- jruby-19mode
|
9
|
+
- 2.3.4
|
11
10
|
- ruby-head
|
12
11
|
- jruby-head
|
13
12
|
|
@@ -20,15 +19,9 @@ matrix:
|
|
20
19
|
env: CONCURRENCY=celluloid-io
|
21
20
|
- rvm: 2.4.1
|
22
21
|
env: CONCURRENCY=faye-websocket
|
23
|
-
- rvm: 2.3.4
|
24
|
-
env: CONCURRENCY=celluloid-io
|
25
|
-
- rvm: 2.3.4
|
26
|
-
env: CONCURRENCY=faye-websocket
|
27
22
|
allow_failures:
|
28
23
|
- rvm: ruby-head
|
29
24
|
- rvm: jruby-head
|
30
|
-
- rvm: jruby-19mode
|
31
|
-
- rvm: rbx-2
|
32
25
|
|
33
26
|
git:
|
34
27
|
submodules: false
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
### 0.9.1 (8/24/2017)
|
2
|
+
|
3
|
+
* [#158](https://github.com/slack-ruby/slack-ruby-client/issues/158): Updated to latest slack-api-ref; Updated chat.3.update patch to reflect argument reordering; Added chat.4.postEphemeral patch to apply the attachments JSON fix (whitespace last line of diff matters! ;-) - [@alexagranov](https://github.com/alexagranov).
|
4
|
+
|
1
5
|
### 0.9.0 (8/6/2017)
|
2
6
|
|
3
7
|
* [#146](https://github.com/slack-ruby/slack-ruby-client/issues/146): Fix: `undefined method running?` and `ThreadError: Target thread must not be current thread` with `Celluloid::IO` - [@dblock](https://github.com/dblock).
|
data/README.md
CHANGED
@@ -18,7 +18,7 @@ A Ruby client for the Slack [Web](https://api.slack.com/web) and [RealTime Messa
|
|
18
18
|
|
19
19
|
## Stable Release
|
20
20
|
|
21
|
-
You're reading the documentation for the **stable** release of slack-ruby-client
|
21
|
+
You're reading the documentation for the **stable** release of slack-ruby-client. See [UPGRADING](UPGRADING.md) when upgrading from an older version.
|
22
22
|
|
23
23
|
## Installation
|
24
24
|
|
data/bin/commands.rb
CHANGED
data/bin/commands/api.rb
CHANGED
@@ -2,8 +2,8 @@
|
|
2
2
|
|
3
3
|
desc 'Api methods.'
|
4
4
|
command 'api' do |g|
|
5
|
-
g.desc '
|
6
|
-
g.long_desc %(
|
5
|
+
g.desc 'Checks API calling code.'
|
6
|
+
g.long_desc %( Checks API calling code. )
|
7
7
|
g.command 'test' do |c|
|
8
8
|
c.flag 'error', desc: 'Error response to return.'
|
9
9
|
c.flag 'foo', desc: 'example property to return.'
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# This file was auto-generated by lib/tasks/web.rake
|
2
|
+
|
3
|
+
desc 'AppsPermissions methods.'
|
4
|
+
command 'apps_permissions' do |g|
|
5
|
+
g.desc 'Returns list of permissions this app has on a team.'
|
6
|
+
g.long_desc %( Returns list of permissions this app has on a team. )
|
7
|
+
g.command 'info' do |c|
|
8
|
+
c.action do |_global_options, options, _args|
|
9
|
+
puts JSON.dump($client.apps_permissions_info(options))
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
g.desc 'Allows an app to request additional scopes'
|
14
|
+
g.long_desc %( Allows an app to request additional scopes )
|
15
|
+
g.command 'request' do |c|
|
16
|
+
c.flag 'scopes', desc: 'A comma separated list of scopes to request for.'
|
17
|
+
c.flag 'trigger_id', desc: 'Token used to trigger the permissions API.'
|
18
|
+
c.action do |_global_options, options, _args|
|
19
|
+
puts JSON.dump($client.apps_permissions_request(options))
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
data/bin/commands/auth.rb
CHANGED
@@ -2,8 +2,8 @@
|
|
2
2
|
|
3
3
|
desc 'Auth methods.'
|
4
4
|
command 'auth' do |g|
|
5
|
-
g.desc '
|
6
|
-
g.long_desc %(
|
5
|
+
g.desc 'Revokes a token.'
|
6
|
+
g.long_desc %( Revokes a token. )
|
7
7
|
g.command 'revoke' do |c|
|
8
8
|
c.flag 'test', desc: 'Setting this parameter to 1 triggers a testing mode where the specified token will not actually be revoked.'
|
9
9
|
c.action do |_global_options, options, _args|
|
@@ -11,8 +11,8 @@ command 'auth' do |g|
|
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
14
|
-
g.desc '
|
15
|
-
g.long_desc %(
|
14
|
+
g.desc 'Checks authentication & identity.'
|
15
|
+
g.long_desc %( Checks authentication & identity. )
|
16
16
|
g.command 'test' do |c|
|
17
17
|
c.action do |_global_options, options, _args|
|
18
18
|
puts JSON.dump($client.auth_test(options))
|
data/bin/commands/bots.rb
CHANGED
@@ -2,8 +2,8 @@
|
|
2
2
|
|
3
3
|
desc 'Bots methods.'
|
4
4
|
command 'bots' do |g|
|
5
|
-
g.desc '
|
6
|
-
g.long_desc %(
|
5
|
+
g.desc 'Gets information about a bot user.'
|
6
|
+
g.long_desc %( Gets information about a bot user. )
|
7
7
|
g.command 'info' do |c|
|
8
8
|
c.flag 'bot', desc: 'Bot user to get info on.'
|
9
9
|
c.action do |_global_options, options, _args|
|
data/bin/commands/channels.rb
CHANGED
@@ -2,8 +2,8 @@
|
|
2
2
|
|
3
3
|
desc "Get info on your team's Slack channels, create or archive channels, invite users, set the topic and purpose, and mark a channel as read."
|
4
4
|
command 'channels' do |g|
|
5
|
-
g.desc '
|
6
|
-
g.long_desc %(
|
5
|
+
g.desc 'Archives a channel.'
|
6
|
+
g.long_desc %( Archives a channel. )
|
7
7
|
g.command 'archive' do |c|
|
8
8
|
c.flag 'channel', desc: 'Channel to archive.'
|
9
9
|
c.action do |_global_options, options, _args|
|
@@ -11,8 +11,8 @@ command 'channels' do |g|
|
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
14
|
-
g.desc '
|
15
|
-
g.long_desc %(
|
14
|
+
g.desc 'Creates a channel.'
|
15
|
+
g.long_desc %( Creates a channel. )
|
16
16
|
g.command 'create' do |c|
|
17
17
|
c.flag 'name', desc: 'Name of channel to create.'
|
18
18
|
c.flag 'validate', desc: 'Whether to return errors on invalid channel name instead of modifying it to meet the specified criteria.'
|
@@ -21,21 +21,21 @@ command 'channels' do |g|
|
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
24
|
-
g.desc '
|
25
|
-
g.long_desc %(
|
24
|
+
g.desc 'Fetches history of messages and events from a channel.'
|
25
|
+
g.long_desc %( Fetches history of messages and events from a channel. )
|
26
26
|
g.command 'history' do |c|
|
27
27
|
c.flag 'channel', desc: 'Channel to fetch history for.'
|
28
|
+
c.flag 'inclusive', desc: 'Include messages with latest or oldest timestamp in results.'
|
28
29
|
c.flag 'latest', desc: 'End of time range of messages to include in results.'
|
29
30
|
c.flag 'oldest', desc: 'Start of time range of messages to include in results.'
|
30
|
-
c.flag 'inclusive', desc: 'Include messages with latest or oldest timestamp in results.'
|
31
31
|
c.flag 'unreads', desc: 'Include unread_count_display in the output?.'
|
32
32
|
c.action do |_global_options, options, _args|
|
33
33
|
puts JSON.dump($client.channels_history(options))
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
37
|
-
g.desc '
|
38
|
-
g.long_desc %(
|
37
|
+
g.desc 'Gets information about a channel.'
|
38
|
+
g.long_desc %( Gets information about a channel. )
|
39
39
|
g.command 'info' do |c|
|
40
40
|
c.flag 'channel', desc: 'Channel to get info on.'
|
41
41
|
c.action do |_global_options, options, _args|
|
@@ -43,8 +43,8 @@ command 'channels' do |g|
|
|
43
43
|
end
|
44
44
|
end
|
45
45
|
|
46
|
-
g.desc '
|
47
|
-
g.long_desc %(
|
46
|
+
g.desc 'Invites a user to a channel.'
|
47
|
+
g.long_desc %( Invites a user to a channel. )
|
48
48
|
g.command 'invite' do |c|
|
49
49
|
c.flag 'channel', desc: 'Channel to invite user to.'
|
50
50
|
c.flag 'user', desc: 'User to invite to channel.'
|
@@ -53,8 +53,8 @@ command 'channels' do |g|
|
|
53
53
|
end
|
54
54
|
end
|
55
55
|
|
56
|
-
g.desc '
|
57
|
-
g.long_desc %(
|
56
|
+
g.desc 'Joins a channel, creating it if needed.'
|
57
|
+
g.long_desc %( Joins a channel, creating it if needed. )
|
58
58
|
g.command 'join' do |c|
|
59
59
|
c.flag 'name', desc: 'Name of channel to join.'
|
60
60
|
c.flag 'validate', desc: 'Whether to return errors on invalid channel name instead of modifying it to meet the specified criteria.'
|
@@ -63,8 +63,8 @@ command 'channels' do |g|
|
|
63
63
|
end
|
64
64
|
end
|
65
65
|
|
66
|
-
g.desc '
|
67
|
-
g.long_desc %(
|
66
|
+
g.desc 'Removes a user from a channel.'
|
67
|
+
g.long_desc %( Removes a user from a channel. )
|
68
68
|
g.command 'kick' do |c|
|
69
69
|
c.flag 'channel', desc: 'Channel to remove user from.'
|
70
70
|
c.flag 'user', desc: 'User to remove from channel.'
|
@@ -73,8 +73,8 @@ command 'channels' do |g|
|
|
73
73
|
end
|
74
74
|
end
|
75
75
|
|
76
|
-
g.desc '
|
77
|
-
g.long_desc %(
|
76
|
+
g.desc 'Leaves a channel.'
|
77
|
+
g.long_desc %( Leaves a channel. )
|
78
78
|
g.command 'leave' do |c|
|
79
79
|
c.flag 'channel', desc: 'Channel to leave.'
|
80
80
|
c.action do |_global_options, options, _args|
|
@@ -82,8 +82,8 @@ command 'channels' do |g|
|
|
82
82
|
end
|
83
83
|
end
|
84
84
|
|
85
|
-
g.desc '
|
86
|
-
g.long_desc %(
|
85
|
+
g.desc 'Lists all channels in a Slack team.'
|
86
|
+
g.long_desc %( Lists all channels in a Slack team. )
|
87
87
|
g.command 'list' do |c|
|
88
88
|
c.flag 'exclude_archived', desc: 'Exclude archived channels from the list.'
|
89
89
|
c.flag 'exclude_members', desc: 'Exclude the members collection from each channel.'
|
@@ -92,8 +92,8 @@ command 'channels' do |g|
|
|
92
92
|
end
|
93
93
|
end
|
94
94
|
|
95
|
-
g.desc '
|
96
|
-
g.long_desc %(
|
95
|
+
g.desc 'Sets the read cursor in a channel.'
|
96
|
+
g.long_desc %( Sets the read cursor in a channel. )
|
97
97
|
g.command 'mark' do |c|
|
98
98
|
c.flag 'channel', desc: 'Channel to set reading cursor in.'
|
99
99
|
c.flag 'ts', desc: 'Timestamp of the most recently seen message.'
|
@@ -102,8 +102,8 @@ command 'channels' do |g|
|
|
102
102
|
end
|
103
103
|
end
|
104
104
|
|
105
|
-
g.desc '
|
106
|
-
g.long_desc %(
|
105
|
+
g.desc 'Renames a channel.'
|
106
|
+
g.long_desc %( Renames a channel. )
|
107
107
|
g.command 'rename' do |c|
|
108
108
|
c.flag 'channel', desc: 'Channel to rename.'
|
109
109
|
c.flag 'name', desc: 'New name for channel.'
|
@@ -113,8 +113,8 @@ command 'channels' do |g|
|
|
113
113
|
end
|
114
114
|
end
|
115
115
|
|
116
|
-
g.desc '
|
117
|
-
g.long_desc %(
|
116
|
+
g.desc 'Retrieve a thread of messages posted to a channel'
|
117
|
+
g.long_desc %( Retrieve a thread of messages posted to a channel )
|
118
118
|
g.command 'replies' do |c|
|
119
119
|
c.flag 'channel', desc: 'Channel to fetch thread from.'
|
120
120
|
c.flag 'thread_ts', desc: "Unique identifier of a thread's parent message."
|
@@ -123,8 +123,8 @@ command 'channels' do |g|
|
|
123
123
|
end
|
124
124
|
end
|
125
125
|
|
126
|
-
g.desc '
|
127
|
-
g.long_desc %(
|
126
|
+
g.desc 'Sets the purpose for a channel.'
|
127
|
+
g.long_desc %( Sets the purpose for a channel. )
|
128
128
|
g.command 'setPurpose' do |c|
|
129
129
|
c.flag 'channel', desc: 'Channel to set the purpose of.'
|
130
130
|
c.flag 'purpose', desc: 'The new purpose.'
|
@@ -133,8 +133,8 @@ command 'channels' do |g|
|
|
133
133
|
end
|
134
134
|
end
|
135
135
|
|
136
|
-
g.desc '
|
137
|
-
g.long_desc %(
|
136
|
+
g.desc 'Sets the topic for a channel.'
|
137
|
+
g.long_desc %( Sets the topic for a channel. )
|
138
138
|
g.command 'setTopic' do |c|
|
139
139
|
c.flag 'channel', desc: 'Channel to set the topic of.'
|
140
140
|
c.flag 'topic', desc: 'The new topic.'
|
@@ -143,8 +143,8 @@ command 'channels' do |g|
|
|
143
143
|
end
|
144
144
|
end
|
145
145
|
|
146
|
-
g.desc '
|
147
|
-
g.long_desc %(
|
146
|
+
g.desc 'Unarchives a channel.'
|
147
|
+
g.long_desc %( Unarchives a channel. )
|
148
148
|
g.command 'unarchive' do |c|
|
149
149
|
c.flag 'channel', desc: 'Channel to unarchive.'
|
150
150
|
c.action do |_global_options, options, _args|
|
data/bin/commands/chat.rb
CHANGED
@@ -2,19 +2,19 @@
|
|
2
2
|
|
3
3
|
desc 'Post chat messages to Slack.'
|
4
4
|
command 'chat' do |g|
|
5
|
-
g.desc '
|
6
|
-
g.long_desc %(
|
5
|
+
g.desc 'Deletes a message.'
|
6
|
+
g.long_desc %( Deletes a message. )
|
7
7
|
g.command 'delete' do |c|
|
8
|
-
c.flag 'ts', desc: 'Timestamp of the message to be deleted.'
|
9
8
|
c.flag 'channel', desc: 'Channel containing the message to be deleted.'
|
9
|
+
c.flag 'ts', desc: 'Timestamp of the message to be deleted.'
|
10
10
|
c.flag 'as_user', desc: 'Pass true to delete the message as the authed user. Bot users in this context are considered authed users.'
|
11
11
|
c.action do |_global_options, options, _args|
|
12
12
|
puts JSON.dump($client.chat_delete(options))
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
16
|
-
g.desc '
|
17
|
-
g.long_desc %(
|
16
|
+
g.desc 'Share a me message into a channel.'
|
17
|
+
g.long_desc %( Share a me message into a channel. )
|
18
18
|
g.command 'meMessage' do |c|
|
19
19
|
c.flag 'channel', desc: 'Channel to send message to. Can be a public channel, private group or IM channel. Can be an encoded ID, or a name.'
|
20
20
|
c.flag 'text', desc: 'Text of the message to send.'
|
@@ -23,49 +23,66 @@ command 'chat' do |g|
|
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
26
|
-
g.desc '
|
27
|
-
g.long_desc %(
|
26
|
+
g.desc 'Sends an ephemeral message to a user in a channel.'
|
27
|
+
g.long_desc %( Sends an ephemeral message to a user in a channel. )
|
28
|
+
g.command 'postEphemeral' do |c|
|
29
|
+
c.flag 'channel', desc: 'Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name.'
|
30
|
+
c.flag 'text', desc: "Text of the message to send. See below for an explanation of formatting. This field is usually required, unless you're providing only attachments instead."
|
31
|
+
c.flag 'user', desc: 'id of the user who will receive the ephemeral message. The user should be in the channel specified by the channel argument.'
|
32
|
+
c.flag 'as_user', desc: 'Pass true to post the message as the authed bot. Defaults to false.'
|
33
|
+
c.flag 'attachments', desc: 'A JSON-based array of structured attachments, presented as a URL-encoded string.'
|
34
|
+
c.flag 'link_names', desc: 'Find and link channel names and usernames.'
|
35
|
+
c.flag 'parse', desc: 'Change how messages are treated. Defaults to none. See below.'
|
36
|
+
c.action do |_global_options, options, _args|
|
37
|
+
puts JSON.dump($client.chat_postEphemeral(options))
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
g.desc 'Sends a message to a channel.'
|
42
|
+
g.long_desc %( Sends a message to a channel. )
|
28
43
|
g.command 'postMessage' do |c|
|
29
44
|
c.flag 'channel', desc: 'Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name. See below for more details.'
|
30
45
|
c.flag 'text', desc: "Text of the message to send. See below for an explanation of formatting. This field is usually required, unless you're providing only attachments instead."
|
31
|
-
c.flag '
|
46
|
+
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.'
|
47
|
+
c.flag 'attachments', desc: 'A JSON-based array of structured attachments, presented as a URL-encoded string.'
|
48
|
+
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.'
|
49
|
+
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.'
|
32
50
|
c.flag 'link_names', desc: 'Find and link channel names and usernames.'
|
33
|
-
c.flag '
|
51
|
+
c.flag 'parse', desc: 'Change how messages are treated. Defaults to none. See below.'
|
52
|
+
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.'
|
53
|
+
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."
|
34
54
|
c.flag 'unfurl_links', desc: 'Pass true to enable unfurling of primarily text-based content.'
|
35
55
|
c.flag 'unfurl_media', desc: 'Pass false to disable unfurling of media content.'
|
36
56
|
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."
|
37
|
-
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.'
|
38
|
-
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.'
|
39
|
-
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.'
|
40
|
-
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."
|
41
|
-
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.'
|
42
57
|
c.action do |_global_options, options, _args|
|
43
58
|
puts JSON.dump($client.chat_postMessage(options))
|
44
59
|
end
|
45
60
|
end
|
46
61
|
|
47
|
-
g.desc '
|
48
|
-
g.long_desc %(
|
62
|
+
g.desc 'Provide custom unfurl behavior for user-posted URLs'
|
63
|
+
g.long_desc %( Provide custom unfurl behavior for user-posted URLs )
|
49
64
|
g.command 'unfurl' do |c|
|
50
65
|
c.flag 'channel', desc: 'Channel ID of the message.'
|
51
66
|
c.flag 'ts', desc: 'Timestamp of the message to add unfurl behavior to.'
|
52
|
-
c.flag 'unfurls', desc: 'JSON
|
67
|
+
c.flag 'unfurls', desc: 'URL-encoded JSON map with keys set to URLs featured in the the message, pointing to their unfurl message attachments.'
|
68
|
+
c.flag 'user_auth_message', desc: 'Provide a simply-formatted string to send as an ephemeral message to the user as invitation to authenticate further and enable full unfurling behavior.'
|
53
69
|
c.flag 'user_auth_required', desc: 'Set to true or 1 to indicate the user must install your Slack app to trigger unfurls for this domain.'
|
70
|
+
c.flag 'user_auth_url', desc: 'Send users to this custom URL where they will complete authentication in your app to fully trigger unfurling. Value should be properly URL-encoded.'
|
54
71
|
c.action do |_global_options, options, _args|
|
55
72
|
puts JSON.dump($client.chat_unfurl(options))
|
56
73
|
end
|
57
74
|
end
|
58
75
|
|
59
|
-
g.desc '
|
60
|
-
g.long_desc %(
|
76
|
+
g.desc 'Updates a message.'
|
77
|
+
g.long_desc %( Updates a message. )
|
61
78
|
g.command 'update' do |c|
|
62
|
-
c.flag 'ts', desc: 'Timestamp of the message to be updated.'
|
63
79
|
c.flag 'channel', desc: 'Channel containing the message to be updated.'
|
64
80
|
c.flag 'text', desc: 'New text for the message, using the default formatting rules.'
|
65
|
-
c.flag '
|
66
|
-
c.flag 'parse', desc: 'Change how messages are treated. Defaults to client, unlike chat.postMessage. See below.'
|
67
|
-
c.flag 'link_names', desc: '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.'
|
81
|
+
c.flag 'ts', desc: 'Timestamp of the message to be updated.'
|
68
82
|
c.flag 'as_user', desc: 'Pass true to update the message as the authed user. Bot users in this context are considered authed users.'
|
83
|
+
c.flag 'attachments', desc: 'A JSON-based array of structured attachments, presented as a URL-encoded string.'
|
84
|
+
c.flag 'link_names', desc: '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.'
|
85
|
+
c.flag 'parse', desc: 'Change how messages are treated. Defaults to client, unlike chat.postMessage. See below.'
|
69
86
|
c.action do |_global_options, options, _args|
|
70
87
|
puts JSON.dump($client.chat_update(options))
|
71
88
|
end
|
data/bin/commands/dnd.rb
CHANGED
@@ -2,8 +2,8 @@
|
|
2
2
|
|
3
3
|
desc 'Adjust and view Do Not Disturb settings for team members.'
|
4
4
|
command 'dnd' do |g|
|
5
|
-
g.desc "Ends the user's
|
6
|
-
g.long_desc %( Ends the user's
|
5
|
+
g.desc "Ends the current user's Do Not Disturb session immediately."
|
6
|
+
g.long_desc %( Ends the current user's Do Not Disturb session immediately. )
|
7
7
|
g.command 'endDnd' do |c|
|
8
8
|
c.action do |_global_options, options, _args|
|
9
9
|
puts JSON.dump($client.dnd_endDnd(options))
|
@@ -18,8 +18,8 @@ command 'dnd' do |g|
|
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
21
|
-
g.desc "
|
22
|
-
g.long_desc %(
|
21
|
+
g.desc "Retrieves a user's current Do Not Disturb status."
|
22
|
+
g.long_desc %( Retrieves a user's current Do Not Disturb status. )
|
23
23
|
g.command 'info' do |c|
|
24
24
|
c.flag 'user', desc: 'User to fetch status for (defaults to current user).'
|
25
25
|
c.action do |_global_options, options, _args|
|
@@ -27,8 +27,8 @@ command 'dnd' do |g|
|
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
30
|
-
g.desc
|
31
|
-
g.long_desc %(
|
30
|
+
g.desc 'Turns on Do Not Disturb mode for the current user, or changes its duration.'
|
31
|
+
g.long_desc %( Turns on Do Not Disturb mode for the current user, or changes its duration. )
|
32
32
|
g.command 'setSnooze' do |c|
|
33
33
|
c.flag 'num_minutes', desc: 'Number of minutes, from now, to snooze until.'
|
34
34
|
c.action do |_global_options, options, _args|
|
@@ -36,8 +36,8 @@ command 'dnd' do |g|
|
|
36
36
|
end
|
37
37
|
end
|
38
38
|
|
39
|
-
g.desc '
|
40
|
-
g.long_desc %(
|
39
|
+
g.desc 'Retrieves the Do Not Disturb status for users on a team.'
|
40
|
+
g.long_desc %( Retrieves the Do Not Disturb status for users on a team. )
|
41
41
|
g.command 'teamInfo' do |c|
|
42
42
|
c.flag 'users', desc: 'Comma-separated list of users to fetch Do Not Disturb status for.'
|
43
43
|
c.action do |_global_options, options, _args|
|