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

class Module(object):
    def __init__(self, bot, events, exports):
        exports.add("serverset", {"setting": "nickserv-password",
            "help": "Set the nickserv password for this server"})

    @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)