Appearance
其他
登录相关
refresh_qrcode
刷新登录二维码。
python
wechat.refresh_qrcode(client_id)logout
退出登录。
python
wechat.logout(client_id)exit
退出微信。
python
wechat.exit(client_id)界面操作
open_chat
切换当前会话(4.x 失效)。
python
wechat.open_chat(client_id, to_wxid)| 参数 | 类型 | 说明 |
|---|---|---|
| client_id | int | 客户端ID |
| to_wxid | str | 目标wxid |
clear_chat_history
清除聊天记录。
python
wechat.clear_chat_history(client_id)功能接口
get_a8key
A8Key 接口。
python
wechat.get_a8key(client_id, url, timeout=None)| 参数 | 类型 | 说明 |
|---|---|---|
| client_id | int | 客户端ID |
| url | str | 链接地址 |
| timeout | int | 超时时间(秒) |
confirm_receipt
确认收款。
python
wechat.confirm_receipt(client_id, transfer_id, timeout=None)| 参数 | 类型 | 说明 |
|---|---|---|
| client_id | int | 客户端ID |
| transfer_id | str | 转账ID |
| timeout | int | 超时时间(秒) |
pin_chat
置顶/取消置顶聊天。
python
wechat.pin_chat(client_id, wxid, status, timeout=None)| 参数 | 类型 | 说明 |
|---|---|---|
| client_id | int | 客户端ID |
| wxid | str | 聊天wxid |
| status | int | 1置顶 0取消 |
| timeout | int | 超时时间(秒) |
set_disturb
免打扰设置。
python
wechat.set_disturb(client_id, wxid, status, timeout=None)| 参数 | 类型 | 说明 |
|---|---|---|
| client_id | int | 客户端ID |
| wxid | str | 聊天wxid |
| status | int | 1开启 0关闭 |
| timeout | int | 超时时间(秒) |
voice_to_text
语音消息转文本(旧接口,4.x 失效)。
python
wechat.voice_to_text(client_id, msg_id, timeout=None)| 参数 | 类型 | 说明 |
|---|---|---|
| client_id | int | 客户端ID |
| msg_id | str | 消息ID |
| timeout | int | 超时时间(秒) |
get_collections
获取收藏列表。
python
wechat.get_collections(client_id, timeout=None)| 参数 | 类型 | 说明 |
|---|---|---|
| client_id | int | 客户端ID |
| timeout | int | 超时时间(秒) |
get_mini_program_code
获取小程序授权 code。
python
wechat.get_mini_program_code(client_id, appid, timeout=None)| 参数 | 类型 | 说明 |
|---|---|---|
| client_id | int | 客户端ID |
| appid | str | 小程序AppID |
| timeout | int | 超时时间(秒) |
数据库操作
query_db
查询数据库。
python
wechat.query_db(client_id, db_name, sql, timeout=None)| 参数 | 类型 | 说明 |
|---|---|---|
| client_id | int | 客户端ID |
| db_name | str | 数据库名称 |
| sql | str | SQL查询语句 |
| timeout | int | 超时时间(秒) |
exec_sql
执行 SQL 语句。
python
wechat.exec_sql(client_id, db_name, sql, timeout=None)| 参数 | 类型 | 说明 |
|---|---|---|
| client_id | int | 客户端ID |
| db_name | str | 数据库名称 |
| sql | str | SQL语句 |
| timeout | int | 超时时间(秒) |