From: Giuseppe Bilotta Date: Thu, 1 Nov 2007 00:30:16 +0000 (+0000) Subject: reaction plugin: better matching for non-regexp triggers X-Git-Url: https://git.netwichtig.de/gitweb/?a=commitdiff_plain;h=6be3b87e6bd31b5fae61df4daa3d99dd181d3044;p=user%2Fhenk%2Fcode%2Fruby%2Frbot.git reaction plugin: better matching for non-regexp triggers --- diff --git a/data/rbot/plugins/reaction.rb b/data/rbot/plugins/reaction.rb index cf7685ec..6f94fb7c 100644 --- a/data/rbot/plugins/reaction.rb +++ b/data/rbot/plugins/reaction.rb @@ -69,7 +69,7 @@ class ::Reaction @trigger << Regexp.new(rex, true) else rex.sub!(/^(["'])(.*)\1$/, '\2') - @trigger << Regexp.new(/\b#{Regexp.escape(rex)}\b/ui) + @trigger << Regexp.new(/\b#{Regexp.escape(rex)}(?:\b|$)/ui) end end