This commit is contained in:
unknown 2023-06-01 21:56:21 +02:00
parent e953bcc896
commit f96ed87d20
2 changed files with 2 additions and 5 deletions

View File

@ -34,14 +34,10 @@ class ReginaldCog(commands.Cog):
def has_admin_role(): def has_admin_role():
async def predicate(ctx): async def predicate(ctx):
#janitor_role_id = 672156832323600396
#has_janitor_role = any(role.id == janitor_role_id for role in ctx.author.roles) # Uncomment this line
has_admin_permission = ctx.author.guild_permissions.administrator has_admin_permission = ctx.author.guild_permissions.administrator
#return has_janitor_role or has_admin_permission
return has_admin_permission return has_admin_permission
return commands.check(predicate) return commands.check(predicate)
@commands.guild_only() @commands.guild_only()
@commands.has_permissions(manage_guild=True) @commands.has_permissions(manage_guild=True)
@commands.command(help="Set the OpenAI API key") @commands.command(help="Set the OpenAI API key")

View File

@ -2,4 +2,5 @@ from .trafficCog import TrafficCog
from redbot.core.bot import Red from redbot.core.bot import Red
async def setup(bot: Red): async def setup(bot: Red):
await bot.add_cog(TrafficCog(bot)) cog = TrafficCog(bot)
await bot.add_cog(cog)