slack-ruby-client 0.9.0 → 0.11.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.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.rubocop.yml +3 -0
- data/.rubocop_todo.yml +40 -39
- data/.travis.yml +1 -9
- data/CHANGELOG.md +24 -0
- data/CONTRIBUTING.md +2 -2
- data/Gemfile +3 -1
- data/README.md +40 -12
- data/Rakefile +1 -1
- data/UPGRADING.md +1 -1
- 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 +52 -40
- data/bin/commands/chat.rb +63 -25
- data/bin/commands/conversations.rb +178 -0
- data/bin/commands/dialog.rb +14 -0
- data/bin/commands/dnd.rb +8 -8
- data/bin/commands/emoji.rb +2 -2
- data/bin/commands/files.rb +38 -17
- data/bin/commands/files_comments.rb +6 -6
- data/bin/commands/groups.rb +44 -51
- data/bin/commands/im.rb +16 -13
- data/bin/commands/migration.rb +14 -0
- 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 +9 -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 +40 -36
- data/bin/commands/users_admin.rb +28 -0
- data/bin/commands/users_prefs.rb +12 -0
- data/bin/commands/users_profile.rb +7 -7
- data/bin/commands.rb +7 -1
- data/bin/slack +1 -1
- data/examples/hi_real_time/hi.rb +1 -1
- data/examples/hi_real_time_and_web/hi.rb +1 -1
- data/examples/hi_real_time_async_celluloid/hi.rb +1 -1
- data/examples/hi_real_time_async_eventmachine/hi.rb +1 -1
- data/examples/hi_web/hi.rb +1 -1
- data/examples/new_ticket/new_ticket.rb +1 -1
- data/lib/slack/messages/formatting.rb +4 -4
- data/lib/slack/messages/message.rb +1 -2
- data/lib/slack/real_time/api/templates/event_handler.erb +1 -1
- data/lib/slack/real_time/client.rb +11 -10
- data/lib/slack/real_time/concurrency/celluloid.rb +6 -2
- data/lib/slack/real_time/config.rb +11 -11
- data/lib/slack/real_time/models/base.rb +1 -2
- data/lib/slack/real_time/socket.rb +2 -2
- data/lib/slack/real_time/stores/base.rb +1 -2
- data/lib/slack/real_time/stores/starter.rb +92 -72
- data/lib/slack/real_time/stores/store.rb +120 -90
- data/lib/slack/version.rb +1 -1
- data/lib/slack/web/api/endpoints/api.rb +2 -2
- data/lib/slack/web/api/endpoints/apps_permissions.rb +35 -0
- data/lib/slack/web/api/endpoints/auth.rb +4 -4
- data/lib/slack/web/api/endpoints/bots.rb +2 -2
- data/lib/slack/web/api/endpoints/channels.rb +57 -34
- data/lib/slack/web/api/endpoints/chat.rb +107 -37
- data/lib/slack/web/api/endpoints/conversations.rb +301 -0
- data/lib/slack/web/api/endpoints/dialog.rb +32 -0
- data/lib/slack/web/api/endpoints/dnd.rb +9 -9
- data/lib/slack/web/api/endpoints/emoji.rb +2 -2
- data/lib/slack/web/api/endpoints/files.rb +53 -23
- data/lib/slack/web/api/endpoints/files_comments.rb +11 -11
- data/lib/slack/web/api/endpoints/groups.rb +38 -50
- data/lib/slack/web/api/endpoints/im.rb +27 -17
- data/lib/slack/web/api/endpoints/migration.rb +25 -0
- data/lib/slack/web/api/endpoints/mpim.rb +13 -15
- data/lib/slack/web/api/endpoints/oauth.rb +24 -3
- data/lib/slack/web/api/endpoints/pins.rb +6 -8
- data/lib/slack/web/api/endpoints/presence.rb +1 -1
- data/lib/slack/web/api/endpoints/reactions.rb +18 -20
- data/lib/slack/web/api/endpoints/reminders.rb +10 -10
- data/lib/slack/web/api/endpoints/rtm.rb +14 -8
- data/lib/slack/web/api/endpoints/search.rb +12 -12
- data/lib/slack/web/api/endpoints/stars.rb +10 -12
- data/lib/slack/web/api/endpoints/team.rb +12 -13
- data/lib/slack/web/api/endpoints/team_profile.rb +2 -2
- data/lib/slack/web/api/endpoints/usergroups.rb +22 -22
- data/lib/slack/web/api/endpoints/usergroups_users.rb +4 -4
- data/lib/slack/web/api/endpoints/users.rb +34 -24
- data/lib/slack/web/api/endpoints/users_admin.rb +46 -0
- data/lib/slack/web/api/endpoints/users_prefs.rb +19 -0
- data/lib/slack/web/api/endpoints/users_profile.rb +10 -10
- data/lib/slack/web/api/endpoints.rb +14 -2
- data/lib/slack/web/api/mixins/ids.id.rb +1 -1
- data/lib/slack/web/api/mixins/users.search.rb +38 -36
- data/lib/slack/web/api/patches/chat.1.text-attachments-required.patch +1 -1
- 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/lib/slack/web/api/patches/dialog.1.open-json-support.patch +17 -0
- data/lib/slack/web/api/templates/command.erb +4 -3
- data/lib/slack/web/api/templates/commands.erb +1 -1
- data/lib/slack/web/api/templates/endpoints.erb +2 -2
- data/lib/slack/web/api/templates/method.erb +18 -3
- data/lib/slack/web/api/templates/method_spec.erb +1 -1
- data/lib/slack/web/config.rb +16 -12
- data/lib/slack/web/faraday/connection.rb +1 -1
- data/lib/slack/web/faraday/response/raise_error.rb +3 -3
- data/lib/slack/web/pagination/cursor.rb +48 -0
- data/lib/slack-ruby-client.rb +6 -0
- data/lib/tasks/git.rake +1 -1
- data/lib/tasks/real_time.rake +1 -1
- data/lib/tasks/web.rake +4 -1
- data/slack-ruby-client.gemspec +2 -3
- data/spec/fixtures/slack/web/paginated_users_list.yml +181 -0
- data/spec/integration/integration_spec.rb +1 -1
- data/spec/slack/messages/formatting_spec.rb +1 -1
- data/spec/slack/real_time/client_spec.rb +62 -63
- data/spec/slack/real_time/concurrency/celluloid_spec.rb +41 -31
- data/spec/slack/real_time/concurrency/it_behaves_like_a_realtime_socket.rb +1 -1
- data/spec/slack/real_time/event_handlers/bot_spec.rb +4 -2
- data/spec/slack/real_time/event_handlers/event_handlers_spec.rb +1 -1
- data/spec/slack/real_time/event_handlers/user_spec.rb +4 -2
- data/spec/slack/web/api/endpoints/apps_permissions_spec.rb +15 -0
- data/spec/slack/web/api/endpoints/conversations_spec.rb +100 -0
- data/spec/slack/web/api/endpoints/custom_specs/chat_spec.rb +37 -1
- data/spec/slack/web/api/endpoints/custom_specs/dialog_spec.rb +28 -0
- data/spec/slack/web/api/endpoints/custom_specs/users_spec.rb +16 -6
- data/spec/slack/web/api/endpoints/files_comments_spec.rb +8 -8
- data/spec/slack/web/api/endpoints/files_spec.rb +16 -5
- data/spec/slack/web/api/endpoints/migration_spec.rb +12 -0
- data/spec/slack/web/api/endpoints/oauth_spec.rb +11 -0
- data/spec/slack/web/api/endpoints/users_admin_spec.rb +17 -0
- data/spec/slack/web/api/endpoints/users_prefs_spec.rb +7 -0
- data/spec/slack/web/api/error_spec.rb +1 -1
- data/spec/slack/web/api/errors/slack_error_spec.rb +1 -1
- data/spec/slack/web/api/mixins/users_spec.rb +6 -4
- data/spec/slack/web/api/pagination/cursor_spec.rb +70 -0
- data/spec/support/queue_with_timeout.rb +1 -1
- data/spec/support/real_time/concurrency/mock.rb +1 -2
- metadata +47 -30
data/bin/commands/chat.rb
CHANGED
@@ -2,19 +2,40 @@
|
|
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 'Execute a slash command in a public channel (undocumented)'
|
6
|
+
g.long_desc %( Execute a slash command in a public channel )
|
7
|
+
g.command 'command' do |c|
|
8
|
+
c.flag 'channel', desc: 'Channel to execute the command in.'
|
9
|
+
c.flag 'command', desc: 'Slash command to be executed. Leading backslash is required.'
|
10
|
+
c.flag 'text', desc: 'Additional parameters provided to the slash command.'
|
11
|
+
c.action do |_global_options, options, _args|
|
12
|
+
puts JSON.dump($client.chat_command(options))
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
g.desc 'Deletes a message.'
|
17
|
+
g.long_desc %( Deletes a message. )
|
7
18
|
g.command 'delete' do |c|
|
8
|
-
c.flag 'ts', desc: 'Timestamp of the message to be deleted.'
|
9
19
|
c.flag 'channel', desc: 'Channel containing the message to be deleted.'
|
10
|
-
c.flag '
|
20
|
+
c.flag 'ts', desc: 'Timestamp of the message to be deleted.'
|
21
|
+
c.flag 'as_user', desc: 'Pass true to delete the message as the authed user with chat:write:user scope. Bot users in this context are considered authed users. If unused or false, the message will be deleted with chat:write:bot scope.'
|
11
22
|
c.action do |_global_options, options, _args|
|
12
23
|
puts JSON.dump($client.chat_delete(options))
|
13
24
|
end
|
14
25
|
end
|
15
26
|
|
16
|
-
g.desc '
|
17
|
-
g.long_desc %(
|
27
|
+
g.desc 'Retrieve a permalink URL for a specific extant message'
|
28
|
+
g.long_desc %( Retrieve a permalink URL for a specific extant message )
|
29
|
+
g.command 'getPermalink' do |c|
|
30
|
+
c.flag 'channel', desc: 'The ID of the conversation or channel containing the message.'
|
31
|
+
c.flag 'message_ts', desc: "A message's ts value, uniquely identifying it within a channel."
|
32
|
+
c.action do |_global_options, options, _args|
|
33
|
+
puts JSON.dump($client.chat_getPermalink(options))
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
g.desc 'Share a me message into a channel.'
|
38
|
+
g.long_desc %( Share a me message into a channel. )
|
18
39
|
g.command 'meMessage' do |c|
|
19
40
|
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
41
|
c.flag 'text', desc: 'Text of the message to send.'
|
@@ -23,49 +44,66 @@ command 'chat' do |g|
|
|
23
44
|
end
|
24
45
|
end
|
25
46
|
|
26
|
-
g.desc '
|
27
|
-
g.long_desc %(
|
47
|
+
g.desc 'Sends an ephemeral message to a user in a channel.'
|
48
|
+
g.long_desc %( Sends an ephemeral message to a user in a channel. )
|
49
|
+
g.command 'postEphemeral' do |c|
|
50
|
+
c.flag 'channel', desc: 'Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name.'
|
51
|
+
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."
|
52
|
+
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.'
|
53
|
+
c.flag 'as_user', desc: 'Pass true to post the message as the authed bot. Defaults to false.'
|
54
|
+
c.flag 'attachments', desc: 'A JSON-based array of structured attachments, presented as a URL-encoded string.'
|
55
|
+
c.flag 'link_names', desc: 'Find and link channel names and usernames.'
|
56
|
+
c.flag 'parse', desc: 'Change how messages are treated. Defaults to none. See below.'
|
57
|
+
c.action do |_global_options, options, _args|
|
58
|
+
puts JSON.dump($client.chat_postEphemeral(options))
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
g.desc 'Sends a message to a channel.'
|
63
|
+
g.long_desc %( Sends a message to a channel. )
|
28
64
|
g.command 'postMessage' do |c|
|
29
65
|
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
66
|
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 '
|
67
|
+
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.'
|
68
|
+
c.flag 'attachments', desc: 'A JSON-based array of structured attachments, presented as a URL-encoded string.'
|
69
|
+
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.'
|
70
|
+
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
71
|
c.flag 'link_names', desc: 'Find and link channel names and usernames.'
|
33
|
-
c.flag '
|
72
|
+
c.flag 'parse', desc: 'Change how messages are treated. Defaults to none. See below.'
|
73
|
+
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.'
|
74
|
+
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
75
|
c.flag 'unfurl_links', desc: 'Pass true to enable unfurling of primarily text-based content.'
|
35
76
|
c.flag 'unfurl_media', desc: 'Pass false to disable unfurling of media content.'
|
36
77
|
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
78
|
c.action do |_global_options, options, _args|
|
43
79
|
puts JSON.dump($client.chat_postMessage(options))
|
44
80
|
end
|
45
81
|
end
|
46
82
|
|
47
|
-
g.desc '
|
48
|
-
g.long_desc %(
|
83
|
+
g.desc 'Provide custom unfurl behavior for user-posted URLs'
|
84
|
+
g.long_desc %( Provide custom unfurl behavior for user-posted URLs )
|
49
85
|
g.command 'unfurl' do |c|
|
50
86
|
c.flag 'channel', desc: 'Channel ID of the message.'
|
51
87
|
c.flag 'ts', desc: 'Timestamp of the message to add unfurl behavior to.'
|
52
|
-
c.flag 'unfurls', desc: 'JSON
|
88
|
+
c.flag 'unfurls', desc: 'URL-encoded JSON map with keys set to URLs featured in the the message, pointing to their unfurl message attachments.'
|
89
|
+
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
90
|
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.'
|
91
|
+
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
92
|
c.action do |_global_options, options, _args|
|
55
93
|
puts JSON.dump($client.chat_unfurl(options))
|
56
94
|
end
|
57
95
|
end
|
58
96
|
|
59
|
-
g.desc '
|
60
|
-
g.long_desc %(
|
97
|
+
g.desc 'Updates a message.'
|
98
|
+
g.long_desc %( Updates a message. )
|
61
99
|
g.command 'update' do |c|
|
62
|
-
c.flag 'ts', desc: 'Timestamp of the message to be updated.'
|
63
100
|
c.flag 'channel', desc: 'Channel containing the message to be updated.'
|
64
|
-
c.flag 'text', desc:
|
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.'
|
101
|
+
c.flag 'text', desc: "New text for the message, using the default formatting rules. It's not required when presenting attachments."
|
102
|
+
c.flag 'ts', desc: 'Timestamp of the message to be updated.'
|
68
103
|
c.flag 'as_user', desc: 'Pass true to update the message as the authed user. Bot users in this context are considered authed users.'
|
104
|
+
c.flag 'attachments', desc: 'A JSON-based array of structured attachments, presented as a URL-encoded string. This field is required when not presenting text.'
|
105
|
+
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.'
|
106
|
+
c.flag 'parse', desc: 'Change how messages are treated. Defaults to client, unlike chat.postMessage. See below.'
|
69
107
|
c.action do |_global_options, options, _args|
|
70
108
|
puts JSON.dump($client.chat_update(options))
|
71
109
|
end
|
@@ -0,0 +1,178 @@
|
|
1
|
+
# This file was auto-generated by lib/tasks/web.rake
|
2
|
+
|
3
|
+
desc "Interface with all kinds of conversations the same way, whether they're public or private channels, direct messages, or otherwise."
|
4
|
+
command 'conversations' do |g|
|
5
|
+
g.desc 'Archives a conversation.'
|
6
|
+
g.long_desc %( Archives a conversation. )
|
7
|
+
g.command 'archive' do |c|
|
8
|
+
c.flag 'channel', desc: 'ID of conversation to archive.'
|
9
|
+
c.action do |_global_options, options, _args|
|
10
|
+
puts JSON.dump($client.conversations_archive(options))
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
g.desc 'Closes a direct message or multi-person direct message.'
|
15
|
+
g.long_desc %( Closes a direct message or multi-person direct message. )
|
16
|
+
g.command 'close' do |c|
|
17
|
+
c.flag 'channel', desc: 'Conversation to close.'
|
18
|
+
c.action do |_global_options, options, _args|
|
19
|
+
puts JSON.dump($client.conversations_close(options))
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
g.desc 'Initiates a public or private channel-based conversation'
|
24
|
+
g.long_desc %( Initiates a public or private channel-based conversation )
|
25
|
+
g.command 'create' do |c|
|
26
|
+
c.flag 'name', desc: 'Name of the public or private channel to create.'
|
27
|
+
c.flag 'is_private', desc: 'Create a private channel instead of a public one.'
|
28
|
+
c.action do |_global_options, options, _args|
|
29
|
+
puts JSON.dump($client.conversations_create(options))
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
g.desc "Fetches a conversation's history of messages and events."
|
34
|
+
g.long_desc %( Fetches a conversation's history of messages and events. )
|
35
|
+
g.command 'history' do |c|
|
36
|
+
c.flag 'channel', desc: 'Conversation ID to fetch history for.'
|
37
|
+
c.flag 'cursor', desc: "Paginate through collections of data by setting the cursor parameter to a next_cursor attribute returned by a previous request's response_metadata. Default value fetches the first 'page' of the collection. See pagination for more detail."
|
38
|
+
c.flag 'latest', desc: 'End of time range of messages to include in results.'
|
39
|
+
c.flag 'limit', desc: "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."
|
40
|
+
c.flag 'oldest', desc: 'Start of time range of messages to include in results.'
|
41
|
+
c.action do |_global_options, options, _args|
|
42
|
+
puts JSON.dump($client.conversations_history(options))
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
g.desc 'Retrieve information about a conversation.'
|
47
|
+
g.long_desc %( Retrieve information about a conversation. )
|
48
|
+
g.command 'info' do |c|
|
49
|
+
c.flag 'channel', desc: 'Conversation ID to learn more about.'
|
50
|
+
c.flag 'include_locale', desc: 'Set this to true to receive the locale for this conversation. Defaults to false.'
|
51
|
+
c.action do |_global_options, options, _args|
|
52
|
+
puts JSON.dump($client.conversations_info(options))
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
g.desc 'Invites users to a channel.'
|
57
|
+
g.long_desc %( Invites users to a channel. )
|
58
|
+
g.command 'invite' do |c|
|
59
|
+
c.flag 'channel', desc: 'The ID of the public or private channel to invite user(s) to.'
|
60
|
+
c.flag 'users', desc: 'A comma separated list of user IDs. Up to 30 users may be listed.'
|
61
|
+
c.action do |_global_options, options, _args|
|
62
|
+
puts JSON.dump($client.conversations_invite(options))
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
g.desc 'Joins an existing conversation.'
|
67
|
+
g.long_desc %( Joins an existing conversation. )
|
68
|
+
g.command 'join' do |c|
|
69
|
+
c.flag 'channel', desc: 'ID of conversation to join.'
|
70
|
+
c.action do |_global_options, options, _args|
|
71
|
+
puts JSON.dump($client.conversations_join(options))
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
g.desc 'Removes a user from a conversation.'
|
76
|
+
g.long_desc %( Removes a user from a conversation. )
|
77
|
+
g.command 'kick' do |c|
|
78
|
+
c.flag 'channel', desc: 'ID of conversation to remove user from.'
|
79
|
+
c.flag 'user', desc: 'User ID to be removed.'
|
80
|
+
c.action do |_global_options, options, _args|
|
81
|
+
puts JSON.dump($client.conversations_kick(options))
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
g.desc 'Leaves a conversation.'
|
86
|
+
g.long_desc %( Leaves a conversation. )
|
87
|
+
g.command 'leave' do |c|
|
88
|
+
c.flag 'channel', desc: 'Conversation to leave.'
|
89
|
+
c.action do |_global_options, options, _args|
|
90
|
+
puts JSON.dump($client.conversations_leave(options))
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
94
|
+
g.desc 'Lists all channels in a Slack team.'
|
95
|
+
g.long_desc %( Lists all channels in a Slack team. )
|
96
|
+
g.command 'list' do |c|
|
97
|
+
c.flag 'cursor', desc: "Paginate through collections of data by setting the cursor parameter to a next_cursor attribute returned by a previous request's response_metadata. Default value fetches the first 'page' of the collection. See pagination for more detail."
|
98
|
+
c.flag 'exclude_archived', desc: 'Set to true to exclude archived channels from the list.'
|
99
|
+
c.flag 'limit', desc: "The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the list hasn't been reached. Must be an integer no larger than 1000."
|
100
|
+
c.flag 'types', desc: 'Mix and match channel types by providing a comma-separated list of any combination of public_channel, private_channel, mpim, im.'
|
101
|
+
c.action do |_global_options, options, _args|
|
102
|
+
puts JSON.dump($client.conversations_list(options))
|
103
|
+
end
|
104
|
+
end
|
105
|
+
|
106
|
+
g.desc 'Retrieve members of a conversation.'
|
107
|
+
g.long_desc %( Retrieve members of a conversation. )
|
108
|
+
g.command 'members' do |c|
|
109
|
+
c.flag 'channel', desc: 'ID of the conversation to retrieve members for.'
|
110
|
+
c.flag 'cursor', desc: "Paginate through collections of data by setting the cursor parameter to a next_cursor attribute returned by a previous request's response_metadata. Default value fetches the first 'page' of the collection. See pagination for more detail."
|
111
|
+
c.flag 'limit', desc: "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."
|
112
|
+
c.action do |_global_options, options, _args|
|
113
|
+
puts JSON.dump($client.conversations_members(options))
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
117
|
+
g.desc 'Opens or resumes a direct message or multi-person direct message.'
|
118
|
+
g.long_desc %( Opens or resumes a direct message or multi-person direct message. )
|
119
|
+
g.command 'open' do |c|
|
120
|
+
c.flag 'channel', desc: "Resume a conversation by supplying an im or mpim's ID. Or provide the users field instead."
|
121
|
+
c.flag 'return_im', desc: 'Boolean, indicates you want the full IM channel definition in the response.'
|
122
|
+
c.flag 'users', desc: 'Comma separated lists of users. If only one user is included, this creates a 1:1 DM. The ordering of the users is preserved whenever a multi-person direct message is returned. Supply a channel when not supplying users.'
|
123
|
+
c.action do |_global_options, options, _args|
|
124
|
+
puts JSON.dump($client.conversations_open(options))
|
125
|
+
end
|
126
|
+
end
|
127
|
+
|
128
|
+
g.desc 'Renames a conversation.'
|
129
|
+
g.long_desc %( Renames a conversation. )
|
130
|
+
g.command 'rename' do |c|
|
131
|
+
c.flag 'channel', desc: 'ID of conversation to rename.'
|
132
|
+
c.flag 'name', desc: 'New name for conversation.'
|
133
|
+
c.action do |_global_options, options, _args|
|
134
|
+
puts JSON.dump($client.conversations_rename(options))
|
135
|
+
end
|
136
|
+
end
|
137
|
+
|
138
|
+
g.desc 'Retrieve a thread of messages posted to a conversation'
|
139
|
+
g.long_desc %( Retrieve a thread of messages posted to a conversation )
|
140
|
+
g.command 'replies' do |c|
|
141
|
+
c.flag 'channel', desc: 'Conversation ID to fetch thread from.'
|
142
|
+
c.flag 'ts', desc: "Unique identifier of a thread's parent message."
|
143
|
+
c.flag 'cursor', desc: "Paginate through collections of data by setting the cursor parameter to a next_cursor attribute returned by a previous request's response_metadata. Default value fetches the first 'page' of the collection. See pagination for more detail."
|
144
|
+
c.flag 'limit', desc: "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."
|
145
|
+
c.action do |_global_options, options, _args|
|
146
|
+
puts JSON.dump($client.conversations_replies(options))
|
147
|
+
end
|
148
|
+
end
|
149
|
+
|
150
|
+
g.desc 'Sets the purpose for a conversation.'
|
151
|
+
g.long_desc %( Sets the purpose for a conversation. )
|
152
|
+
g.command 'setPurpose' do |c|
|
153
|
+
c.flag 'channel', desc: 'Conversation to set the purpose of.'
|
154
|
+
c.flag 'purpose', desc: 'A new, specialer purpose.'
|
155
|
+
c.action do |_global_options, options, _args|
|
156
|
+
puts JSON.dump($client.conversations_setPurpose(options))
|
157
|
+
end
|
158
|
+
end
|
159
|
+
|
160
|
+
g.desc 'Sets the topic for a conversation.'
|
161
|
+
g.long_desc %( Sets the topic for a conversation. )
|
162
|
+
g.command 'setTopic' do |c|
|
163
|
+
c.flag 'channel', desc: 'Conversation to set the topic of.'
|
164
|
+
c.flag 'topic', desc: 'The new topic string. Does not support formatting or linkification.'
|
165
|
+
c.action do |_global_options, options, _args|
|
166
|
+
puts JSON.dump($client.conversations_setTopic(options))
|
167
|
+
end
|
168
|
+
end
|
169
|
+
|
170
|
+
g.desc 'Reverses conversation archival.'
|
171
|
+
g.long_desc %( Reverses conversation archival. )
|
172
|
+
g.command 'unarchive' do |c|
|
173
|
+
c.flag 'channel', desc: 'ID of conversation to unarchive.'
|
174
|
+
c.action do |_global_options, options, _args|
|
175
|
+
puts JSON.dump($client.conversations_unarchive(options))
|
176
|
+
end
|
177
|
+
end
|
178
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# This file was auto-generated by lib/tasks/web.rake
|
2
|
+
|
3
|
+
desc 'Dialog methods.'
|
4
|
+
command 'dialog' do |g|
|
5
|
+
g.desc 'Open a dialog with a user'
|
6
|
+
g.long_desc %( Open a dialog with a user )
|
7
|
+
g.command 'open' do |c|
|
8
|
+
c.flag 'dialog', desc: 'The dialog definition. This must be a JSON-encoded string.'
|
9
|
+
c.flag 'trigger_id', desc: 'Exchange a trigger to post to the user.'
|
10
|
+
c.action do |_global_options, options, _args|
|
11
|
+
puts JSON.dump($client.dialog_open(options))
|
12
|
+
end
|
13
|
+
end
|
14
|
+
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|
|
data/bin/commands/emoji.rb
CHANGED
@@ -2,8 +2,8 @@
|
|
2
2
|
|
3
3
|
desc 'Emoji methods.'
|
4
4
|
command 'emoji' do |g|
|
5
|
-
g.desc '
|
6
|
-
g.long_desc %(
|
5
|
+
g.desc 'Lists custom emoji for a team.'
|
6
|
+
g.long_desc %( Lists custom emoji for a team. )
|
7
7
|
g.command 'list' do |c|
|
8
8
|
c.action do |_global_options, options, _args|
|
9
9
|
puts JSON.dump($client.emoji_list(options))
|
data/bin/commands/files.rb
CHANGED
@@ -2,8 +2,8 @@
|
|
2
2
|
|
3
3
|
desc 'Get info on files uploaded to Slack, upload new files to Slack.'
|
4
4
|
command 'files' do |g|
|
5
|
-
g.desc '
|
6
|
-
g.long_desc %(
|
5
|
+
g.desc 'Deletes a file.'
|
6
|
+
g.long_desc %( Deletes a file. )
|
7
7
|
g.command 'delete' do |c|
|
8
8
|
c.flag 'file', desc: 'ID of file to delete.'
|
9
9
|
c.action do |_global_options, options, _args|
|
@@ -11,8 +11,19 @@ command 'files' do |g|
|
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
14
|
-
g.desc '
|
15
|
-
g.long_desc %(
|
14
|
+
g.desc 'Change the properties of a file (undocumented)'
|
15
|
+
g.long_desc %( Change the properties of a file )
|
16
|
+
g.command 'edit' do |c|
|
17
|
+
c.flag 'file', desc: 'ID of the file to be edited'
|
18
|
+
c.flag 'title', desc: 'New title of the file'
|
19
|
+
c.flag 'filetype', desc: 'New filetype of the file. See https://api.slack.com/types/file#file_types for a list of all supported types.'
|
20
|
+
c.action do |_global_options, options, _args|
|
21
|
+
puts JSON.dump($client.files_edit(options))
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
g.desc 'Gets information about a team file.'
|
26
|
+
g.long_desc %( Gets information about a team file. )
|
16
27
|
g.command 'info' do |c|
|
17
28
|
c.flag 'file', desc: 'Specify a file by providing its ID.'
|
18
29
|
c.action do |_global_options, options, _args|
|
@@ -20,10 +31,9 @@ command 'files' do |g|
|
|
20
31
|
end
|
21
32
|
end
|
22
33
|
|
23
|
-
g.desc '
|
24
|
-
g.long_desc %(
|
34
|
+
g.desc 'Lists & filters team files.'
|
35
|
+
g.long_desc %( Lists & filters team files. )
|
25
36
|
g.command 'list' do |c|
|
26
|
-
c.flag 'user', desc: 'Filter files created by a single user.'
|
27
37
|
c.flag 'channel', desc: 'Filter files appearing in a specific channel, indicated by its ID.'
|
28
38
|
c.flag 'ts_from', desc: 'Filter files created after this timestamp (inclusive).'
|
29
39
|
c.flag 'ts_to', desc: 'Filter files created before this timestamp (inclusive).'
|
@@ -40,13 +50,14 @@ pdfs - PDF files
|
|
40
50
|
|
41
51
|
You can pass multiple values in the types argument, like types=spaces,snippets.The default value is all, which does not filter the list.
|
42
52
|
.'
|
53
|
+
c.flag 'user', desc: 'Filter files created by a single user.'
|
43
54
|
c.action do |_global_options, options, _args|
|
44
55
|
puts JSON.dump($client.files_list(options))
|
45
56
|
end
|
46
57
|
end
|
47
58
|
|
48
|
-
g.desc '
|
49
|
-
g.long_desc %(
|
59
|
+
g.desc 'Revokes public/external sharing access for a file'
|
60
|
+
g.long_desc %( Revokes public/external sharing access for a file )
|
50
61
|
g.command 'revokePublicURL' do |c|
|
51
62
|
c.flag 'file', desc: 'File to revoke.'
|
52
63
|
c.action do |_global_options, options, _args|
|
@@ -54,8 +65,18 @@ You can pass multiple values in the types argument, like types=spaces,snippets.T
|
|
54
65
|
end
|
55
66
|
end
|
56
67
|
|
57
|
-
g.desc '
|
58
|
-
g.long_desc %(
|
68
|
+
g.desc 'Share an existing file in a channel (undocumented)'
|
69
|
+
g.long_desc %( Share an existing file in a channel )
|
70
|
+
g.command 'share' do |c|
|
71
|
+
c.flag 'file', desc: 'ID of the file to be shared'
|
72
|
+
c.flag 'channel', desc: 'Channel to share the file in. Works with both public (channel ID) and private channels (group ID).'
|
73
|
+
c.action do |_global_options, options, _args|
|
74
|
+
puts JSON.dump($client.files_share(options))
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
g.desc 'Enables a file for public/external sharing.'
|
79
|
+
g.long_desc %( Enables a file for public/external sharing. )
|
59
80
|
g.command 'sharedPublicURL' do |c|
|
60
81
|
c.flag 'file', desc: 'File to share.'
|
61
82
|
c.action do |_global_options, options, _args|
|
@@ -63,16 +84,16 @@ You can pass multiple values in the types argument, like types=spaces,snippets.T
|
|
63
84
|
end
|
64
85
|
end
|
65
86
|
|
66
|
-
g.desc '
|
67
|
-
g.long_desc %(
|
87
|
+
g.desc 'Uploads or creates a file.'
|
88
|
+
g.long_desc %( Uploads or creates a file. )
|
68
89
|
g.command 'upload' do |c|
|
69
|
-
c.flag '
|
90
|
+
c.flag 'channels', desc: 'Comma-separated list of channel names or IDs where the file will be shared.'
|
70
91
|
c.flag 'content', desc: 'File contents via a POST variable. If omitting this parameter, you must provide a file.'
|
71
|
-
c.flag '
|
92
|
+
c.flag 'file', desc: 'File contents via multipart/form-data. If omitting this parameter, you must submit content.'
|
72
93
|
c.flag 'filename', desc: 'Filename of file.'
|
73
|
-
c.flag '
|
94
|
+
c.flag 'filetype', desc: 'A file type identifier.'
|
74
95
|
c.flag 'initial_comment', desc: 'Initial comment to add to file.'
|
75
|
-
c.flag '
|
96
|
+
c.flag 'title', desc: 'Title of file.'
|
76
97
|
c.action do |_global_options, options, _args|
|
77
98
|
puts JSON.dump($client.files_upload(options))
|
78
99
|
end
|
@@ -5,15 +5,15 @@ command 'files_comments' do |g|
|
|
5
5
|
g.desc 'Add a comment to an existing file.'
|
6
6
|
g.long_desc %( Add a comment to an existing file. )
|
7
7
|
g.command 'add' do |c|
|
8
|
-
c.flag 'file', desc: 'File to add a comment to.'
|
9
8
|
c.flag 'comment', desc: 'Text of the comment to add.'
|
9
|
+
c.flag 'file', desc: 'File to add a comment to.'
|
10
10
|
c.action do |_global_options, options, _args|
|
11
11
|
puts JSON.dump($client.files_comments_add(options))
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
15
|
-
g.desc '
|
16
|
-
g.long_desc %(
|
15
|
+
g.desc 'Deletes an existing comment on a file.'
|
16
|
+
g.long_desc %( Deletes an existing comment on a file. )
|
17
17
|
g.command 'delete' do |c|
|
18
18
|
c.flag 'file', desc: 'File to delete a comment from.'
|
19
19
|
c.flag 'id', desc: 'The comment to delete.'
|
@@ -22,12 +22,12 @@ command 'files_comments' do |g|
|
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
25
|
-
g.desc 'Edit an existing
|
26
|
-
g.long_desc %( Edit an existing
|
25
|
+
g.desc 'Edit an existing file comment.'
|
26
|
+
g.long_desc %( Edit an existing file comment. )
|
27
27
|
g.command 'edit' do |c|
|
28
|
+
c.flag 'comment', desc: 'Text of the comment to edit.'
|
28
29
|
c.flag 'file', desc: 'File containing the comment to edit.'
|
29
30
|
c.flag 'id', desc: 'The comment to edit.'
|
30
|
-
c.flag 'comment', desc: 'Text of the comment to edit.'
|
31
31
|
c.action do |_global_options, options, _args|
|
32
32
|
puts JSON.dump($client.files_comments_edit(options))
|
33
33
|
end
|