![]() ![]() ![]() Q: Why I can’t send files whose name is encoded in utf8?Ī: That’s because of the upload setting of requests, you can put this file (for p圓 you need this) into packages/urllib3 of requests package. If you exit through phone, exitCallback will also be called. If loginCallback is not set, qr picture will be deleted and cmd will be cleared. auto_login ( loginCallback = lc, exitCallback = ec ) time. import time import itchat def lc (): print ( 'finish login' ) def ec (): print ( 'exit' ) itchat. run ()Ĭallback of login and logout are set through loginCallback and exitCallback. TEXT ) def reply ( msg ): return msg newInstance. auto_login ( hotReload = True, statusStorageDir = 'newInstance.pkl' ). You may use the following commands to open multi instance. msg_register () def download_files ( msg ): with open ( msg. If you don’t want a local copy of the picture, you may pass nothing to the function to get a binary string. send ( %s %s ' % ( 'img' if msg = 'Picture' else 'fil', msg ), msg ) return ' %s received' % msg msg_register () def download_files ( msg ): msg. Name of the file (default name of picture) is in FileName key of msgĭownload function accept one location value (include the file name) and store attachment accordingly. The attachment download function of itchat is in Text key of msg There are detailed information about searching and getting of massive platforms and chatrooms in document. search_friends ( name = 'LittleCoder机器人', wechatAccount = 'littlecodersh' ) search_friends ( wechatAccount = 'littlecodersh' ) # combination of way 3, 4 itchat. search_friends ( name = 'littlecodersh' ) # get user information of function 4 itchat. search_friends ( userName = ) # get user information of function 3 itchat. search_friends () # get user information of specific username itchat. ![]() Way 3, 4 can be used together, the following is the demo program: # get your own user information itchat.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |