aboutsummaryrefslogtreecommitdiff
path: root/modules/nickserv.py
blob: 2bceba0c9e198a4659f4f6d021357f39dc76410c (about) (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import base64
from src import EventManager, ModuleManager, Utils

@Utils.export("serverset", {"setting": "nickserv-password",
    "help": "Set the nickserv password for this server"})
class Module(ModuleManager.BaseModule):
    @Utils.hook("received.numeric.001", priority=EventManager.PRIORITY_URGENT)
    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)