X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;ds=sidebyside;f=lib%2Frbot%2Fmessage.rb;h=df3812e00e24d4f3e724f3b6b12cf3e888d75b16;hb=edb270838305ee330480bc0fb4060b11af4ff128;hp=9881503c3f10a074a7f8ff0aff4ae988dadbe69b;hpb=d0e3551896b446a93065a7dac47e81f721b80b7c;p=user%2Fhenk%2Fcode%2Fruby%2Frbot.git diff --git a/lib/rbot/message.rb b/lib/rbot/message.rb index 9881503c..df3812e0 100644 --- a/lib/rbot/message.rb +++ b/lib/rbot/message.rb @@ -122,6 +122,9 @@ module Irc # contents of the message attr_accessor :message + # contents of the message (for logging purposes) + attr_accessor :logmessage + # has the message been replied to/handled by a plugin? attr_accessor :replied @@ -152,6 +155,7 @@ module Irc warning "Message does not have identification" end end + @logmessage = @message.dup if target && target == @bot.myself @address = true @@ -283,6 +287,7 @@ module Irc @message = $3 || String.new @action = @ctcp == 'ACTION' debug "Received CTCP command #{@ctcp} with options #{@message} (action? #{@action})" + @logmessage = @message.dup end # free splitting for plugins @@ -377,6 +382,12 @@ module Irc plainokay end + # send a NOTICE to the message source + # + def notify(msg,opts={}) + @bot.notice(sourcenick, msg, opts) + end + end # class to manage IRC PRIVMSGs