]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/blobdiff - lib/rbot/message.rb
New Auth Framework: no need to have TransientBotUser as a separate class
[user/henk/code/ruby/rbot.git] / lib / rbot / message.rb
index a1265532062b721bbfe091eb71af7ad347f7130c..6331825de66d512df0cb21da9c65d35be9adc2fa 100644 (file)
@@ -164,6 +164,13 @@ module Irc
       "#{@source.user}@#{@source.host}" rescue @source.to_s
     end
 
+    # Access the botuser corresponding to the source, if any
+    #
+    def botuser
+      @bot.auth.autologin(@source) rescue @bot.auth.everyone
+    end
+
+
     # Was the message from an identified user?
     def identified?
       return @identified
@@ -331,9 +338,10 @@ module Irc
       @replied = true
     end
 
-    # send a CTCP response, i.e. a private notice to the sender
-    def ctcp_reply(command, string, options={})
-      @bot.ctcp_notice @source, command, string, options
+    # send a CTCP response, i.e. a private NOTICE to the sender
+    # with the same CTCP command and the reply as a parameter
+    def ctcp_reply(string, options={})
+      @bot.ctcp_notice @source, @ctcp, string, options
     end
 
     # convenience method to reply "okay" in the current language to the