Format Python code with psf/black push

github-actions 1 year ago
parent 0b168553c3
commit e707d18806

@ -534,10 +534,16 @@ class Commands(discord.Cog, name="Commands"):
)
@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

@ -74,7 +74,9 @@ class TranslationService(discord.Cog, name="TranslationService"):
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}")

Loading…
Cancel
Save