mirror of
https://github.com/zhayujie/chatgpt-on-wechat.git
synced 2026-04-17 17:43:01 +08:00
add reply_suffix
增加私聊和群聊回复后缀的可选配置
This commit is contained in:
@@ -223,9 +223,9 @@ class ChatChannel(Channel):
|
|||||||
return self._decorate_reply(context, reply)
|
return self._decorate_reply(context, reply)
|
||||||
if context.get("isgroup", False):
|
if context.get("isgroup", False):
|
||||||
reply_text = "@" + context["msg"].actual_user_nickname + "\n" + reply_text.strip()
|
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:
|
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
|
reply.content = reply_text
|
||||||
elif reply.type == ReplyType.ERROR or reply.type == ReplyType.INFO:
|
elif reply.type == ReplyType.ERROR or reply.type == ReplyType.INFO:
|
||||||
reply.content = "[" + str(reply.type) + "]\n" + reply.content
|
reply.content = "[" + str(reply.type) + "]\n" + reply.content
|
||||||
|
|||||||
Reference in New Issue
Block a user