From fb9e43097cf0fb0de48bee654663970d2d5ef01c Mon Sep 17 00:00:00 2001 From: Yaohan Chen Date: Wed, 31 Oct 2007 17:35:07 +0000 Subject: [PATCH] linkbot.rb: ignore colors when matching against message pattern --- data/rbot/plugins/linkbot.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/data/rbot/plugins/linkbot.rb b/data/rbot/plugins/linkbot.rb index 3c2f42b7..6a5cafbc 100644 --- a/data/rbot/plugins/linkbot.rb +++ b/data/rbot/plugins/linkbot.rb @@ -48,7 +48,8 @@ class LinkBot < Plugin return unless m.kind_of?(PrivMessage) # Now we know that _m_ is a PRIVMSG from a linkbot. Let's split it # in nick, network, message - if @message_patterns.any? {|p| m.message.match p} + message = BasicUserMessage.stripcolour m.message + if @message_patterns.any? {|p| message =~ p} # if the regexp doesn't contain all parts, the default values get used new_nick = $1 || 'unknown_nick' network = $2 || 'unknown_network' -- 2.39.2