diff --git a/app/cogs/controlcommands/debug.py b/app/cogs/controlcommands/debug.py index 94e0fc3..bee65b2 100644 --- a/app/cogs/controlcommands/debug.py +++ b/app/cogs/controlcommands/debug.py @@ -24,9 +24,6 @@ class Debug(commands.Cog, name='Debug Commands'): if role.id == conf[str(ctx.guild.id)]['roles']['maintainer']: return True return ctx.author.id == ctx.guild.owner_id - async def cog_check(self, ctx): - return ctx.author.id == int(os.getenv('BOT_MAINTAINER_ID')) - @commands.command( name='testconfig', description='Tests the completeness of the configuration values of the current guild by comparing it to a configuration blueprint.', diff --git a/app/cogs/controlcommands/migrate.py b/app/cogs/controlcommands/migrate.py index 56fc110..ae79a5e 100644 --- a/app/cogs/controlcommands/migrate.py +++ b/app/cogs/controlcommands/migrate.py @@ -16,8 +16,12 @@ class Migrate(commands.Cog, name='Migrate Command'): self.client = client #### Permission Check: Only available to the bot's maintainer. - async def cog_check(self, ctx): - return ctx.author.id == int(os.getenv('BOT_MAINTAINER_ID')) + async def cog_check(self, ctx:commands.Context): + conf = yaml_load(configFile) + for role in ctx.author.roles: + if 'maintainer' in conf[str(ctx.guild.id)]['roles']: + if role.id == conf[str(ctx.guild.id)]['roles']['maintainer']: return True + return ctx.author.id == ctx.guild.owner_id @commands.command( name='migrate',