🐛 修复临时翻译无法使用的问题

This commit is contained in:
Xtao_dada 2020-11-28 22:39:12 +08:00 committed by GitHub
parent 7e1ccdd7a1
commit 07ab091176
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -33,7 +33,7 @@ async def translate(context):
result = translator.translate(clear_emojis(message), dest=lang)
except:
from translate import Translator as trans
result = trans(to_lang=lang.replace('zh-cn', 'cn').translate(clear_emojis(message))
result = trans(to_lang=lang.replace('zh-cn', 'zh')).translate(clear_emojis(message))
except ValueError:
await context.edit("出错了呜呜呜 ~ 找不到目标语言,请更正配置文件中的错误。")
return