Skip to content

Commit 624b34e

Browse files
committed
rake slack:api:update
1 parent 36ef935 commit 624b34e

File tree

11 files changed

+0
-1257
lines changed

11 files changed

+0
-1257
lines changed

bin/commands/channels.rb

Lines changed: 0 additions & 157 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,6 @@
33

44
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."
55
command 'channels' do |g|
6-
g.desc 'Archives a channel.'
7-
g.long_desc %( Archives a channel. )
8-
g.command 'archive' do |c|
9-
c.flag 'channel', desc: 'Channel to archive.'
10-
c.action do |_global_options, options, _args|
11-
puts JSON.dump($client.channels_archive(options))
12-
end
13-
end
14-
15-
g.desc 'Creates a channel.'
16-
g.long_desc %( Creates a channel. )
17-
g.command 'create' do |c|
18-
c.flag 'name', desc: 'Name of channel to create.'
19-
c.flag 'team_id', desc: 'encoded team id to create the channel in, required if org token is used.'
20-
c.flag 'validate', desc: 'Whether to return errors on invalid channel name instead of modifying it to meet the specified criteria.'
21-
c.action do |_global_options, options, _args|
22-
puts JSON.dump($client.channels_create(options))
23-
end
24-
end
25-
266
g.desc 'Delete a channel (undocumented)'
277
g.long_desc %( Delete a channel )
288
g.command 'delete' do |c|
@@ -32,19 +12,6 @@
3212
end
3313
end
3414

35-
g.desc 'Fetches history of messages and events from a channel.'
36-
g.long_desc %( Fetches history of messages and events from a channel. )
37-
g.command 'history' do |c|
38-
c.flag 'channel', desc: 'Channel to fetch history for.'
39-
c.flag 'inclusive', desc: 'Include messages with latest or oldest timestamp in results.'
40-
c.flag 'latest', desc: 'End of time range of messages to include in results.'
41-
c.flag 'oldest', desc: 'Start of time range of messages to include in results.'
42-
c.flag 'unreads', desc: 'Include unread_count_display in the output?.'
43-
c.action do |_global_options, options, _args|
44-
puts JSON.dump($client.channels_history(options))
45-
end
46-
end
47-
4815
g.desc 'This method returns the ID of a team channel.'
4916
g.long_desc %( This method returns the ID of a team channel. )
5017
g.command 'id' do |c|
@@ -53,128 +20,4 @@
5320
puts JSON.dump($client.channels_id(options))
5421
end
5522
end
56-
57-
g.desc 'Gets information about a channel.'
58-
g.long_desc %( Gets information about a channel. )
59-
g.command 'info' do |c|
60-
c.flag 'channel', desc: 'Channel to get info on.'
61-
c.flag 'include_locale', desc: 'Set this to true to receive the locale for this channel. Defaults to false.'
62-
c.action do |_global_options, options, _args|
63-
puts JSON.dump($client.channels_info(options))
64-
end
65-
end
66-
67-
g.desc 'Invites a user to a channel.'
68-
g.long_desc %( Invites a user to a channel. )
69-
g.command 'invite' do |c|
70-
c.flag 'channel', desc: 'Channel to invite user to.'
71-
c.flag 'user', desc: 'User to invite to channel.'
72-
c.action do |_global_options, options, _args|
73-
puts JSON.dump($client.channels_invite(options))
74-
end
75-
end
76-
77-
g.desc 'Joins a channel, creating it if needed.'
78-
g.long_desc %( Joins a channel, creating it if needed. )
79-
g.command 'join' do |c|
80-
c.flag 'name', desc: 'Name of channel to join.'
81-
c.flag 'team_id', desc: 'encoded team id to list channels in, required if org token is used.'
82-
c.flag 'validate', desc: 'Whether to return errors on invalid channel name instead of modifying it to meet the specified criteria.'
83-
c.action do |_global_options, options, _args|
84-
puts JSON.dump($client.channels_join(options))
85-
end
86-
end
87-
88-
g.desc 'Removes a user from a channel.'
89-
g.long_desc %( Removes a user from a channel. )
90-
g.command 'kick' do |c|
91-
c.flag 'channel', desc: 'Channel to remove user from.'
92-
c.flag 'user', desc: 'User to remove from channel.'
93-
c.action do |_global_options, options, _args|
94-
puts JSON.dump($client.channels_kick(options))
95-
end
96-
end
97-
98-
g.desc 'Leaves a channel.'
99-
g.long_desc %( Leaves a channel. )
100-
g.command 'leave' do |c|
101-
c.flag 'channel', desc: 'Channel to leave.'
102-
c.action do |_global_options, options, _args|
103-
puts JSON.dump($client.channels_leave(options))
104-
end
105-
end
106-
107-
g.desc 'Lists all channels in a Slack team.'
108-
g.long_desc %( Lists all channels in a Slack team. )
109-
g.command 'list' do |c|
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 'exclude_archived', desc: 'Exclude archived channels from the list.'
112-
c.flag 'exclude_members', desc: 'Exclude the members collection from each channel.'
113-
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."
114-
c.flag 'team_id', desc: 'encoded team id to list channels in, required if org token is used.'
115-
c.action do |_global_options, options, _args|
116-
puts JSON.dump($client.channels_list(options))
117-
end
118-
end
119-
120-
g.desc 'Sets the read cursor in a channel.'
121-
g.long_desc %( Sets the read cursor in a channel. )
122-
g.command 'mark' do |c|
123-
c.flag 'channel', desc: 'Channel or conversation to set the read cursor for.'
124-
c.flag 'ts', desc: 'Unique identifier of message you want marked as most recently seen in this conversation.'
125-
c.action do |_global_options, options, _args|
126-
puts JSON.dump($client.channels_mark(options))
127-
end
128-
end
129-
130-
g.desc 'Renames a channel.'
131-
g.long_desc %( Renames a channel. )
132-
g.command 'rename' do |c|
133-
c.flag 'channel', desc: 'Channel to rename.'
134-
c.flag 'name', desc: 'New name for channel.'
135-
c.flag 'validate', desc: 'Whether to return errors on invalid channel name instead of modifying it to meet the specified criteria.'
136-
c.action do |_global_options, options, _args|
137-
puts JSON.dump($client.channels_rename(options))
138-
end
139-
end
140-
141-
g.desc 'Retrieve a thread of messages posted to a channel'
142-
g.long_desc %( Retrieve a thread of messages posted to a channel )
143-
g.command 'replies' do |c|
144-
c.flag 'channel', desc: 'Channel to fetch thread from.'
145-
c.flag 'thread_ts', desc: "Unique identifier of a thread's parent message."
146-
c.action do |_global_options, options, _args|
147-
puts JSON.dump($client.channels_replies(options))
148-
end
149-
end
150-
151-
g.desc 'Sets the purpose for a channel.'
152-
g.long_desc %( Sets the purpose for a channel. )
153-
g.command 'setPurpose' do |c|
154-
c.flag 'channel', desc: 'Channel to set the purpose of.'
155-
c.flag 'purpose', desc: 'The new purpose.'
156-
c.flag 'name_tagging', desc: 'if it is true, treat this like a message and not an unescaped thing.'
157-
c.action do |_global_options, options, _args|
158-
puts JSON.dump($client.channels_setPurpose(options))
159-
end
160-
end
161-
162-
g.desc 'Sets the topic for a channel.'
163-
g.long_desc %( Sets the topic for a channel. )
164-
g.command 'setTopic' do |c|
165-
c.flag 'channel', desc: 'Channel to set the topic of.'
166-
c.flag 'topic', desc: 'The new topic.'
167-
c.action do |_global_options, options, _args|
168-
puts JSON.dump($client.channels_setTopic(options))
169-
end
170-
end
171-
172-
g.desc 'Unarchives a channel.'
173-
g.long_desc %( Unarchives a channel. )
174-
g.command 'unarchive' do |c|
175-
c.flag 'channel', desc: 'Channel to unarchive.'
176-
c.action do |_global_options, options, _args|
177-
puts JSON.dump($client.channels_unarchive(options))
178-
end
179-
end
18023
end

bin/commands/groups.rb

Lines changed: 0 additions & 163 deletions
Original file line numberDiff line numberDiff line change
@@ -3,48 +3,6 @@
33

44
desc "Get info on your team's private channels."
55
command 'groups' do |g|
6-
g.desc 'Archives a private channel.'
7-
g.long_desc %( Archives a private channel. )
8-
g.command 'archive' do |c|
9-
c.flag 'channel', desc: 'Private channel to archive.'
10-
c.action do |_global_options, options, _args|
11-
puts JSON.dump($client.groups_archive(options))
12-
end
13-
end
14-
15-
g.desc 'Creates a private channel.'
16-
g.long_desc %( Creates a private channel. )
17-
g.command 'create' do |c|
18-
c.flag 'name', desc: 'Name of private channel to create.'
19-
c.flag 'team_id', desc: 'encoded team id to create the channel in, required if org token is used.'
20-
c.flag 'validate', desc: 'Whether to return errors on invalid channel name instead of modifying it to meet the specified criteria.'
21-
c.action do |_global_options, options, _args|
22-
puts JSON.dump($client.groups_create(options))
23-
end
24-
end
25-
26-
g.desc 'Clones and archives a private channel.'
27-
g.long_desc %( Clones and archives a private channel. )
28-
g.command 'createChild' do |c|
29-
c.flag 'channel', desc: 'Private channel to clone and archive.'
30-
c.action do |_global_options, options, _args|
31-
puts JSON.dump($client.groups_createChild(options))
32-
end
33-
end
34-
35-
g.desc 'Fetches history of messages and events from a private channel.'
36-
g.long_desc %( Fetches history of messages and events from a private channel. )
37-
g.command 'history' do |c|
38-
c.flag 'channel', desc: 'Private channel to fetch history for.'
39-
c.flag 'inclusive', desc: 'Include messages with latest or oldest timestamp in results.'
40-
c.flag 'latest', desc: 'End of time range of messages to include in results.'
41-
c.flag 'oldest', desc: 'Start of time range of messages to include in results.'
42-
c.flag 'unreads', desc: 'Include unread_count_display in the output?.'
43-
c.action do |_global_options, options, _args|
44-
puts JSON.dump($client.groups_history(options))
45-
end
46-
end
47-
486
g.desc 'This method returns the ID of a group.'
497
g.long_desc %( This method returns the ID of a group. )
508
g.command 'id' do |c|
@@ -53,125 +11,4 @@
5311
puts JSON.dump($client.groups_id(options))
5412
end
5513
end
56-
57-
g.desc 'Gets information about a private channel.'
58-
g.long_desc %( Gets information about a private channel. )
59-
g.command 'info' do |c|
60-
c.flag 'channel', desc: 'Private channel to get info on.'
61-
c.flag 'include_locale', desc: 'Set this to true to receive the locale for this group. Defaults to false.'
62-
c.action do |_global_options, options, _args|
63-
puts JSON.dump($client.groups_info(options))
64-
end
65-
end
66-
67-
g.desc 'Invites a user to a private channel.'
68-
g.long_desc %( Invites a user to a private channel. )
69-
g.command 'invite' do |c|
70-
c.flag 'channel', desc: 'Private channel to invite user to.'
71-
c.flag 'user', desc: 'User to invite.'
72-
c.action do |_global_options, options, _args|
73-
puts JSON.dump($client.groups_invite(options))
74-
end
75-
end
76-
77-
g.desc 'Removes a user from a private channel.'
78-
g.long_desc %( Removes a user from a private channel. )
79-
g.command 'kick' do |c|
80-
c.flag 'channel', desc: 'Private channel to remove user from.'
81-
c.flag 'user', desc: 'User to remove from private channel.'
82-
c.action do |_global_options, options, _args|
83-
puts JSON.dump($client.groups_kick(options))
84-
end
85-
end
86-
87-
g.desc 'Leaves a private channel.'
88-
g.long_desc %( Leaves a private channel. )
89-
g.command 'leave' do |c|
90-
c.flag 'channel', desc: 'Private channel to leave.'
91-
c.action do |_global_options, options, _args|
92-
puts JSON.dump($client.groups_leave(options))
93-
end
94-
end
95-
96-
g.desc 'Lists private channels that the calling user has access to.'
97-
g.long_desc %( Lists private channels that the calling user has access to. )
98-
g.command 'list' do |c|
99-
c.flag 'cursor', desc: "Parameter for pagination. Set cursor equal to the next_cursor attribute returned by the previous request's response_metadata. This parameter is optional, but pagination is mandatory: the default value simply fetches the first 'page' of the collection. See pagination for more details."
100-
c.flag 'exclude_archived', desc: "Don't return archived private channels."
101-
c.flag 'exclude_members', desc: 'Exclude the members from each group.'
102-
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."
103-
c.flag 'team_id', desc: 'encoded team id to list channels in, required if org token is used.'
104-
c.action do |_global_options, options, _args|
105-
puts JSON.dump($client.groups_list(options))
106-
end
107-
end
108-
109-
g.desc 'Sets the read cursor in a private channel.'
110-
g.long_desc %( Sets the read cursor in a private channel. )
111-
g.command 'mark' do |c|
112-
c.flag 'channel', desc: 'Channel or conversation to set the read cursor for.'
113-
c.flag 'ts', desc: 'Unique identifier of message you want marked as most recently seen in this conversation.'
114-
c.action do |_global_options, options, _args|
115-
puts JSON.dump($client.groups_mark(options))
116-
end
117-
end
118-
119-
g.desc 'Opens a private channel.'
120-
g.long_desc %( Opens a private channel. )
121-
g.command 'open' do |c|
122-
c.flag 'channel', desc: 'Private channel to open.'
123-
c.action do |_global_options, options, _args|
124-
puts JSON.dump($client.groups_open(options))
125-
end
126-
end
127-
128-
g.desc 'Renames a private channel.'
129-
g.long_desc %( Renames a private channel. )
130-
g.command 'rename' do |c|
131-
c.flag 'channel', desc: 'Private channel to rename.'
132-
c.flag 'name', desc: 'New name for private channel.'
133-
c.flag 'validate', desc: 'Whether to return errors on invalid channel name instead of modifying it to meet the specified criteria.'
134-
c.action do |_global_options, options, _args|
135-
puts JSON.dump($client.groups_rename(options))
136-
end
137-
end
138-
139-
g.desc 'Retrieve a thread of messages posted to a private channel'
140-
g.long_desc %( Retrieve a thread of messages posted to a private channel )
141-
g.command 'replies' do |c|
142-
c.flag 'channel', desc: 'Private channel to fetch thread from.'
143-
c.flag 'thread_ts', desc: "Unique identifier of a thread's parent message."
144-
c.action do |_global_options, options, _args|
145-
puts JSON.dump($client.groups_replies(options))
146-
end
147-
end
148-
149-
g.desc 'Sets the purpose for a private channel.'
150-
g.long_desc %( Sets the purpose for a private channel. )
151-
g.command 'setPurpose' do |c|
152-
c.flag 'channel', desc: 'Private channel to set the purpose of.'
153-
c.flag 'purpose', desc: 'The new purpose.'
154-
c.action do |_global_options, options, _args|
155-
puts JSON.dump($client.groups_setPurpose(options))
156-
end
157-
end
158-
159-
g.desc 'Sets the topic for a private channel.'
160-
g.long_desc %( Sets the topic for a private channel. )
161-
g.command 'setTopic' do |c|
162-
c.flag 'channel', desc: 'Private channel to set the topic of.'
163-
c.flag 'topic', desc: 'The new topic.'
164-
c.action do |_global_options, options, _args|
165-
puts JSON.dump($client.groups_setTopic(options))
166-
end
167-
end
168-
169-
g.desc 'Unarchives a private channel.'
170-
g.long_desc %( Unarchives a private channel. )
171-
g.command 'unarchive' do |c|
172-
c.flag 'channel', desc: 'Private channel to unarchive.'
173-
c.action do |_global_options, options, _args|
174-
puts JSON.dump($client.groups_unarchive(options))
175-
end
176-
end
17714
end

0 commit comments

Comments
 (0)