diff --git a/channel/chat_channel.py b/channel/chat_channel.py index 6a2f11e81..ffb49c8bf 100644 --- a/channel/chat_channel.py +++ b/channel/chat_channel.py @@ -223,9 +223,9 @@ def _decorate_reply(self, context: Context, reply: Reply) -> Reply: return self._decorate_reply(context, reply) if context.get("isgroup", False): reply_text = "@" + context["msg"].actual_user_nickname + "\n" + reply_text.strip() - reply_text = conf().get("group_chat_reply_prefix", "") + reply_text + reply_text = conf().get("group_chat_reply_prefix", "") + reply_text + conf().get("group_chat_reply_suffix", "") else: - reply_text = conf().get("single_chat_reply_prefix", "") + reply_text + reply_text = conf().get("single_chat_reply_prefix", "") + reply_text + conf().get("single_chat_reply_suffix", "") reply.content = reply_text elif reply.type == ReplyType.ERROR or reply.type == ReplyType.INFO: reply.content = "[" + str(reply.type) + "]\n" + reply.content diff --git a/config.py b/config.py index 4befe9863..cdce26f75 100644 --- a/config.py +++ b/config.py @@ -22,8 +22,10 @@ # Bot触发配置 "single_chat_prefix": ["bot", "@bot"], # 私聊时文本需要包含该前缀才能触发机器人回复 "single_chat_reply_prefix": "[bot] ", # 私聊时自动回复的前缀,用于区分真人 - "group_chat_prefix": ["@bot"], # 群聊时包含该前缀则会触发机器人回复 + "single_chat_reply_suffix": "", # 私聊时自动回复的后缀,\n 可以换行 + "group_chat_prefix": ["@bot"], # 群聊时包含该前缀则会触发机器人回复 "group_chat_reply_prefix": "", # 群聊时自动回复的前缀 + "group_chat_reply_suffix": "", # 群聊时自动回复的后缀,\n 可以换行 "group_chat_keyword": [], # 群聊时包含该关键词则会触发机器人回复 "group_at_off": False, # 是否关闭群聊时@bot的触发 "group_name_white_list": ["ChatGPT测试群", "ChatGPT测试群2"], # 开启自动回复的群名称列表