pip install itchat
Note: the API changes quite often, but documentations does not. What I suggest is install from git:
git clone https://github.com/littlecodersh/ItChat.git
and stick to a stable version (current version: v1.3.9, July 15, 2017).
import itchat itchat.auto_login(enableCmdQR=True)
- UserName (string): a long string that starts with ‘@’
- City (string): city
- Province (string): province
- RemarkName (string): the remark name of the person (input by yourself)
- Signature (string): signature
- NickName (string): the name of the person
- HeadImgUrl (string): a relative url to the head image
- Sex (int): 1 for male; 2 for female; (default 0)
returns a itchat.storage.templates.ContactList object, which contains a list ofitchat.storage.templates.User object.
itchat.send(message: string, username: string)