bitbot-3.11-fork/modules/nickserv.py
2018-09-24 15:13:27 +01:00

18 lines
668 B
Python

import base64
from src import EventManager
class Module(object):
def __init__(self, bot, events, exports):
events.on("received.numeric.001").hook(self.on_connect,
priority=EventManager.PRIORITY_URGENT)
exports.add("serverset", {"setting": "nickserv-password",
"help": "Set the nickserv password for this server"})
def on_connect(self, event):
nickserv_password = event["server"].get_setting(
"nickserv-password")
if nickserv_password:
event["server"].attempted_auth = True
event["server"].send_message("nickserv",
"identify %s" % nickserv_password)