Skip to content

Commit

Permalink
Format Python code with psf/black push
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions authored and github-actions committed Jan 16, 2023
1 parent 0b16855 commit e707d18
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
10 changes: 8 additions & 2 deletions cogs/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -534,10 +534,16 @@ async def draw_action(self, ctx, message: discord.Message):
)
@discord.guild_only()
async def translate(
self, ctx: discord.ApplicationContext, text: str, target_language: str, formality: str,
self,
ctx: discord.ApplicationContext,
text: str,
target_language: str,
formality: str,
):
if self.translations_cog:
await self.translations_cog.translate_command(ctx, text, target_language, formality)
await self.translations_cog.translate_command(
ctx, text, target_language, formality
)
else:
await ctx.respond(
"Translations are disabled on this server.", ephemeral=True
Expand Down
4 changes: 3 additions & 1 deletion cogs/translation_service_cog.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ async def translate_command(self, ctx, text, target_language, formality):

try:
response = await self.translation_model.send_translate_request(
text, TranslationModel.get_country_code_from_name(target_language), formality
text,
TranslationModel.get_country_code_from_name(target_language),
formality,
)
except aiohttp.ClientResponseError as e:
await ctx.respond(f"There was an error with the DeepL API: {e.message}")
Expand Down

0 comments on commit e707d18

Please sign in to comment.