]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/commitdiff
hangman: fix playing with a private message
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Tue, 3 Aug 2010 14:56:56 +0000 (16:56 +0200)
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Tue, 3 Aug 2010 14:56:56 +0000 (16:56 +0200)
The target was being of the wrong class (String vs Irc::Channel),
busting all the hash lookups.

data/rbot/plugins/games/hangman.rb

index b7db886e1402819e873a50441f7e8796dbc39561..7cfd9e69759bf29de309112356899d7b6f2e655e 100644 (file)
@@ -303,11 +303,11 @@ class HangmanPlugin < Plugin
       target = if m.public?
         m.channel
       else
-        params[:channel]
+        @bot.server.channel(params[:channel])
       end
 
       # is the bot on the channel?
-      unless @bot.server.channels.names.include?(target.to_s)
+      unless @bot.myself.channels.include?(target)
         m.reply _("i'm not on that channel")
         return
       end