Skip to content

Commit 957f257

Browse files
authored
Merge pull request zhayujie#1257 from 6vision/master
add reply_suffix
2 parents 4dc5356 + 109b362 commit 957f257

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

channel/chat_channel.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,9 +223,9 @@ def _decorate_reply(self, context: Context, reply: Reply) -> Reply:
223223
return self._decorate_reply(context, reply)
224224
if context.get("isgroup", False):
225225
reply_text = "@" + context["msg"].actual_user_nickname + "\n" + reply_text.strip()
226-
reply_text = conf().get("group_chat_reply_prefix", "") + reply_text
226+
reply_text = conf().get("group_chat_reply_prefix", "") + reply_text + conf().get("group_chat_reply_suffix", "")
227227
else:
228-
reply_text = conf().get("single_chat_reply_prefix", "") + reply_text
228+
reply_text = conf().get("single_chat_reply_prefix", "") + reply_text + conf().get("single_chat_reply_suffix", "")
229229
reply.content = reply_text
230230
elif reply.type == ReplyType.ERROR or reply.type == ReplyType.INFO:
231231
reply.content = "[" + str(reply.type) + "]\n" + reply.content

config.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@
2222
# Bot触发配置
2323
"single_chat_prefix": ["bot", "@bot"], # 私聊时文本需要包含该前缀才能触发机器人回复
2424
"single_chat_reply_prefix": "[bot] ", # 私聊时自动回复的前缀,用于区分真人
25-
"group_chat_prefix": ["@bot"], # 群聊时包含该前缀则会触发机器人回复
25+
"single_chat_reply_suffix": "", # 私聊时自动回复的后缀,\n 可以换行
26+
"group_chat_prefix": ["@bot"], # 群聊时包含该前缀则会触发机器人回复
2627
"group_chat_reply_prefix": "", # 群聊时自动回复的前缀
28+
"group_chat_reply_suffix": "", # 群聊时自动回复的后缀,\n 可以换行
2729
"group_chat_keyword": [], # 群聊时包含该关键词则会触发机器人回复
2830
"group_at_off": False, # 是否关闭群聊时@bot的触发
2931
"group_name_white_list": ["ChatGPT测试群", "ChatGPT测试群2"], # 开启自动回复的群名称列表

0 commit comments

Comments
 (0)