From 3fbe5309c69bff7ed5456b196f974c7aa3dfb868 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Sun, 2 Sep 2007 15:41:24 +0000 Subject: message.rb: convenience method to get the botuser corresponding the message source --- lib/rbot/message.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib/rbot') diff --git a/lib/rbot/message.rb b/lib/rbot/message.rb index 41658c6b..6331825d 100644 --- a/lib/rbot/message.rb +++ b/lib/rbot/message.rb @@ -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 -- cgit v1.2.3