Skip to content

Commit 648a04b

Browse files
authored
Merge pull request #2265 from 6vision/feat0825
Support configuration whether to be @ in group chat.
2 parents bdc86c1 + 02b7c70 commit 648a04b

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

channel/wechat/wechat_channel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ def handle_group(self, cmsg: ChatMessage):
202202
logger.debug(f"[WX]receive attachment msg, file_name={cmsg.content}")
203203
else:
204204
logger.debug("[WX]receive group msg: {}".format(cmsg.content))
205-
context = self._compose_context(cmsg.ctype, cmsg.content, isgroup=True, msg=cmsg)
205+
context = self._compose_context(cmsg.ctype, cmsg.content, isgroup=True, msg=cmsg, no_need_at=conf().get("no_need_at", False))
206206
if context:
207207
self.produce(context)
208208

config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"single_chat_reply_prefix": "[bot] ", # 私聊时自动回复的前缀,用于区分真人
2828
"single_chat_reply_suffix": "", # 私聊时自动回复的后缀,\n 可以换行
2929
"group_chat_prefix": ["@bot"], # 群聊时包含该前缀则会触发机器人回复
30+
"no_need_at": False, # 群聊回复时是否不需要艾特
3031
"group_chat_reply_prefix": "", # 群聊时自动回复的前缀
3132
"group_chat_reply_suffix": "", # 群聊时自动回复的后缀,\n 可以换行
3233
"group_chat_keyword": [], # 群聊时包含该关键词则会触发机器人回复

0 commit comments

Comments
 (0)