Format Python code with psf/black push

github-actions 2 years ago
parent dd6be231d5
commit ab3d0a6868

@ -146,6 +146,7 @@ class DrawDallEService(discord.Cog, name="DrawDallEService"):
self.converser_cog.users_to_interactions[user_id].append(
result_message.id
)
@add_to_group("dalle")
@discord.slash_command(
name="draw",

@ -94,21 +94,24 @@ class GPT3ComCon(discord.Cog, name="GPT3ComCon"):
self.conversation_threads = {}
# Create slash command groups
dalle = discord.SlashCommandGroup(name="dalle",
description="Dalle related commands",
guild_ids=ALLOWED_GUILDS,
checks=[Check.check_dalle_roles()]
)
gpt = discord.SlashCommandGroup(name="gpt",
description="GPT related commands",
guild_ids=ALLOWED_GUILDS,
checks=[Check.check_gpt_roles()]
)
system = discord.SlashCommandGroup(name="system",
description="Admin/System settings for the bot",
guild_ids=ALLOWED_GUILDS,
checks=[Check.check_admin_roles()]
)
dalle = discord.SlashCommandGroup(
name="dalle",
description="Dalle related commands",
guild_ids=ALLOWED_GUILDS,
checks=[Check.check_dalle_roles()],
)
gpt = discord.SlashCommandGroup(
name="gpt",
description="GPT related commands",
guild_ids=ALLOWED_GUILDS,
checks=[Check.check_gpt_roles()],
)
system = discord.SlashCommandGroup(
name="system",
description="Admin/System settings for the bot",
guild_ids=ALLOWED_GUILDS,
checks=[Check.check_admin_roles()],
)
@commands.Cog.listener()
async def on_member_join(self, member):
@ -154,7 +157,7 @@ class GPT3ComCon(discord.Cog, name="GPT3ComCon"):
delete_existing=True,
)
print(f"The debug channel was acquired and commands registered")
@add_to_group("system")
@discord.slash_command(
name="set-usage",

@ -45,7 +45,7 @@ class ImgPromptOptimizer(discord.Cog, name="ImgPromptOptimizer"):
except:
traceback.print_exc()
self.OPTIMIZER_PRETEXT = self._OPTIMIZER_PRETEXT
@add_to_group("dalle")
@discord.slash_command(
name="imgoptimize",

@ -21,6 +21,7 @@ class Check:
)
return False
return True
return inner
def check_dalle_roles() -> Callable:
@ -34,6 +35,7 @@ class Check:
)
return False
return True
return inner
def check_gpt_roles() -> Callable:
@ -47,4 +49,5 @@ class Check:
)
return False
return True
return inner
return inner

@ -50,7 +50,9 @@ class EnvService:
)
admin_roles = (
admin_roles.lower().split(",") if "," in admin_roles else [admin_roles.lower()]
admin_roles.lower().split(",")
if "," in admin_roles
else [admin_roles.lower()]
)
return admin_roles
@ -72,7 +74,9 @@ class EnvService:
)
dalle_roles = (
dalle_roles.lower().split(",") if "," in dalle_roles else [dalle_roles.lower()]
dalle_roles.lower().split(",")
if "," in dalle_roles
else [dalle_roles.lower()]
)
return dalle_roles
@ -94,11 +98,12 @@ class EnvService:
)
gpt_roles = (
gpt_roles.lower().strip().split(",") if "," in gpt_roles else [gpt_roles.lower()]
gpt_roles.lower().strip().split(",")
if "," in gpt_roles
else [gpt_roles.lower()]
)
return gpt_roles
@staticmethod
def get_welcome_message():
# WELCOME_MESSAGE is a default string used to welcome new members to the server if GPT3 is not available.

Loading…
Cancel
Save