module Slack::Web::Api::Endpoints::Pins

Public Instance Methods

pins_add(options = {}) click to toggle source

Pins an item to a channel.

@option options [channel] :channel

Channel to pin the item in.

@option options [Object] :timestamp

Timestamp of the message to pin.

@see api.slack.com/methods/pins.add @see github.com/slack-ruby/slack-api-ref/blob/master/methods/pins/pins.add.json

# File lib/slack/web/api/endpoints/pins.rb, line 18
def pins_add(options = {})
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
  options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
  post('pins.add', options)
end
pins_list(options = {}) click to toggle source

Lists items pinned to a channel.

@option options [channel] :channel

Channel to get pinned items for.

@see api.slack.com/methods/pins.list @see github.com/slack-ruby/slack-api-ref/blob/master/methods/pins/pins.list.json

# File lib/slack/web/api/endpoints/pins.rb, line 31
def pins_list(options = {})
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
  options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
  post('pins.list', options)
end
pins_remove(options = {}) click to toggle source

Un-pins an item from a channel.

@option options [channel] :channel

Channel where the item is pinned to.

@option options [Object] :timestamp

Timestamp of the message to un-pin.

@see api.slack.com/methods/pins.remove @see github.com/slack-ruby/slack-api-ref/blob/master/methods/pins/pins.remove.json

# File lib/slack/web/api/endpoints/pins.rb, line 46
def pins_remove(options = {})
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
  options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
  post('pins.remove', options)
end