From 3951af2a3551ae1c558242746f462a836d70cd8c Mon Sep 17 00:00:00 2001 From: Chris Gahan Date: Thu, 1 Jun 2006 06:31:46 +0000 Subject: Fixes #87 (from giuseppe.bilotta) --- data/rbot/plugins/nickserv.rb | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'data/rbot/plugins') diff --git a/data/rbot/plugins/nickserv.rb b/data/rbot/plugins/nickserv.rb index 6e7a26b9..93b0b015 100644 --- a/data/rbot/plugins/nickserv.rb +++ b/data/rbot/plugins/nickserv.rb @@ -51,6 +51,7 @@ class NickServPlugin < Plugin @registry[@bot.nick] = passwd m.okay end + def listnicks(m, params) if @registry.length > 0 @registry.each {|k,v| @@ -60,23 +61,33 @@ class NickServPlugin < Plugin m.reply "none known" end end - def identify(m, params) + + def do_identify if @registry.has_key?(@bot.nick) @bot.sendmsg "PRIVMSG", "NickServ", "IDENTIFY #{@registry[@bot.nick]}" + return true + end + return false + end + + def identify(m, params) + if do_identify m.okay else m.reply "I dunno the nickserv password for the nickname #{@bot.nick} :(" end end + def connect + do_identify + end + def listen(m) return unless(m.kind_of? NoticeMessage) if (m.sourcenick == "NickServ" && m.message =~ /IDENTIFY/) debug "nickserv asked us to identify for nick #{@bot.nick}" - if @registry.has_key?(@bot.nick) - @bot.sendmsg "PRIVMSG", "NickServ", "IDENTIFY " + @registry[@bot.nick] - end + do_identify end end -- cgit v1.2.3