2017-07-12 09:00:27 +00:00
|
|
|
import base64
|
2018-10-03 12:22:37 +00:00
|
|
|
from src import EventManager, ModuleManager, utils
|
2016-05-17 13:52:07 +00:00
|
|
|
|
2018-10-03 12:22:37 +00:00
|
|
|
@utils.export("serverset", {"setting": "nickserv-password",
|
2019-05-23 09:28:14 +00:00
|
|
|
"help": "Set the nickserv password for this server",
|
|
|
|
"example": "hunter2"})
|
2018-09-27 11:08:07 +00:00
|
|
|
class Module(ModuleManager.BaseModule):
|
2019-02-16 15:53:14 +00:00
|
|
|
@utils.hook("received.001", priority=EventManager.PRIORITY_URGENT)
|
2016-05-17 13:52:07 +00:00
|
|
|
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:
|
2017-07-12 09:00:27 +00:00
|
|
|
event["server"].attempted_auth = True
|
2016-05-17 13:52:07 +00:00
|
|
|
event["server"].send_message("nickserv",
|
|
|
|
"identify %s" % nickserv_password)
|