Module: ReadSlack

Includes:
ConsoleSlack, DirectiveLookup
Included in:
BaezSlack
Defined in:
lib/modules/read_slack.rb

Overview

Module for reading chat incoming messages

Instance Method Summary collapse

Methods included from ConsoleSlack

#format_new_message

Methods included from SearchOnSlack

#conversation_info, #conversation_list, #conversation_type, #get_user_id, #get_user_info, #get_user_list, #search_messages_on, #verify_type

Instance Method Details

#share_message(data, output) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/modules/read_slack.rb', line 10

def share_message(data, output)
  case output
  when 'slack'
    check_type(data)
  when 'console'
    format_new_message(data)
  else
    format_new_message(data)
    check_type(data)
  end
end

#single_client(output = ENV['SLACK_DEFAULT_OUTPUT']) ⇒ Object



22
23
24
25
26
27
# File 'lib/modules/read_slack.rb', line 22

def single_client(output = ENV['SLACK_DEFAULT_OUTPUT'])
  @time_client.on :message do |data|
    share_message(data, output)
  end
  @time_client.start!
end