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",
|
2018-09-27 11:08:07 +00:00
|
|
|
"help": "Set the nickserv password for this server"})
|
|
|
|
class Module(ModuleManager.BaseModule):
|
2018-10-03 12:22:37 +00:00
|
|
|
@utils.hook("received.numeric.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)
|