class SlackSmartBot
def see_result_routine(dest, from, name)
save_stats(__method__)
if is_admin?
if @routines.key?(@channel_id) and @routines[@channel_id].key?(name)
if File.exist?("#{config.path}/routines/#{@channel_id}/#{name}_output.txt")
msg = "*Results from routine run #{File.mtime("#{config.path}/routines/#{@channel_id}/#{name}_output.txt")}*\n"
msg += File.read("#{config.path}/routines/#{@channel_id}/#{name}_output.txt")
respond msg, dest
else
respond "The routine *`#{name}`* doesn't have any result yet.", dest
end
else
respond "There isn't a routine with that name: *`#{name}`*.\nCall `see routines` to see added routines", dest
end
else
respond "Only admin users can see the routines results", dest
end
end
end