Appearance
联系人
get_self_info
获取当前登录账号信息。
python
wechat.get_self_info(client_id, timeout=None)| 参数 | 类型 | 说明 |
|---|---|---|
| client_id | int | 客户端ID |
| timeout | int | 超时时间(秒) |
get_contacts
获取好友列表。
python
wechat.get_contacts(client_id, timeout=None)| 参数 | 类型 | 说明 |
|---|---|---|
| client_id | int | 客户端ID |
| timeout | int | 超时时间(秒) |
get_contact
获取指定好友信息。
python
wechat.get_contact(client_id, wxid, timeout=None)| 参数 | 类型 | 说明 |
|---|---|---|
| client_id | int | 客户端ID |
| wxid | str | 好友wxid |
| timeout | int | 超时时间(秒) |
get_contact_by_protocol
获取好友简要信息(协议)。
python
wechat.get_contact_by_protocol(client_id, wxid, timeout=None)| 参数 | 类型 | 说明 |
|---|---|---|
| client_id | int | 客户端ID |
| wxid | str | 好友wxid |
| timeout | int | 超时时间(秒) |
get_contact_detail_by_protocol
获取好友详细信息(协议)。
python
wechat.get_contact_detail_by_protocol(client_id, wxid, timeout=None)| 参数 | 类型 | 说明 |
|---|---|---|
| client_id | int | 客户端ID |
| wxid | str | 好友wxid |
| timeout | int | 超时时间(秒) |
get_contacts_by_protocol
批量获取好友信息(协议)。
python
wechat.get_contacts_by_protocol(client_id, wxids, timeout=None)| 参数 | 类型 | 说明 |
|---|---|---|
| client_id | int | 客户端ID |
| wxids | List[str] | wxid列表 |
| timeout | int | 超时时间(秒) |
modify_contact_remark
修改好友备注。
python
wechat.modify_contact_remark(client_id, wxid, remark, timeout=None)| 参数 | 类型 | 说明 |
|---|---|---|
| client_id | int | 客户端ID |
| wxid | str | 好友wxid |
| remark | str | 新备注 |
| timeout | int | 超时时间(秒) |
delete_friend
删除好友。
python
wechat.delete_friend(client_id, wxid, timeout=None)| 参数 | 类型 | 说明 |
|---|---|---|
| client_id | int | 客户端ID |
| wxid | str | 好友wxid |
| timeout | int | 超时时间(秒) |
accept_friend_request
同意加好友请求。
python
wechat.accept_friend_request(client_id, encrypt_username, ticket, scene=17, timeout=None)| 参数 | 类型 | 说明 |
|---|---|---|
| client_id | int | 客户端ID |
| encrypt_username | str | 加密用户名 |
| ticket | str | 验证票据 |
| scene | int | 来源场景(默认17) |
| timeout | int | 超时时间(秒) |
search_friend
搜索微信用户。
python
wechat.search_friend(client_id, search, timeout=None)| 参数 | 类型 | 说明 |
|---|---|---|
| client_id | int | 客户端ID |
| search | str | 搜索关键词(微信号/手机号) |
| timeout | int | 超时时间(秒) |
add_friend
添加搜索到的微信用户为好友。
python
wechat.add_friend(client_id, v1, v2, remark, timeout=None)| 参数 | 类型 | 说明 |
|---|---|---|
| client_id | int | 客户端ID |
| v1 | str | 搜索返回的v1 |
| v2 | str | 搜索返回的v2 |
| remark | str | 验证消息 |
| timeout | int | 超时时间(秒) |
add_friend_by_card
添加好友分享的名片。
python
wechat.add_friend_by_card(client_id, wxid, ticket, remark, timeout=None)| 参数 | 类型 | 说明 |
|---|---|---|
| client_id | int | 客户端ID |
| wxid | str | 名片用户wxid |
| ticket | str | 票据 |
| remark | str | 验证消息 |
| timeout | int | 超时时间(秒) |
add_friend_by_room
添加群成员为好友。
python
wechat.add_friend_by_room(client_id, room_wxid, wxid, remark, timeout=None)| 参数 | 类型 | 说明 |
|---|---|---|
| client_id | int | 客户端ID |
| room_wxid | str | 群wxid |
| wxid | str | 成员wxid |
| remark | str | 验证消息 |
| timeout | int | 超时时间(秒) |
check_friend_status
检测好友状态。
python
wechat.check_friend_status(client_id, wxid, timeout=None)| 参数 | 类型 | 说明 |
|---|---|---|
| client_id | int | 客户端ID |
| wxid | str | 好友wxid |
| timeout | int | 超时时间(秒) |