bitbot-3.11-fork/modules/nickserv.py

19 lines
668 B
Python
Raw Normal View History

import base64
from src import EventManager
2016-03-29 11:56:58 +00:00
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")
2018-07-15 22:56:06 +00:00
if nickserv_password:
event["server"].attempted_auth = True
event["server"].send_message("nickserv",
"identify %s" % nickserv_password)