summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2006-08-31 14:25:17 +0000
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2006-08-31 14:25:17 +0000
commit6b4751c8b6e99dcff80cfe5e66c746cf9106dc6a (patch)
tree7e7751862c79abba53a1694f4a439e168dbbb710
parent617b282bcd157896ccf630415b29022acd2aca62 (diff)
nickserv password now tries to inform the nickserv of the password change; it can also be called without the bot nick to change the password of the current nick
-rw-r--r--data/rbot/plugins/nickserv.rb11
1 files changed, 9 insertions, 2 deletions
diff --git a/data/rbot/plugins/nickserv.rb b/data/rbot/plugins/nickserv.rb
index a630a4be..5c2e068f 100644
--- a/data/rbot/plugins/nickserv.rb
+++ b/data/rbot/plugins/nickserv.rb
@@ -63,7 +63,14 @@ class NickServPlugin < Plugin
end
def password(m, params)
- @registry[params[:nick]] = params[:passwd]
+ nick = params[:nick] || @bot.nick
+ passwd = params[:passwd]
+ if nick == @bot.nick
+ @bot.say @bot.config['nickserv.name'], "SET PASSWORD #{passwd}"
+ else
+ m.reply "I'm only changing this in my database, I won't inform #{@bot.config['nickserv.name']} of the change"
+ end
+ @registry[nick] = passwd
m.okay
end
@@ -142,7 +149,7 @@ class NickServPlugin < Plugin
end
plugin = NickServPlugin.new
-plugin.map 'nickserv password :nick :passwd', :action => "password"
+plugin.map 'nickserv password [:nick] :passwd', :action => "password"
plugin.map 'nickserv register :passwd :email', :action => 'nick_register',
:defaults => {:passwd => false, :email => false}
plugin.map 'nickserv listnicks', :action => "listnicks"