Changeset f6a26a41095dc936fc2a944f7b726cd31011e878

Show
Ignore:
Timestamp:
07/29/10 16:20:48 (6 weeks ago)
Author:
Giuseppe Bilotta <giuseppe.bilotta@…>
Children:
bdaf120460c0d0b6be3a037beebf3bc05d8746fe
Parents:
674a5d2fff78cc3771d1a1504441b82e8322e13b
git-committer:
Giuseppe Bilotta <giuseppe.bilotta@gmail.com> 1280406048 +0200
Message:

hangman: ensure 'hangman define' always answers

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • data/rbot/plugins/games/hangman.rb

    rac4c4b7 rf6a26a4  
    480480  def define(m, params) 
    481481    if game = @games.previous(m.replyto) 
    482       return unless res = Google.define(game.word) 
    483       m.reply "#{Bold}#{game.word}#{Bold} -- #{res}" 
     482      if res = Google.define(game.word) 
     483        m.reply "#{Bold}#{game.word}#{Bold} -- #{res}" 
     484      else 
     485        m.reply _("looks like google has no definition for %{word}") % { :word => game.word } 
     486      end 
     487    else 
     488      m.reply _("no hangman game was played here recently, what do you want me to define?") 
    484489    end 
    485490  end