added the capability for multiple owners
This commit is contained in:
parent
dcda60012d
commit
16131895c1
@ -3,8 +3,8 @@ CHANNEL = ""
|
|||||||
HOST = "irc.freenode.net"
|
HOST = "irc.freenode.net"
|
||||||
PORT = 6667
|
PORT = 6667
|
||||||
NICK = "wolfbot"
|
NICK = "wolfbot"
|
||||||
OWNER = "unaffiliated/wolfbot_admin1"
|
OWNERS = ("unaffiliated/wolfbot_admin1",) # the comma is required at the end if there is one owner
|
||||||
ADMINS = ("unaffiliated/wolfbot_admin1", "unaffiliated/wolfbot_admin2")
|
ADMINS = ("unaffiliated/wolfbot_admin2", "unaffiliated/wolfbot_admin3")
|
||||||
CMD_CHAR = "!"
|
CMD_CHAR = "!"
|
||||||
CHANGING_HOST_QUIT_MESSAGE = "Changing host"
|
CHANGING_HOST_QUIT_MESSAGE = "Changing host"
|
||||||
DEBUG_MODE = False
|
DEBUG_MODE = False
|
@ -25,7 +25,7 @@ def generate(fdict, **kwargs):
|
|||||||
largs[1] = parse_nick(largs[1])[0] # username
|
largs[1] = parse_nick(largs[1])[0] # username
|
||||||
#if largs[1].startswith("#"):
|
#if largs[1].startswith("#"):
|
||||||
if owner_only:
|
if owner_only:
|
||||||
if cloak and cloak == botconfig.OWNER:
|
if cloak and cloak in botconfig.OWNERS:
|
||||||
return f(*largs)
|
return f(*largs)
|
||||||
elif cloak:
|
elif cloak:
|
||||||
largs[0].notice(largs[1], "You are not the owner.")
|
largs[0].notice(largs[1], "You are not the owner.")
|
||||||
|
@ -1907,7 +1907,7 @@ def get_help(cli, rnick, rest):
|
|||||||
if name and not fn[0].admin_only and not fn[0].owner_only:
|
if name and not fn[0].admin_only and not fn[0].owner_only:
|
||||||
fns.append("\u0002"+name+"\u0002")
|
fns.append("\u0002"+name+"\u0002")
|
||||||
afns = []
|
afns = []
|
||||||
if cloak in botconfig.ADMINS or cloak == botconfig.OWNER:
|
if cloak in botconfig.ADMINS or cloak in botconfig.OWNERS:
|
||||||
for name, fn in COMMANDS.items():
|
for name, fn in COMMANDS.items():
|
||||||
if fn[0].admin_only:
|
if fn[0].admin_only:
|
||||||
afns.append("\u0002"+name+"\u0002")
|
afns.append("\u0002"+name+"\u0002")
|
||||||
@ -1941,7 +1941,7 @@ def show_admins(cli, nick, chan, rest):
|
|||||||
@hook("whoreply")
|
@hook("whoreply")
|
||||||
def on_whoreply(cli, server, dunno, chan, dunno1,
|
def on_whoreply(cli, server, dunno, chan, dunno1,
|
||||||
cloak, dunno3, user, status, dunno4):
|
cloak, dunno3, user, status, dunno4):
|
||||||
if ((cloak in botconfig.ADMINS or cloak == botconfig.OWNER) and 'G' not in status and
|
if ((cloak in botconfig.ADMINS or cloak in botconfig.OWNERS) and 'G' not in status and
|
||||||
user != botconfig.NICK and cloak not in var.AWAY):
|
user != botconfig.NICK and cloak not in var.AWAY):
|
||||||
admins.append(user)
|
admins.append(user)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user