diff --git a/botconfig.py.example b/botconfig.py.example index cc949f8..6ff1074 100644 --- a/botconfig.py.example +++ b/botconfig.py.example @@ -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 diff --git a/src/decorators.py b/src/decorators.py index 24ccdc5..237dd4f 100644 --- a/src/decorators.py +++ b/src/decorators.py @@ -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)