Add botconfig.OWNERS_ONLY_COMMANDS to further restrict commands

This commit is contained in:
skizzerz 2015-11-16 12:11:52 -07:00
parent be4421dd59
commit 747249991e
2 changed files with 9 additions and 1 deletions

View File

@ -29,6 +29,7 @@ ADMINS_ACCOUNTS = ("1admin_acc", "2admin_acc")
ALLOWED_NORMAL_MODE_COMMANDS = [] # Debug mode commands to be allowed in normal mode
OWNERS_ONLY_COMMANDS = [] # Commands that should only be allowed for owners, regardless of their original permissions
DISABLE_DEBUG_MODE_REAPER = True
DISABLE_DEBUG_MODE_STASIS = True

View File

@ -168,7 +168,14 @@ class cmd:
return self.func(*largs) # don't check restrictions for role commands
if self.owner_only:
forced_owner_only = False
if hasattr(botconfig, "OWNERS_ONLY_COMMANDS"):
for command in self.cmds:
if command in botconfig.OWNERS_ONLY_COMMANDS:
forced_owner_only = True
break
if self.owner_only or forced_owner_only:
if var.is_owner(nick, ident, host):
adminlog(chan, rawnick, self.name, rest)
return self.func(*largs)