diff options
-rw-r--r-- | lib/rbot/message.rb | 3 | ||||
-rw-r--r-- | lib/rbot/messagemapper.rb | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/lib/rbot/message.rb b/lib/rbot/message.rb index 97e3673a..1fb68e20 100644 --- a/lib/rbot/message.rb +++ b/lib/rbot/message.rb @@ -328,7 +328,8 @@ module Irc # free splitting for plugins @params = @message.dup - if @params.gsub!(/^\s*(\S+)[\s$]*/, "") + # Created messges (such as by fake_message) can contain multiple lines + if @params.gsub!(/\A\s*(\S+)[\s$]*/m, "") @plugin = $1.downcase @params = nil unless @params.length > 0 end 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 |