Module: Slack::Web::Api::Mixins::Channels

Includes:
Ids
Included in:
Endpoints
Defined in:
lib/slack/web/api/mixins/channels.id.rb

Instance Method Summary collapse

Instance Method Details

#channels_id(options = {}) ⇒ Object

This method returns a channel ID given a channel name.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :channel (channel)

    Channel to get ID for, prefixed with #.



15
16
17
18
19
20
21
22
# File 'lib/slack/web/api/mixins/channels.id.rb', line 15

def channels_id(options = {})
  name = options[:channel]
  throw ArgumentError.new('Required arguments :channel missing') if name.nil?

  id_for(:channel, name, '#', :channels, 'channel_not_found') do
    channels_list
  end
end