Format Python code with psf/black push

github-actions 1 year ago
parent 9388ca661f
commit c3cf61f199

@ -61,6 +61,7 @@ class Commands(discord.Cog, name="Commands"):
"""
System commands
"""
@add_to_group("system")
@discord.slash_command(
name="settings",
@ -491,17 +492,19 @@ class Commands(discord.Cog, name="Commands"):
"""
Text-based context menu commands from here
"""
@discord.message_command(
name="Ask GPT", guild_ids=ALLOWED_GUILDS, checks=[Check.check_gpt_roles()])
name="Ask GPT", guild_ids=ALLOWED_GUILDS, checks=[Check.check_gpt_roles()]
)
async def ask_gpt_action(self, ctx, message: discord.Message):
await self.converser_cog.ask_gpt_action(ctx, message)
"""
Image-based context menu commands from here
"""
@discord.message_command(
name="Draw", guild_ids=ALLOWED_GUILDS, checks=[Check.check_dalle_roles()])
name="Draw", guild_ids=ALLOWED_GUILDS, checks=[Check.check_dalle_roles()]
)
async def draw_action(self, ctx, message: discord.Message):
await self.image_draw_cog.draw_action(ctx, message)

@ -40,7 +40,9 @@ class DrawDallEService(discord.Cog, name="DrawDallEService"):
print("Draw service initialized")
self.redo_users = {}
async def draw_command(self, ctx: discord.ApplicationContext, prompt: str, from_action=False):
async def draw_command(
self, ctx: discord.ApplicationContext, prompt: str, from_action=False
):
user_api_key = None
if USER_INPUT_API_KEYS:
user_api_key = await TextService.get_user_api_key(
@ -66,7 +68,9 @@ class DrawDallEService(discord.Cog, name="DrawDallEService"):
except Exception as e:
print(e)
traceback.print_exc()
await ctx.respond("Something went wrong. Please try again later.", ephemeral=from_action)
await ctx.respond(
"Something went wrong. Please try again later.", ephemeral=from_action
)
await ctx.send_followup(e, ephemeral=from_action)
async def draw_action(self, ctx, message):

@ -979,5 +979,10 @@ class GPT3ComCon(discord.Cog, name="GPT3ComCon"):
"""
Text-based context menu commands from here
"""
async def ask_gpt_action(self, ctx, message: discord.Message): # message commands return the message
await self.ask_command(ctx, message.content, None, None, None, None, from_action=message.content)
async def ask_gpt_action(
self, ctx, message: discord.Message
): # message commands return the message
await self.ask_command(
ctx, message.content, None, None, None, None, from_action=message.content
)

Loading…
Cancel
Save