2017-07-12 09:00:27 +00:00
|
|
|
import base64
|
2018-07-15 22:56:06 +00:00
|
|
|
import EventManager
|
2016-03-29 11:56:58 +00:00
|
|
|
|
|
|
|
class Module(object):
|
2018-09-02 18:54:45 +00:00
|
|
|
def __init__(self, bot, events, exports):
|
2018-09-19 12:25:12 +00:00
|
|
|
events.on("received.numeric.001").hook(self.on_connect,
|
2018-09-09 09:04:21 +00:00
|
|
|
priority=EventManager.PRIORITY_URGENT)
|
|
|
|
|
|
|
|
exports.add("serverset", {"setting": "nickserv-password",
|
|
|
|
"help": "Set the nickserv password for this server"})
|
2016-05-17 13:52:07 +00:00
|
|
|
|
|
|
|
def on_connect(self, event):
|
|
|
|
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)
|