Module: SlackRealTime
- Includes:
- DirectiveLookup, SlackConsole
- Included in:
- EnerbotSlack
- Defined in:
- lib/modules/slack_realtime.rb
Overview
Module for reading chat incoming messages
Instance Method Summary collapse
Methods included from SlackConsole
Methods included from SlackSearch
#conversation_info, #conversation_list, #conversation_members, #conversation_type, #get_user_id, #get_user_info, #get_user_list, #search_messages_on, #verify_type
Methods included from SlackClient
Instance Method Details
#share_message(data, output) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/modules/slack_realtime.rb', line 10 def (data, output) case output when 'slack' check_type(data) when 'console' (data) else (data) check_type(data) end end |
#single_client(output = ENV['SLACK_DEFAULT_OUTPUT']) ⇒ Object
22 23 24 25 26 27 28 29 30 31 |
# File 'lib/modules/slack_realtime.rb', line 22 def single_client(output = ENV['SLACK_DEFAULT_OUTPUT']) @time_client.on :hello do puts("Connected to '#{@time_client.team.name}' team at https://#{@time_client.team.domain}.slack.com.") end @time_client.on :message do |data| (data, output) end @time_client.start! end |