@@ -19,27 +19,27 @@ def handle_response(ws_t, j: json):
19
19
RECV_SERVER_HINT : print ,
20
20
RECV_TXT_MSG : handle_recv_txt_msg ,
21
21
RECV_PIC_MSG : handle_recv_pic_msg ,
22
- RECV_GZH_MSG : print ,
22
+ # RECV_GZH_MSG: print,
23
23
RECV_SNS_MSG : print ,
24
24
RECV_HISTORY_MSG : print ,
25
25
RECV_APP_MSG : print ,
26
26
RECV_FRIEND_REQUEST : print ,
27
- RECV_STICKER_MSG : print ,
27
+ # RECV_STICKER_MSG: print,
28
28
RECV_XML_MSG : handle_recv_xml_txt ,
29
- RECV_DVC_MSG : print ,
29
+ # RECV_DVC_MSG: print,
30
30
RECV_VIDEO_MSG : print ,
31
31
RECV_MUSIC_MSG : print ,
32
32
RECV_CITE_MSG : print ,
33
33
RECV_APPAUDIO_MSG : print ,
34
34
RECV_HOOK_SNS : print ,
35
35
RECV_OTHER_MSG : print ,
36
- OP_READ_MSG_WHILE_OPEN_DVC : print ,
37
- OP_OPEN_CHAT_DVC : print ,
38
- OP_REFRESH_LIST_DVC : print ,
39
- OP_SNS_CHECK_UNREAD_DVC : print ,
40
- OP_SNS_SELF_ACTION_DVC : print ,
41
- OP_REFRESH_MSG_DVC : print ,
42
- OP_DELETE_CHATROOM_MSG_DVC : print ,
36
+ # OP_READ_MSG_WHILE_OPEN_DVC: print,
37
+ # OP_OPEN_CHAT_DVC: print,
38
+ # OP_REFRESH_LIST_DVC: print,
39
+ # OP_SNS_CHECK_UNREAD_DVC: print,
40
+ # OP_SNS_SELF_ACTION_DVC: print,
41
+ # OP_REFRESH_MSG_DVC: print,
42
+ # OP_DELETE_CHATROOM_MSG_DVC: print,
43
43
ADD_MEMBER_CHATROOM : print ,
44
44
DEL_MEMBER_CHATROOM : print ,
45
45
INVITE_MEMBER_CHATROOM : print ,
@@ -77,8 +77,9 @@ def handle_response(ws_t, j: json):
77
77
ENABLE_WECHAT_LOG : print ,
78
78
DISABLE_WECHAT_LOG : print
79
79
}
80
-
81
- action .get (resp_type , print )(j )
80
+ func = action .get (resp_type )
81
+ if func is not None :
82
+ func (j )
82
83
83
84
84
85
def handle_nick (j ):
@@ -114,8 +115,6 @@ def handle_wxuser_list(j):
114
115
115
116
116
117
def handle_recv_txt_msg (j ):
117
- print (j )
118
-
119
118
if j ['fromUser' ] == my_info .wx_id :
120
119
wx_id = j ['toUser' ]
121
120
else :
@@ -139,6 +138,11 @@ def handle_recv_txt_msg(j):
139
138
else :
140
139
wx_id = my_info .wx_id
141
140
141
+ print (content +
142
+ ' From: ' + j ['fromUser' ] +
143
+ ' To: ' + j ['toUser' ] +
144
+ ' \' type\' : ' + str (j ['type' ]))
145
+
142
146
chatbot = global_dict .get ((wx_id , room_id ))
143
147
144
148
is_citation = (grpCitationMode and is_room ) or (prvCitationMode and not is_room )
@@ -245,8 +249,9 @@ def handle_recv_xml_txt(j):
245
249
246
250
def handle_self_info (j ):
247
251
print (j )
248
- data = j [" data" ]
252
+ data = j [' data' ]
249
253
250
254
global my_info
251
- my_info = Selfinfo (data ["wxid" ], data ["name" ], data ["account" ], data ["currentDataPath" ], data ["dataSavePath" ],
252
- data ["dbKey" ])
255
+ my_info = Selfinfo (data ['wxid' ], data ['name' ], data ['account' ],
256
+ data ['currentDataPath' ], data ['dataSavePath' ],
257
+ data ['dbKey' ])
0 commit comments