mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-12-06 09:22:31 -05:00
[Core] Co-owners cli flag only, implemented owner cli flag
After giving it further thought, I don't believe co-owners really need to be a command, as it is unlikely that co-owners will need to be changed often enough. Furthermore, this gives a further layer of protection to people who like to gloss over warnings.
This commit is contained in:
@@ -10,13 +10,13 @@ class Red(commands.Bot):
|
||||
def __init__(self, cli_flags, **kwargs):
|
||||
self._shutdown_mode = ExitCodes.CRITICAL
|
||||
self.db = Config.get_core_conf(force_registration=True)
|
||||
self._co_owners = cli_flags.co_owner
|
||||
|
||||
self.db.register_global(
|
||||
token=None,
|
||||
prefix=[],
|
||||
packages=[],
|
||||
owner=None,
|
||||
coowners=[],
|
||||
whitelist=[],
|
||||
blacklist=[],
|
||||
enable_sentry=None
|
||||
@@ -43,6 +43,9 @@ class Red(commands.Bot):
|
||||
if "command_prefix" not in kwargs:
|
||||
kwargs["command_prefix"] = prefix_manager
|
||||
|
||||
if cli_flags.owner and "owner_id" not in kwargs:
|
||||
kwargs["owner_id"] = cli_flags.owner
|
||||
|
||||
if "owner_id" not in kwargs:
|
||||
kwargs["owner_id"] = self.db.get("owner")
|
||||
|
||||
@@ -51,7 +54,7 @@ class Red(commands.Bot):
|
||||
super().__init__(**kwargs)
|
||||
|
||||
async def is_owner(self, user):
|
||||
if user.id in self.db.coowners():
|
||||
if user.id in self._co_owners:
|
||||
return True
|
||||
return await super().is_owner(user)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user