Implement autojoin

pull/1/head
Mark Veidemanis 7 years ago
parent a673a2288e
commit ac798016ba

@ -55,6 +55,7 @@ class IRCBot(IRCClient):
self.versionNum = None
self.versionEnv = None
self.sourceURL = instance["source"]
self.autojoin = instance["autojoin"]
self._who = {}
self._getWho = {}
@ -166,6 +167,8 @@ class IRCBot(IRCClient):
self.connected = True
if self.authtype == "ns":
self.msg(self.authentity, "IDENTIFY %s" % self.nspass)
for i in self.autojoin:
self.join(i)
def joined(self, channel):
if not channel in self.channels:
@ -590,6 +593,7 @@ class Helper(object):
"finger": None,
"version": None,
"source": None,
"autojoin": [],
"authtype": config["Default"]["authtype"],
"password": config["Default"]["password"],
"authentity": "NickServ",
@ -679,6 +683,8 @@ class Helper(object):
if spl[2] == "enabled":
failure("Use the enable and disable commands to manage this")
return
if spl[2] == "autojoin":
spl[3] = spl[3].split(",")
pool[spl[1]][spl[2]] = spl[3]
if spl[1] in IRCPool.keys():

Loading…
Cancel
Save