Module: Slack::Web::Pins

Defined in:
lib/slack/web/pins.rb

Overview

Module for the pins methods.

Constant Summary collapse

SCOPE =

Endpoint scope

'pins'

Instance Method Summary collapse

Instance Method Details

#pins_add(params = {}) ⇒ Object

This method pins an item (file, file comment, channel message, or group message) to a particular channel.

Parameters:

  • params (Hash) (defaults to: {})

    API call arguments

Options Hash (params):

  • 'channel' (Object)

    Channel to pin the item in.

  • 'file' (Object)

    File to pin.

  • 'file_comment' (Object)

    File comment to pin.

  • 'timestamp' (Object)

    Timestamp of the message to pin.

See Also:



23
24
25
26
27
# File 'lib/slack/web/pins.rb', line 23

def pins_add(params = {})
  fail ArgumentError, "Required arguments 'channel' missing" if params['channel'].nil?
  response = @session.do_post "#{SCOPE}.add", params
  Slack.parse_response(response)
end

#pins_list(params = {}) ⇒ Object

This method lists the items pinned to a channel.

Parameters:

  • params (Hash) (defaults to: {})

    API call arguments

Options Hash (params):

  • 'channel' (Object)

    Channel to get pinned items for.

See Also:



37
38
39
40
41
# File 'lib/slack/web/pins.rb', line 37

def pins_list(params = {})
  fail ArgumentError, "Required arguments 'channel' missing" if params['channel'].nil?
  response = @session.do_post "#{SCOPE}.list", params
  Slack.parse_response(response)
end

#pins_remove(params = {}) ⇒ Object

This method un-pins an item (file, file comment, channel message, or group message) from a channel.

Parameters:

  • params (Hash) (defaults to: {})

    API call arguments

Options Hash (params):

  • 'channel' (Object)

    Channel to pin the item in.

  • 'file' (Object)

    File to pin.

  • 'file_comment' (Object)

    File comment to pin.

  • 'timestamp' (Object)

    Timestamp of the message to pin.

See Also:



58
59
60
61
62
# File 'lib/slack/web/pins.rb', line 58

def pins_remove(params = {})
  fail ArgumentError, "Required arguments 'channel' missing" if params['channel'].nil?
  response = @session.do_post "#{SCOPE}.remove", params
  Slack.parse_response(response)
end