Method: Slack::Web::Api::Endpoints::Conversations#conversations_list

Defined in:
lib/slack/web/api/endpoints/conversations.rb

#conversations_list(options = {}) ⇒ Object

Lists all channels in a Slack team.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :cursor (Object)

    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.

  • :exclude_archived (Object)

    Set to true to exclude archived channels from the list.

  • :limit (Object)

    The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the list hasn’t been reached. Must be an integer no larger than 1000.

  • :team_id (Object)

    encoded team id to list channels in, required if token belongs to org-wide app.

  • :types (Object)

    Mix and match channel types by providing a comma-separated list of any combination of public_channel, private_channel, mpim, im.

See Also:



171
172
173
174
175
176
177
178
179
# File 'lib/slack/web/api/endpoints/conversations.rb', line 171

def conversations_list(options = {})
  if block_given?
    Pagination::Cursor.new(self, :conversations_list, options).each do |page|
      yield page
    end
  else
    post('conversations.list', options)
  end
end