mirror of
https://github.com/zhayujie/chatgpt-on-wechat.git
synced 2026-07-20 21:57:14 +08:00
Signed-off-by: 6vision <vision_wangpc@sina.com>
This commit is contained in:
@@ -56,17 +56,22 @@ class WechatMessage(ChatMessage):
|
|||||||
self.content = itchat_msg["Content"]
|
self.content = itchat_msg["Content"]
|
||||||
self.actual_user_nickname = re.findall(r"\"(.*?)\"", itchat_msg["Content"])[0]
|
self.actual_user_nickname = re.findall(r"\"(.*?)\"", itchat_msg["Content"])[0]
|
||||||
|
|
||||||
|
elif any(note_patpat in itchat_msg["Content"] for note_patpat in notes_patpat): # 若有任何在notes_patpat列表中的字符串出现在NOTE中:
|
||||||
|
self.ctype = ContextType.PATPAT
|
||||||
|
self.content = itchat_msg["Content"]
|
||||||
|
if "拍了拍我" in itchat_msg["Content"]: # 识别中文
|
||||||
|
self.actual_user_nickname = re.findall(r"\"(.*?)\"", itchat_msg["Content"])[0]
|
||||||
|
elif "tickled my" in itchat_msg["Content"] or "tickled me" in itchat_msg["Content"]:
|
||||||
|
self.actual_user_nickname = re.findall(r'^(.*?)(?:tickled my|tickled me)', itchat_msg["Content"])[0]
|
||||||
|
else:
|
||||||
|
raise NotImplementedError("Unsupported note message: " + itchat_msg["Content"])
|
||||||
|
|
||||||
elif "你已添加了" in itchat_msg["Content"]: #通过好友请求
|
elif "你已添加了" in itchat_msg["Content"]: #通过好友请求
|
||||||
self.ctype = ContextType.ACCEPT_FRIEND
|
self.ctype = ContextType.ACCEPT_FRIEND
|
||||||
self.content = itchat_msg["Content"]
|
self.content = itchat_msg["Content"]
|
||||||
elif any(note_patpat in itchat_msg["Content"] for note_patpat in notes_patpat): # 若有任何在notes_patpat列表中的字符串出现在NOTE中:
|
elif any(note_patpat in itchat_msg["Content"] for note_patpat in notes_patpat): # 若有任何在notes_patpat列表中的字符串出现在NOTE中:
|
||||||
self.ctype = ContextType.PATPAT
|
self.ctype = ContextType.PATPAT
|
||||||
self.content = itchat_msg["Content"]
|
self.content = itchat_msg["Content"]
|
||||||
if is_group:
|
|
||||||
if "拍了拍我" in itchat_msg["Content"]: # 识别中文
|
|
||||||
self.actual_user_nickname = re.findall(r"\"(.*?)\"", itchat_msg["Content"])[0]
|
|
||||||
elif ("tickled my" in itchat_msg["Content"] or "tickled me" in itchat_msg["Content"]):
|
|
||||||
self.actual_user_nickname = re.findall(r'^(.*?)(?:tickled my|tickled me)', itchat_msg["Content"])[0]
|
|
||||||
else:
|
else:
|
||||||
raise NotImplementedError("Unsupported note message: " + itchat_msg["Content"])
|
raise NotImplementedError("Unsupported note message: " + itchat_msg["Content"])
|
||||||
elif itchat_msg["Type"] == ATTACHMENT:
|
elif itchat_msg["Type"] == ATTACHMENT:
|
||||||
|
|||||||
Reference in New Issue
Block a user