diff options
author | Yaohan Chen <yaohan.chen@gmail.com> | 2007-10-31 17:35:07 +0000 |
---|---|---|
committer | Yaohan Chen <yaohan.chen@gmail.com> | 2007-10-31 17:35:07 +0000 |
commit | fb9e43097cf0fb0de48bee654663970d2d5ef01c (patch) | |
tree | bb9284df21c59399cb655d4db9ab24c1b2b4d2cc /data/rbot | |
parent | 0098d5bd2b7b85012fc0f4efb8f9ce4e5f277a45 (diff) |
linkbot.rb: ignore colors when matching against message pattern
Diffstat (limited to 'data/rbot')
-rw-r--r-- | data/rbot/plugins/linkbot.rb | 3 |
1 files changed, 2 insertions, 1 deletions
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' |