module Slack::Endpoint::Pins

Public Instance Methods

pins_add(options={}) click to toggle source

This method pins an item (file, file comment, channel message, or group message) to a particular channel. The channel argument is required and one of file, file_comment, or timestamp must also be specified.

@option options [Object] :channel

Channel to pin the item in.

@option options [Object] :file

File to pin.

@option options [Object] :file_comment

File comment to pin.

@option options [Object] :timestamp

Timestamp of the message to pin.

@see api.slack.com/methods/pins.add @see github.com/aki017/slack-api-docs/blob/master/methods/pins.add.md @see github.com/aki017/slack-api-docs/blob/master/methods/pins.add.json

# File lib/slack/endpoint/pins.rb, line 21
def pins_add(options={})
  throw ArgumentError.new("Required arguments :channel missing") if options[:channel].nil?
  options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
  post("pins.add", options)
end
pins_list(options={}) click to toggle source

This method lists the items pinned to a channel.

@option options [Object] :channel

Channel to get pinned items for.

@see api.slack.com/methods/pins.list @see github.com/aki017/slack-api-docs/blob/master/methods/pins.list.md @see github.com/aki017/slack-api-docs/blob/master/methods/pins.list.json

# File lib/slack/endpoint/pins.rb, line 35
def pins_list(options={})
  throw ArgumentError.new("Required arguments :channel missing") if options[:channel].nil?
  options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
  post("pins.list", options)
end
pins_remove(options={}) click to toggle source

This method un-pins an item (file, file comment, channel message, or group message) from a channel. The channel argument is required and one of file, file_comment, or timestamp must also be specified.

@option options [Object] :channel

Channel where the item is pinned to.

@option options [Object] :file

File to un-pin.

@option options [Object] :file_comment

File comment to un-pin.

@option options [Object] :timestamp

Timestamp of the message to un-pin.

@see api.slack.com/methods/pins.remove @see github.com/aki017/slack-api-docs/blob/master/methods/pins.remove.md @see github.com/aki017/slack-api-docs/blob/master/methods/pins.remove.json

# File lib/slack/endpoint/pins.rb, line 56
def pins_remove(options={})
  throw ArgumentError.new("Required arguments :channel missing") if options[:channel].nil?
  options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
  post("pins.remove", options)
end