diff options
author | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2007-09-02 15:41:24 +0000 |
---|---|---|
committer | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2007-09-02 15:41:24 +0000 |
commit | 3fbe5309c69bff7ed5456b196f974c7aa3dfb868 (patch) | |
tree | 5abd377302c4fbb49a451bced5fa58193fe61257 /lib/rbot | |
parent | e1c2e8e315b66755746b0386d935bfa19a630788 (diff) |
message.rb: convenience method to get the botuser corresponding the message source
Diffstat (limited to 'lib/rbot')
-rw-r--r-- | lib/rbot/message.rb | 7 |
1 files changed, 7 insertions, 0 deletions
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 |