Skip to content

Commit

Permalink
Tweaking nearest storm display to be near-nearer-nearest aware.
Browse files Browse the repository at this point in the history
  • Loading branch information
onewheelskyward committed Dec 16, 2015
1 parent 69c7a57 commit 60231c0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/lita/handlers/irc_handlers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,12 @@ def handle_irc_neareststorm(response)
forecast = get_forecast_io_results(response.user, location)
nearest_storm_distance, nearest_storm_bearing = do_the_nearest_storm_thing(forecast)

response.reply "The nearest storm is #{get_distance(nearest_storm_distance, get_scale(response.user))} to the #{get_cardinal_direction_from_bearing(nearest_storm_bearing)} of you."
if nearest_storm_distance == 0
response.reply "You're in it!"
else
response.reply "The nearest storm is #{get_distance(nearest_storm_distance, get_scale(response.user))} to the #{get_cardinal_direction_from_bearing(nearest_storm_bearing)} of you."
end

end
end
end

0 comments on commit 60231c0

Please sign in to comment.