From 3d7cf3e2f95262a77782fd46903d51cfa7faed0b Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 3 Jun 2023 18:29:20 +0200 Subject: [PATCH] sob --- reginaldCog/reginald.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/reginaldCog/reginald.py b/reginaldCog/reginald.py index cafbf5c..965afdd 100644 --- a/reginaldCog/reginald.py +++ b/reginaldCog/reginald.py @@ -56,8 +56,10 @@ class ReginaldCog(commands.Cog): else: await ctx.send(f"The {role.name} role is not currently allowed to use the Reginald command.") - def role_check(self, ctx): - return self.has_admin_role(ctx) or self.has_allowed_role(ctx) + def role_check(self): + async def predicate(ctx): + return await self.has_admin_role(ctx) or await self.has_allowed_role(ctx) + return commands.check(predicate) @commands.guild_only() @commands.has_permissions(manage_guild=True) @@ -67,7 +69,7 @@ class ReginaldCog(commands.Cog): await ctx.send("OpenAI API key set successfully.") @commands.guild_only() - @commands.check(role_check) + @commands.check(role_check()) @commands.command(help="Ask Reginald a question") @commands.cooldown(1, 10, commands.BucketType.user) # 10 second cooldown per user async def reginald(self, ctx, *, prompt=None):