Add botconfig.OWNERS_ONLY_COMMANDS to further restrict commands
This commit is contained in:
parent
be4421dd59
commit
747249991e
@ -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
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user