summaryrefslogtreecommitdiff
path: root/lib/rbot/messagemapper.rb
diff options
context:
space:
mode:
authorYaohan Chen <yaohan.chen@gmail.com>2008-06-24 13:45:56 -0400
committerYaohan Chen <yaohan.chen@gmail.com>2008-06-24 13:46:46 -0400
commit6f9ad0ae1a89404246877bfeffe9ff4d18745b1a (patch)
treec7399b2d5f98bba9208eb8d87e2168031aaede6f /lib/rbot/messagemapper.rb
parent9847384d7ec5eeaf38a6746a585fa02c22da8134 (diff)
allow multi-line (artificial) messages be delegated and handled
Diffstat (limited to 'lib/rbot/messagemapper.rb')
-rw-r--r--lib/rbot/messagemapper.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/rbot/messagemapper.rb b/lib/rbot/messagemapper.rb
index dd43e27c..b6125538 100644
--- a/lib/rbot/messagemapper.rb
+++ b/lib/rbot/messagemapper.rb
@@ -519,7 +519,8 @@ class Bot
# debug "Delimited optionals: #{rx.inspect}"
rx.gsub!(/(?:\\ )+/, "\\s+")
# debug "Corrected spaces: #{rx.inspect}"
- @regexp = Regexp.new("^#{rx}$")
+ # Created message (such as by fake_message) can contain multiple lines
+ @regexp = /\A#{rx}\z/m
end
# Recognize the provided string components, returning a hash of