public
Description: An extensible bot for the Campfire web-based chat system #crc
Homepage:
Clone URL: git://github.com/timriley/campfire-bot.git
fix bug where the bot would crash on receiving a line with a single exclamation 
mark on it
timriley (author)
Thu Oct 23 05:27:19 -0700 2008
commit  4d506641439787029e9b650f917d1826092d6e6c
tree    92d81ee790e569da05b56d1f8f9f38e23ec7dfc4
parent  f202b296063058c3e74dffa30daeba47ea42e02d
...
39
40
41
42
 
43
44
45
...
39
40
41
 
42
43
44
45
0
@@ -39,7 +39,7 @@ class CommandHandler < EventHandler
0
       msg[:message][0..0] == '!' || 
0
       msg[:message]       =~ Regexp.new("^#{Bot.instance.config['nickname']},", Regexp::IGNORECASE)
0
     ) &&
0
-    msg[:message].gsub(/^!/, '').gsub(Regexp.new("#{Bot.instance.config['nickname']},\\s*", Regexp::IGNORECASE), '').split(' ')[0].downcase == @matcher.downcase
0
+    msg[:message].gsub(/^!/, '').gsub(Regexp.new("#{Bot.instance.config['nickname']},\\s*", Regexp::IGNORECASE), '').split(' ')[0].to_s.downcase == @matcher.downcase
0
     # FIXME - the above should be just done with one regexp to pull out the first non-! non-<bot name> word.
0
   end
0
   

Comments