bitbot-3.11-fork/modules/nickserv.py

15 lines
615 B
Python
Raw Normal View History

import base64
from src import EventManager, ModuleManager, utils
@utils.export("serverset", {"setting": "nickserv-password",
2019-05-23 09:28:14 +00:00
"help": "Set the nickserv password for this server",
"example": "hunter2"})
class Module(ModuleManager.BaseModule):
@utils.hook("received.001", priority=EventManager.PRIORITY_URGENT)
def on_connect(self, event):
2018-10-03 15:00:07 +00:00
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)