forked from slack-ruby/slack-ruby-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pins.rb
41 lines (38 loc) · 1.57 KB
/
pins.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# frozen_string_literal: true
# This file was auto-generated by lib/tasks/web.rake
module Slack
module Cli
class App
desc 'Pins methods.'
command 'pins' do |g|
g.desc 'Pins an item to a channel.'
g.long_desc %( Pins an item to a channel. )
g.command 'add' do |c|
c.flag 'channel', desc: 'Channel to pin the messsage to. You must also include a timestamp when pinning messages.'
c.flag 'quip_component_id', desc: 'Component ID for the pins component that was inserted into the channel canvas, if any.'
c.flag 'timestamp', desc: 'Timestamp of the message to pin. You must also include the channel.'
c.action do |_global_options, options, _args|
puts JSON.dump(@client.pins_add(options))
end
end
g.desc 'Lists items pinned to a channel.'
g.long_desc %( Lists items pinned to a channel. )
g.command 'list' do |c|
c.flag 'channel', desc: 'Channel to get pinned items for.'
c.action do |_global_options, options, _args|
puts JSON.dump(@client.pins_list(options))
end
end
g.desc 'Un-pins an item from a channel.'
g.long_desc %( Un-pins an item from a channel. )
g.command 'remove' do |c|
c.flag 'channel', desc: 'Channel where the item is pinned to.'
c.flag 'timestamp', desc: 'Timestamp of the message to un-pin.'
c.action do |_global_options, options, _args|
puts JSON.dump(@client.pins_remove(options))
end
end
end
end
end
end