]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/commitdiff
weather: defaults for missing service
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Sun, 30 Jan 2011 20:58:00 +0000 (21:58 +0100)
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Sun, 30 Jan 2011 20:58:00 +0000 (21:58 +0100)
The refactoring that introduced google removed them erroneously.

data/rbot/plugins/weather.rb

index ab3ec908b1654769f66a65980fc88c3ce214b2c3..8f59a9ba693eea6f98c61a3f42d69fe53f4a29a2 100644 (file)
@@ -110,6 +110,14 @@ class WeatherPlugin < Plugin
       units = reg[2] rescue nil
     end
 
+    if !service
+      if where.sub!(/^station\s+/,'')
+        service = :nws
+      else
+        service = :wu
+      end
+    end
+
     if where.empty?
       debug "No weather location found for #{m.sourcenick}"
       m.reply "I don't know where you are yet, #{m.sourcenick}. See 'help weather nws' or 'help weather wu' for additional help"