Module: SlackClient

Included in:
SlackMessage, SlackSearch
Defined in:
lib/modules/slack_client.rb

Overview

Client initialization that powers the rest of interactions

Instance Method Summary collapse

Instance Method Details

#configure_client(type = 'web', token = ENV['SLACK_TOKEN']) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/modules/slack_client.rb', line 7

def configure_client(type = 'web', token = ENV['SLACK_TOKEN'])
  Slack.configure do |config|
    config.token = token
    config.raise 'Missing Bot token 2' unless config.token
  end

  case type
  when 'realtime'
    @configure_client = Slack::RealTime::Client.new
  when 'web'
    @configure_client = Slack::Web::Client.new
  end
end