class SlackbotFrd::SlackMethods::ChannelsInfo

Attributes

response[R]

Public Class Methods

members(token:, channel:) click to toggle source
# File lib/slackbot_frd/slack_methods/channels_info.rb, line 12
def self.members(token:, channel:)
  ChannelsInfo.new(token: token, channel: channel).connect.members
end
new(token:, channel:) click to toggle source
# File lib/slackbot_frd/slack_methods/channels_info.rb, line 16
def initialize(token:, channel:)
  @token = token
  @channel = channel
end

Public Instance Methods

connect() click to toggle source
# File lib/slackbot_frd/slack_methods/channels_info.rb, line 21
def connect
  @response = JSON.parse(self.class.post('', :body => { token: @token, channel: @channel } ).body)
  ValidateSlack.response(@response)
  self
end
members() click to toggle source
# File lib/slackbot_frd/slack_methods/channels_info.rb, line 27
def members
  if @response['channel']
    @response['channel']['members']
  else
    []
  end
end
Also aliased as: users
users()
Alias for: members