|
|
@ -12,7 +12,8 @@ ALLOWED_GUILDS = EnvService.get_allowed_guilds()
|
|
|
|
class Check:
|
|
|
|
class Check:
|
|
|
|
def check_admin_roles() -> Callable:
|
|
|
|
def check_admin_roles() -> Callable:
|
|
|
|
async def inner(ctx: discord.ApplicationContext):
|
|
|
|
async def inner(ctx: discord.ApplicationContext):
|
|
|
|
if ADMIN_ROLES == [None]: return True
|
|
|
|
if ADMIN_ROLES == [None]:
|
|
|
|
|
|
|
|
return True
|
|
|
|
|
|
|
|
|
|
|
|
if not any(role.name.lower() in ADMIN_ROLES for role in ctx.user.roles):
|
|
|
|
if not any(role.name.lower() in ADMIN_ROLES for role in ctx.user.roles):
|
|
|
|
await ctx.defer(ephemeral=True)
|
|
|
|
await ctx.defer(ephemeral=True)
|
|
|
@ -28,7 +29,8 @@ class Check:
|
|
|
|
|
|
|
|
|
|
|
|
def check_dalle_roles() -> Callable:
|
|
|
|
def check_dalle_roles() -> Callable:
|
|
|
|
async def inner(ctx: discord.ApplicationContext):
|
|
|
|
async def inner(ctx: discord.ApplicationContext):
|
|
|
|
if DALLE_ROLES == [None]: return True
|
|
|
|
if DALLE_ROLES == [None]:
|
|
|
|
|
|
|
|
return True
|
|
|
|
if not any(role.name.lower() in DALLE_ROLES for role in ctx.user.roles):
|
|
|
|
if not any(role.name.lower() in DALLE_ROLES for role in ctx.user.roles):
|
|
|
|
await ctx.defer(ephemeral=True)
|
|
|
|
await ctx.defer(ephemeral=True)
|
|
|
|
await ctx.respond(
|
|
|
|
await ctx.respond(
|
|
|
@ -43,7 +45,8 @@ class Check:
|
|
|
|
|
|
|
|
|
|
|
|
def check_gpt_roles() -> Callable:
|
|
|
|
def check_gpt_roles() -> Callable:
|
|
|
|
async def inner(ctx: discord.ApplicationContext):
|
|
|
|
async def inner(ctx: discord.ApplicationContext):
|
|
|
|
if GPT_ROLES == [None]: return True
|
|
|
|
if GPT_ROLES == [None]:
|
|
|
|
|
|
|
|
return True
|
|
|
|
if not any(role.name.lower() in GPT_ROLES for role in ctx.user.roles):
|
|
|
|
if not any(role.name.lower() in GPT_ROLES for role in ctx.user.roles):
|
|
|
|
await ctx.defer(ephemeral=True)
|
|
|
|
await ctx.defer(ephemeral=True)
|
|
|
|
await ctx.respond(
|
|
|
|
await ctx.respond(
|
|
|
|