lib/ruboty/rainfall_jp.rb in ruboty-rainfall_jp-1.1.0 vs lib/ruboty/rainfall_jp.rb in ruboty-rainfall_jp-1.2.0
- old
+ new
@@ -7,11 +7,11 @@
class RainfallJp < Base
YAHOO_JAPAN_APP_ID = ENV['YAHOO_JAPAN_APP_ID']
DEFAULT_LOCATION = 'Ebisu'
on(
- /Tell rainfall(?: (?:at|in) (?<query>.+))?/i,
+ /Tell (:?me )?rainfall(?: (?:at|in) (?<query>.+))?\z/i,
name: 'rainfall_jp',
description: 'show rainfall forecast'
)
def rainfall_jp(message)
@@ -27,10 +27,10 @@
message.reply("Location '#{query}' is not found.")
return
end
result = fetch_rainfall(geometry)
- message.reply("Rainfall forecast: #{query} (#{geometry})")
+ message.reply("Rainfall forecast: #{query} (l/l: #{geometry})")
message.reply(result)
rescue Exception => e
message.reply('ಠ_ಠ')
message.reply(e)
message.reply(e.backtrace)