|
|
|
@ -35,10 +35,39 @@ def process_command_patchnotes(message, command, adm)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def process_command_check(message, command, adm)
|
|
|
|
|
if is_chat_authorized?(message, @auth_chat) || message_from_admin?(message, adm)
|
|
|
|
|
#begin interactive code
|
|
|
|
|
options = [ ]
|
|
|
|
|
@probes.each do |k,v|
|
|
|
|
|
button_text = v
|
|
|
|
|
options.insert(-1, Telegram::Bot::Types::InlineKeyboardButton.new(text: button_text, callback_data: "#{k}"))
|
|
|
|
|
end
|
|
|
|
|
#end interactive code
|
|
|
|
|
#probe = @probes[0] #set manually for now
|
|
|
|
|
reply = "N/A"
|
|
|
|
|
#hostdata = host_lookup(select_loc)
|
|
|
|
|
#puts "var:".blue+" hostdata".blue.bold+"::".bold + hostdata.to_s
|
|
|
|
|
#if ! hostdata.empty?
|
|
|
|
|
# hostdata.each do |k,v|
|
|
|
|
|
# puts "match:".blue+" host".blue.bold+"::".bold + k.to_s
|
|
|
|
|
# reply += k.to_s+"\n"
|
|
|
|
|
# end
|
|
|
|
|
#else
|
|
|
|
|
# reply = "No matching locations!"
|
|
|
|
|
# puts "hostdata is empty!"
|
|
|
|
|
#end
|
|
|
|
|
puts reply
|
|
|
|
|
else
|
|
|
|
|
reply = "I am not authorized to provide this information here."
|
|
|
|
|
end
|
|
|
|
|
return reply
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def process_command_test(message, command, adm)
|
|
|
|
|
if is_chat_authorized?(message, @auth_chat) || message_from_admin?(message, adm)
|
|
|
|
|
#reply = `scripts/tempf.py`
|
|
|
|
|
#some interactive code to select a probe
|
|
|
|
|
select_loc = "Aisle 12-3"
|
|
|
|
|
select_loc = "Server Room: Intake"
|
|
|
|
|
#end interactive code
|
|
|
|
|
#probe = @probes[0] #set manually for now
|
|
|
|
|
reply = ""
|
|
|
|
@ -59,4 +88,3 @@ def process_command_check(message, command, adm)
|
|
|
|
|
end
|
|
|
|
|
return reply
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|