diff options
author | Yaohan Chen <yaohan.chen@gmail.com> | 2008-06-24 13:45:56 -0400 |
---|---|---|
committer | Yaohan Chen <yaohan.chen@gmail.com> | 2008-06-24 13:46:46 -0400 |
commit | 6f9ad0ae1a89404246877bfeffe9ff4d18745b1a (patch) | |
tree | c7399b2d5f98bba9208eb8d87e2168031aaede6f /lib/rbot/messagemapper.rb | |
parent | 9847384d7ec5eeaf38a6746a585fa02c22da8134 (diff) |
allow multi-line (artificial) messages be delegated and handled
Diffstat (limited to 'lib/rbot/messagemapper.rb')
-rw-r--r-- | lib/rbot/messagemapper.rb | 3 |
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 |