Skip to content

Commit

Permalink
Merge pull request #288 from Ikaros-521/owner
Browse files Browse the repository at this point in the history
修复后置回复没法关闭 念用户名 的bug;删除部分无关紧要的违禁词
  • Loading branch information
Ikaros-521 authored Sep 5, 2023
2 parents b5f2769 + 5493566 commit c80b1fa
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 14 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1271,6 +1271,10 @@ cmd运行`npm i docsify-cli -g`
<details>
<summary>展开/收起</summary>

- 2023-09-05
- 修复后置回复没法关闭 念用户名 的bug
- 删除部分无关紧要的违禁词

- 2023-06-13
- 兼容本地版ChatGLM API接口

Expand Down
2 changes: 1 addition & 1 deletion config.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
"api_key": [
"修改为你的api_key"
],
"model": "gpt-3.5-turbo-0301"
"model": "gpt-3.5-turbo"
},
"claude": {
"slack_user_token": "",
Expand Down
6 changes: 0 additions & 6 deletions data/badwords.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1694,12 +1694,10 @@
毛静坐
鸡巴
你老妹
账号
豔乳
破鞋
李铁映
九評
建筑
朱镕基
金卡
肾源
Expand Down Expand Up @@ -2078,7 +2076,6 @@
交通部
厲無畏
回回
视频
导弹
欠人骑
毛鸡奸
Expand Down Expand Up @@ -3280,7 +3277,6 @@
你色吗
傅志寰
孙政才
商务
双规
反目
传单
Expand Down Expand Up @@ -3917,7 +3913,6 @@
康日新
台盟
扉之陰
管理
肛交
去你妈
溫加寶
Expand Down Expand Up @@ -5235,7 +5230,6 @@
狗娘养
蒲友
巨商
长期
伊斯蘭
比样
铃声
Expand Down
18 changes: 11 additions & 7 deletions utils/audio.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"):
Expand Down

0 comments on commit c80b1fa

Please sign in to comment.