From 5aa914133c6482c500cf439d65584282212beb6b Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Fri, 4 Aug 2006 00:19:51 +0000 Subject: Fix stupid bug introduced with the new debugging messages. switch to kind_of? instead of .class<= --- lib/rbot/core/auth.rb | 2 +- lib/rbot/core/config.rb | 4 ++-- lib/rbot/core/core.rb | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/rbot/core') diff --git a/lib/rbot/core/auth.rb b/lib/rbot/core/auth.rb index 9a30dc0a..228f76a8 100644 --- a/lib/rbot/core/auth.rb +++ b/lib/rbot/core/auth.rb @@ -85,7 +85,7 @@ class AuthModule < CoreBotModule def auth_set(m, params) cmds, locs, warns = parse_args(params[:args]) - errs = warns.select { |w| w.class <= Exception } + errs = warns.select { |w| w.kind_of?(Exception) } unless errs.empty? m.reply "couldn't satisfy your request: #{errs.join(',')}" return diff --git a/lib/rbot/core/config.rb b/lib/rbot/core/config.rb index 3099a00a..29a0b564 100644 --- a/lib/rbot/core/config.rb +++ b/lib/rbot/core/config.rb @@ -89,7 +89,7 @@ class ConfigModule < CoreBotModule m.reply "no such config key #{key}" return end - unless @bot.config.items[key].class <= BotConfigArrayValue + unless @bot.config.items[key].kind_of?(BotConfigArrayValue) m.reply "config key #{key} is not an array" return end @@ -111,7 +111,7 @@ class ConfigModule < CoreBotModule m.reply "no such config key #{key}" return end - unless @bot.config.items[key].class <= BotConfigArrayValue + unless @bot.config.items[key].kind_of?(BotConfigArrayValue) m.reply "config key #{key} is not an array" return end diff --git a/lib/rbot/core/core.rb b/lib/rbot/core/core.rb index 178675b1..feff7491 100644 --- a/lib/rbot/core/core.rb +++ b/lib/rbot/core/core.rb @@ -5,7 +5,7 @@ class CoreModule < CoreBotModule def listen(m) - return unless m.class <= PrivMessage + return unless m.kind_of?(PrivMessage) if(m.private? && m.message =~ /^\001PING\s+(.+)\001/) @bot.notice m.sourcenick, "\001PING #$1\001" @bot.irclog "@ #{m.sourcenick} pinged me" -- cgit v1.2.3