Skip to content

其他

登录相关

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_idint客户端ID
to_wxidstr目标wxid

clear_chat_history

清除聊天记录。

python
wechat.clear_chat_history(client_id)

功能接口

get_a8key

A8Key 接口。

python
wechat.get_a8key(client_id, url, timeout=None)
参数类型说明
client_idint客户端ID
urlstr链接地址
timeoutint超时时间(秒)

confirm_receipt

确认收款。

python
wechat.confirm_receipt(client_id, transfer_id, timeout=None)
参数类型说明
client_idint客户端ID
transfer_idstr转账ID
timeoutint超时时间(秒)

pin_chat

置顶/取消置顶聊天。

python
wechat.pin_chat(client_id, wxid, status, timeout=None)
参数类型说明
client_idint客户端ID
wxidstr聊天wxid
statusint1置顶 0取消
timeoutint超时时间(秒)

set_disturb

免打扰设置。

python
wechat.set_disturb(client_id, wxid, status, timeout=None)
参数类型说明
client_idint客户端ID
wxidstr聊天wxid
statusint1开启 0关闭
timeoutint超时时间(秒)

voice_to_text

语音消息转文本(旧接口,4.x 失效)。

python
wechat.voice_to_text(client_id, msg_id, timeout=None)
参数类型说明
client_idint客户端ID
msg_idstr消息ID
timeoutint超时时间(秒)

get_collections

获取收藏列表。

python
wechat.get_collections(client_id, timeout=None)
参数类型说明
client_idint客户端ID
timeoutint超时时间(秒)

get_mini_program_code

获取小程序授权 code。

python
wechat.get_mini_program_code(client_id, appid, timeout=None)
参数类型说明
client_idint客户端ID
appidstr小程序AppID
timeoutint超时时间(秒)

数据库操作

query_db

查询数据库。

python
wechat.query_db(client_id, db_name, sql, timeout=None)
参数类型说明
client_idint客户端ID
db_namestr数据库名称
sqlstrSQL查询语句
timeoutint超时时间(秒)

exec_sql

执行 SQL 语句。

python
wechat.exec_sql(client_id, db_name, sql, timeout=None)
参数类型说明
client_idint客户端ID
db_namestr数据库名称
sqlstrSQL语句
timeoutint超时时间(秒)

基于 MIT 许可证发布