]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/commitdiff
imdb plugin: say something when nothing was found
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Sat, 7 Apr 2007 13:04:47 +0000 (13:04 +0000)
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Sat, 7 Apr 2007 13:04:47 +0000 (13:04 +0000)
data/rbot/plugins/imdb.rb

index c23cd8d663fc88b89f623bfc32e3e2914d2626a3..b1f566c6a4c51465b8ccd6ae0a491c483e4fb185 100644 (file)
@@ -416,12 +416,16 @@ class ImdbPlugin < Plugin
 
     movie_urls = i.search(movie, :type => :title)
     unless movie_urls
-      m.reply "nothing found about #{hwo}, sorry"
+      m.reply "nothing found about #{who}, sorry"
       return
     end
 
     info = i.name_in_movie(name_urls, movie_urls)
-    m.reply info.join("\n")
+    if info.empty?
+      m.reply "nothing found about #{who} in #{movie}, sorry"
+    else
+      m.reply info.join("\n")
+    end
   end
 
 end