Browse Source

added the capability for multiple owners

master
jcao219 13 years ago
parent
commit
aa3e451feb
  1. 4
      botconfig.py
  2. 2
      decorators.py
  3. 4
      wolfgame.py

4
botconfig.py

@ -3,8 +3,8 @@ CHANNEL = "" @@ -3,8 +3,8 @@ CHANNEL = ""
HOST = "irc.freenode.net"
PORT = 6667
NICK = "wolfbot"
OWNER = "unaffiliated/wolfbot_admin1"
ADMINS = ("unaffiliated/wolfbot_admin1", "unaffiliated/wolfbot_admin2")
OWNERS = ("unaffiliated/wolfbot_admin1",) # the comma is required at the end if there is one owner
ADMINS = ("unaffiliated/wolfbot_admin2", "unaffiliated/wolfbot_admin3")
CMD_CHAR = "!"
CHANGING_HOST_QUIT_MESSAGE = "Changing host"
DEBUG_MODE = False

2
decorators.py

@ -25,7 +25,7 @@ def generate(fdict, **kwargs): @@ -25,7 +25,7 @@ def generate(fdict, **kwargs):
largs[1] = parse_nick(largs[1])[0] # username
#if largs[1].startswith("#"):
if owner_only:
if cloak and cloak == botconfig.OWNER:
if cloak and cloak in botconfig.OWNERS:
return f(*largs)
elif cloak:
largs[0].notice(largs[1], "You are not the owner.")

4
wolfgame.py

@ -1907,7 +1907,7 @@ def get_help(cli, rnick, rest): @@ -1907,7 +1907,7 @@ def get_help(cli, rnick, rest):
if name and not fn[0].admin_only and not fn[0].owner_only:
fns.append("\u0002"+name+"\u0002")
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():
if fn[0].admin_only:
afns.append("\u0002"+name+"\u0002")
@ -1941,7 +1941,7 @@ def show_admins(cli, nick, chan, rest): @@ -1941,7 +1941,7 @@ def show_admins(cli, nick, chan, rest):
@hook("whoreply")
def on_whoreply(cli, server, dunno, chan, dunno1,
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):
admins.append(user)

Loading…
Cancel
Save