added autojoin list option
This commit is contained in:
parent
f62f3d6e68
commit
fb01696636
21
config.py
21
config.py
|
@ -11,16 +11,7 @@ class config:
|
||||||
port = 6697
|
port = 6697
|
||||||
ssl = True
|
ssl = True
|
||||||
channel = "##jan6"
|
channel = "##jan6"
|
||||||
|
autojoin = ["##sharing"]
|
||||||
capabilities = [
|
|
||||||
"message-tags",
|
|
||||||
"multi-prefix",
|
|
||||||
"account-tag",
|
|
||||||
"batch",
|
|
||||||
"account-notify",
|
|
||||||
"chghost",
|
|
||||||
"away-notify",
|
|
||||||
]
|
|
||||||
|
|
||||||
class admin:
|
class admin:
|
||||||
accounts = ["jan6"]
|
accounts = ["jan6"]
|
||||||
|
@ -33,3 +24,13 @@ class config:
|
||||||
# admin-only override,
|
# admin-only override,
|
||||||
# useful for testing broken commands which should still be normal-user accessible
|
# useful for testing broken commands which should still be normal-user accessible
|
||||||
admin_only = []
|
admin_only = []
|
||||||
|
|
||||||
|
capabilities = [
|
||||||
|
"message-tags",
|
||||||
|
"multi-prefix",
|
||||||
|
"account-tag",
|
||||||
|
"batch",
|
||||||
|
"account-notify",
|
||||||
|
"chghost",
|
||||||
|
"away-notify",
|
||||||
|
]
|
||||||
|
|
10
stuff.py
10
stuff.py
|
@ -17,7 +17,8 @@ def stuff(bot, sock):
|
||||||
# mesg=util.mesg
|
# mesg=util.mesg
|
||||||
server_caps = []
|
server_caps = []
|
||||||
wanted_caps = config.capabilities
|
wanted_caps = config.capabilities
|
||||||
chan = config.server.channel # autojoin channel
|
chan = config.server.channel # main channel
|
||||||
|
autojoin_done=False
|
||||||
is_pm = False
|
is_pm = False
|
||||||
mode = "init"
|
mode = "init"
|
||||||
|
|
||||||
|
@ -87,6 +88,13 @@ def stuff(bot, sock):
|
||||||
elif mode == "boot":
|
elif mode == "boot":
|
||||||
send(irctokens.build("JOIN", [chan]).format())
|
send(irctokens.build("JOIN", [chan]).format())
|
||||||
mode = "normal"
|
mode = "normal"
|
||||||
|
elif mode == "normal" and autojoin_done==False:
|
||||||
|
try:
|
||||||
|
for channel in config.server.autojoin:
|
||||||
|
send("JOIN "+channel)
|
||||||
|
time.sleep(0.25)
|
||||||
|
except Exception: True
|
||||||
|
autojoin_done=True
|
||||||
elif mode == "normal":
|
elif mode == "normal":
|
||||||
if line.command == "433":
|
if line.command == "433":
|
||||||
mesg("nick in use!", chan)
|
mesg("nick in use!", chan)
|
||||||
|
|
Loading…
Reference in New Issue