diff options
author | Dmitry Kim <dmitry point kim at gmail point com> | 2007-09-21 11:07:52 +0000 |
---|---|---|
committer | Dmitry Kim <dmitry point kim at gmail point com> | 2007-09-21 11:07:52 +0000 |
commit | a860467ad40fad37f9fc886ea1a1d1f95a3bd2d7 (patch) | |
tree | d05e9470cca7461b092088102fc65de3a3e777df | |
parent | 6ff9f6e32f422de0ef7bc428037fe6ec896d0ead (diff) |
+ (core/auth) "!who is :user" syntax
-rw-r--r-- | lib/rbot/core/auth.rb | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/lib/rbot/core/auth.rb b/lib/rbot/core/auth.rb index c6c55aff..59bcd54a 100644 --- a/lib/rbot/core/auth.rb +++ b/lib/rbot/core/auth.rb @@ -238,10 +238,6 @@ class AuthModule < CoreBotModule end
def auth_whoami(m, params)
- rep = ""
- # if m.public?
- # rep << m.source.nick << ", "
- # end
m.reply _("you are %{who}") % {
:who => get_botusername_for(m.source).gsub(
/^everyone$/, _("no one that I know")).gsub(
@@ -249,6 +245,19 @@ class AuthModule < CoreBotModule }
end
+ def auth_whois(m, params)
+ return auth_whoami(m, params) if !m.public?
+ u = m.channel.users[params[:user]]
+
+ return m.reply "I don't see anyone named '#{params[:user]}' here" unless u
+
+ m.reply _("#{params[:user]} is %{who}") % {
+ :who => get_botusername_for(u).gsub(
+ /^everyone$/, _("no one that I know")).gsub(
+ /^owner$/, _("my boss"))
+ }
+ end
+
def help(cmd, topic="")
case cmd
when "login"
@@ -836,6 +845,10 @@ auth.map "whoami", :action => 'auth_whoami',
:auth_path => '!*!'
+auth.map "who is :user",
+ :action => 'auth_whois',
+ :auth_path => '!*!'
+
auth.map "auth :password",
:action => 'auth_auth',
:public => false,
|