From 5493566ba61f382320d68012ad1b2c03c12d6673 Mon Sep 17 00:00:00 2001 From: ikaros <327209194@qq.com> Date: Tue, 5 Sep 2023 23:06:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=90=8E=E7=BD=AE=E5=9B=9E?= =?UTF-8?q?=E5=A4=8D=E6=B2=A1=E6=B3=95=E5=85=B3=E9=97=AD=20=E5=BF=B5?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=90=8D=20=E7=9A=84bug=EF=BC=9B=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E9=83=A8=E5=88=86=E6=97=A0=E5=85=B3=E7=B4=A7=E8=A6=81?= =?UTF-8?q?=E7=9A=84=E8=BF=9D=E7=A6=81=E8=AF=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 4 ++++ config.json | 2 +- data/badwords.txt | 6 ------ utils/audio.py | 18 +++++++++++------- 4 files changed, 16 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 9143c167..5daf9ee7 100644 --- a/README.md +++ b/README.md @@ -1271,6 +1271,10 @@ cmd运行`npm i docsify-cli -g`
展开/收起 +- 2023-09-05 + - 修复后置回复没法关闭 念用户名 的bug + - 删除部分无关紧要的违禁词 + - 2023-06-13 - 兼容本地版ChatGLM API接口 diff --git a/config.json b/config.json index 43b8ff59..a318b9e3 100644 --- a/config.json +++ b/config.json @@ -83,7 +83,7 @@ "api_key": [ "修改为你的api_key" ], - "model": "gpt-3.5-turbo-0301" + "model": "gpt-3.5-turbo" }, "claude": { "slack_user_token": "", diff --git a/data/badwords.txt b/data/badwords.txt index d8166991..d5454bfd 100644 --- a/data/badwords.txt +++ b/data/badwords.txt @@ -1694,12 +1694,10 @@ 毛静坐 鸡巴 你老妹 -账号 豔乳 破鞋 李铁映 九評 -建筑 朱镕基 金卡 肾源 @@ -2078,7 +2076,6 @@ 交通部 厲無畏 回回 -视频 导弹 欠人骑 毛鸡奸 @@ -3280,7 +3277,6 @@ 你色吗 傅志寰 孙政才 -商务 双规 反目 传单 @@ -3917,7 +3913,6 @@ 康日新 台盟 扉之陰 -管理 肛交 去你妈 溫加寶 @@ -5235,7 +5230,6 @@ 狗娘养 蒲友 巨商 -长期 伊斯蘭 比样 铃声 diff --git a/utils/audio.py b/utils/audio.py index 9281747e..d9284148 100644 --- a/utils/audio.py +++ b/utils/audio.py @@ -235,13 +235,17 @@ def audio_synthesis(self, message): "content": message["content"] } - # 由于线程是独立的,所以回复音频的合成会慢于本地音频直接播放,所以以倒述的形式回复 - tmp_message = deepcopy(message) - tmp_message['type'] = "reply" - tmp_message['content'] = random.choice(self.config.get("read_user_name", "reply_after")) - if "{username}" in tmp_message['content']: - tmp_message['content'] = tmp_message['content'].format(username=message['user_name']) - self.message_queue.put(tmp_message) + # 回复时是否念用户名字 + if self.config.get("read_user_name", "enable"): + # 由于线程是独立的,所以回复音频的合成会慢于本地音频直接播放,所以以倒述的形式回复 + tmp_message = deepcopy(message) + tmp_message['type'] = "reply" + tmp_message['content'] = random.choice(self.config.get("read_user_name", "reply_after")) + if "{username}" in tmp_message['content']: + tmp_message['content'] = tmp_message['content'].format(username=message['user_name']) + self.message_queue.put(tmp_message) + else: + self.message_queue.put(message) # 是否开启了音频播放,如果没开,则不会传文件路径给播放队列 if self.config.get("play_audio", "enable"):