File tree Expand file tree Collapse file tree 3 files changed +7
-10
lines changed Expand file tree Collapse file tree 3 files changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -133,7 +133,8 @@ def ForwardMessage(self , **params) -> Dict:
133133 return self .post (WECHAT_MSG_FORWARD_MESSAGE , ForwardMessageBody (** params ))
134134
135135 def GetQrcodeImage (self , ** params ):
136- return self .post (WECHAT_GET_QRCODE_IMAGE , GetQrcodeImageBody (** params ))
136+ r = requests .post ( f"http://127.0.0.1:{ self .port } /api/?type={ WECHAT_GET_QRCODE_IMAGE } " , data = GetQrcodeImageBody (** params ).json ())
137+ return r .content
137138
138139 #[自定义
139140 def GetDBHandle (self ) -> Union [None , int ]:
Original file line number Diff line number Diff line change 1212
1313Bus = EventBus ()
1414
15- BASE_PATH = '''C:\\ users\\ user\My Documents\WeChat Files\\ '''
15+ # BASE_PATH = '''C:\\users\\user\My Documents\WeChat Files\\'''
1616
1717class WeChatRobot :
1818 def __init__ (self , ip : str = "0.0.0.0" , port : int = 23456 ):
@@ -70,8 +70,9 @@ def receive_callback(self , msg):
7070
7171 msg ['type' ] = type_dict .get (msg ['type' ] , 'unhandled' )
7272
73- if 1 == msg ["isSendMsg" ] and 1 == msg ["isSendByPhone" ]:
74- Bus .emit ("self_msg" , msg )
73+ if (1 == msg ["isSendMsg" ]):
74+ if 1 == msg ["isSendByPhone" ]:
75+ Bus .emit ("self_msg" , msg )
7576 elif "chatroom" in msg ["sender" ]:
7677 Bus .emit ("group_msg" , msg )
7778 elif "gh_" in msg ["sender" ]:
@@ -115,9 +116,4 @@ def handle(self):
115116 return None
116117
117118 def __getattr__ (self , item : str ):
118- return self .api .exec_command (item )
119-
120- if __name__ == "__main__" :
121- robot = WeChatRobot ()
122-
123- robot .run (main_thread = True )
119+ return self .api .exec_command (item )
You can’t perform that action at this time.
0 commit comments