X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=lib%2Frbot%2Fmessage.rb;h=35100802b8d640db409b90d876fc54a2ed147900;hb=fdf1bc954352f19818f5f9f1c86643a2f8ef40c6;hp=de72d30c93eec520f3b4c896d0888d290345bd25;hpb=285023382ed06501aca544c52123d61799937eab;p=user%2Fhenk%2Fcode%2Fruby%2Frbot.git diff --git a/lib/rbot/message.rb b/lib/rbot/message.rb index de72d30c..35100802 100644 --- a/lib/rbot/message.rb +++ b/lib/rbot/message.rb @@ -334,7 +334,7 @@ module Irc # the nick or core.reply_with_nick is set to false # def reply(string, options={}) - if @bot.config['core.reply_with_nick'] and not string =~ /\b#{@source}\b/ + if @bot.config['core.reply_with_nick'] and not string =~ /\b#{Regexp.escape(@source.to_s)}\b/ return nickreply(string, options) end plainreply(string, options) @@ -382,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