From 54f3118e21d0b0b239d45371f5f47a6135c8b912 Mon Sep 17 00:00:00 2001 From: NumberSir <52584526+NumberSir@users.noreply.github.com> Date: Tue, 4 Apr 2023 10:01:45 +0800 Subject: [PATCH] 0.3.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复回复时的空行[@issue/13](https://github.com/NumberSir/nonebot_plugin_baidutranslate/issues/13) --- README.md | 3 +++ nonebot_plugin_baidutranslate/data_source.py | 2 +- setup.py | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 434b19a..0b4713f 100644 --- a/README.md +++ b/README.md @@ -81,6 +81,9 @@ salt = "xxx" # 随机字符串 ## 更新日志 +> 2023-04-04 v0.3.2 +> - 修复回复时的空行[@issue/13](https://github.com/NumberSir/nonebot_plugin_baidutranslate/issues/13) +> > 2023-03-29 v0.3.1 > - 现在私聊也可用(但不推荐) > diff --git a/nonebot_plugin_baidutranslate/data_source.py b/nonebot_plugin_baidutranslate/data_source.py index 504f15c..069f8a8 100644 --- a/nonebot_plugin_baidutranslate/data_source.py +++ b/nonebot_plugin_baidutranslate/data_source.py @@ -31,7 +31,7 @@ async def _process_response(self, response: httpx.Response): json_data = response.json() if "error_code" not in json_data.keys(): # 通用翻译 _result = json_data['trans_result'][0] - res = f"\n原文:{_result['src']}\n译文:{_result['dst']}" + res = f"原文:{_result['src']}\n译文:{_result['dst']}" return "QAQ,翻译出来太长了,请发的短一些吧..." if len(res) > 2000 else res if json_data["error_code"] == 0: # 语种识别 diff --git a/setup.py b/setup.py index f05aecf..ee7a03e 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ setuptools.setup( name="nonebot_plugin_baidutranslate", - version="0.3.1", + version="0.3.2", author="Number_Sir", author_email="Number_Sir@126.com", keywords=["pip", "nonebot2", "nonebot", "nonebot_plugin"],