|
3 | 3 |
|
4 | 4 | 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." |
5 | 5 | 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 | | - |
26 | 6 | g.desc 'Delete a channel (undocumented)' |
27 | 7 | g.long_desc %( Delete a channel ) |
28 | 8 | g.command 'delete' do |c| |
|
32 | 12 | end |
33 | 13 | end |
34 | 14 |
|
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 | | - |
48 | 15 | g.desc 'This method returns the ID of a team channel.' |
49 | 16 | g.long_desc %( This method returns the ID of a team channel. ) |
50 | 17 | g.command 'id' do |c| |
|
53 | 20 | puts JSON.dump($client.channels_id(options)) |
54 | 21 | end |
55 | 22 | 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 |
180 | 23 | end |
0 commit comments