Browse Source

忽略引用消息

master
lanvent 1 year ago
parent
commit
df3f19b534
1 changed files with 6 additions and 1 deletions
  1. +6
    -1
      channel/wechat/wechat_channel.py

+ 6
- 1
channel/wechat/wechat_channel.py View File

@@ -46,6 +46,9 @@ class WechatChannel(Channel):
other_user_id = msg['User']['UserName'] # 对手方id other_user_id = msg['User']['UserName'] # 对手方id
content = msg['Text'] content = msg['Text']
match_prefix = self.check_prefix(content, conf().get('single_chat_prefix')) match_prefix = self.check_prefix(content, conf().get('single_chat_prefix'))
if "」\n- - - - - - - - - - - - - - -" in content:
logger.debug("[WX]reference query skipped")
return
if from_user_id == other_user_id and match_prefix is not None: if from_user_id == other_user_id and match_prefix is not None:
# 好友向自己发送消息 # 好友向自己发送消息
if match_prefix != '': if match_prefix != '':
@@ -87,7 +90,9 @@ class WechatChannel(Channel):
content = context_special_list[1] content = context_special_list[1]
elif len(content_list) == 2: elif len(content_list) == 2:
content = content_list[1] content = content_list[1]

if "」\n- - - - - - - - - - - - - - -" in content:
logger.debug("[WX]reference query skipped")
return ""
config = conf() config = conf()
match_prefix = (msg['IsAt'] and not config.get("group_at_off", False)) or self.check_prefix(origin_content, config.get('group_chat_prefix')) \ match_prefix = (msg['IsAt'] and not config.get("group_at_off", False)) or self.check_prefix(origin_content, config.get('group_chat_prefix')) \
or self.check_contain(origin_content, config.get('group_chat_keyword')) or self.check_contain(origin_content, config.get('group_chat_keyword'))


Loading…
Cancel
Save