diff options
-rw-r--r-- | data/rbot/plugins/nickserv.rb | 19 |
1 files changed, 15 insertions, 4 deletions
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 |