From f6a26a41095dc936fc2a944f7b726cd31011e878 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Thu, 29 Jul 2010 14:20:48 +0200 Subject: hangman: ensure 'hangman define' always answers --- data/rbot/plugins/games/hangman.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'data/rbot/plugins/games/hangman.rb') 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 -- cgit v1.2.3