summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2010-07-29 14:20:48 +0200
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2010-07-29 14:20:48 +0200
commitf6a26a41095dc936fc2a944f7b726cd31011e878 (patch)
tree8fabb31819feb06ff5709c0dfc016b3971e5a178 /data
parent674a5d2fff78cc3771d1a1504441b82e8322e13b (diff)
hangman: ensure 'hangman define' always answers
Diffstat (limited to 'data')
-rw-r--r--data/rbot/plugins/games/hangman.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/data/rbot/plugins/games/hangman.rb b/data/rbot/plugins/games/hangman.rb
index 5cef596e..d3c4d20a 100644
--- a/data/rbot/plugins/games/hangman.rb
+++ b/data/rbot/plugins/games/hangman.rb
@@ -479,8 +479,13 @@ class HangmanPlugin < Plugin
def define(m, params)
if game = @games.previous(m.replyto)
- return unless res = Google.define(game.word)
- m.reply "#{Bold}#{game.word}#{Bold} -- #{res}"
+ if res = Google.define(game.word)
+ m.reply "#{Bold}#{game.word}#{Bold} -- #{res}"
+ else
+ m.reply _("looks like google has no definition for %{word}") % { :word => game.word }
+ end
+ else
+ m.reply _("no hangman game was played here recently, what do you want me to define?")
end
end
end