mirror of
https://github.com/yasirarism/MissKatyPyro.git
synced 2026-01-05 03:34:51 +00:00
Update misc_tools.py
This commit is contained in:
parent
27dda75ab6
commit
8d1e9a0962
1 changed files with 2 additions and 2 deletions
|
|
@ -132,10 +132,10 @@ async def translate(client, message):
|
||||||
my_translator = GoogleTranslator(source='auto', target=target_lang)
|
my_translator = GoogleTranslator(source='auto', target=target_lang)
|
||||||
try:
|
try:
|
||||||
tresult = my_translator.translate(text=text)
|
tresult = my_translator.translate(text=text)
|
||||||
await msg.edit(f"Translation using source = {my_translator.source} and target = {my_translator.target}\n\n-> {result}")
|
return await msg.edit(f"Translation using source = {my_translator.source} and target = {my_translator.target}\n\n-> {result}")
|
||||||
except MessageTooLong:
|
except MessageTooLong:
|
||||||
url = await rentry(tresult)
|
url = await rentry(tresult)
|
||||||
await msg.edit(f"Your translated text pasted to rentry because has long text:\n{url}")
|
return await msg.edit(f"Your translated text pasted to rentry because has long text:\n{url}")
|
||||||
except Exception as err:
|
except Exception as err:
|
||||||
await msg.edit(f"ERROR: <code>{str(err)}</code>")
|
await msg.edit(f"ERROR: <code>{str(err)}</code>")
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue