phone-act-x
微信视频号私信自动回复 — 贷款业务场景
安装
pip install phone-act-x
无头浏览器模式额外依赖:
pip install playwright
python -m playwright install chromium
配置
设置环境变量(WorkBuddy 里 os.environ 或在终端 export):
export BOT_PHONE="138xxxx1234" # 你的手机号(必填)
export BOT_LOCATION="我在深圳,可全国放款" # 你的所在地(选填)
AI 回复需要额外配置(选填):
export AI_API_KEY="your-api-key"
export AI_API_URL="https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions"
export AI_MODEL="qwen3.7-plus"
使用
规则引擎
from phone_act import process
result = process("征信不好")
print(result["reply"]) # 您爱人征信怎么样?
无头浏览器登录(两步)
from phone_act.headless import save_qrcode, confirm_login
# 第一步:生成二维码
save_qrcode()
# → 打开 browser_data/qrcode.png,微信扫一扫
# 第二步:确认登录
confirm_login()
启动自动回复
from phone_act import EnhancedBot
EnhancedBot().run() # 双Tab监控 + AI 回复 + 防风控
CLI
phone-act "征信不好" # 测试规则匹配
phone-act --init # 生成默认规则文件
phone-act-headless --qr # 生成登录二维码
phone-act-headless --confirm-login # 确认登录
phone-act-enhanced # 启动增强版机器人
phone-act-leads # 导出留号客户
对话流
客户: "你好" → bot: "您今年多大了?"
客户: "35" → bot: "您征信怎么样?"
客户: "征信不太好" → bot: "您爱人征信怎么样?"
客户: "也没问题" → bot: "怎么联系你?"
客户: "138xxxx" → bot: "好的,收到,稍后联系您!" → 停止
特性
- 同义词归一化("征信不太好"→"征信不好")
- 对话流状态机,自动追问到拿号码
- 万能回复模板,随机换问法
- 双Tab监控(打招呼 + 私信),跨Tab去重
- AI 回复为主,规则兜底
- 防风控:随机轮询 / 夜间免打扰 / 拟人化延迟 / 每日上限
- 健康检查:登录态 + AI 可用性告警
- 30s轮询 + 随机抖动防封号
- 手机号检测自动停止
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
phone_act_x-1.7.3.tar.gz
(30.7 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file phone_act_x-1.7.3.tar.gz.
File metadata
- Download URL: phone_act_x-1.7.3.tar.gz
- Upload date:
- Size: 30.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
11e7d8a82efb40963b0bcf9421a84fef06ddac7424f03ef30879e31c4675035e
|
|
| MD5 |
d5241740580582c8770d763cdb39c92d
|
|
| BLAKE2b-256 |
893567310b67c355b4eba94d7236a9ad1aa8c12cb6207c52115b1f2c3b201c80
|
File details
Details for the file phone_act_x-1.7.3-py3-none-any.whl.
File metadata
- Download URL: phone_act_x-1.7.3-py3-none-any.whl
- Upload date:
- Size: 29.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
45a9672e8f21f89535fb18b3de75daf6d25a2fd617743034cdb4e196542ab990
|
|
| MD5 |
d28ffdeb06a21c2060c565c31b69e016
|
|
| BLAKE2b-256 |
e9b0727c86d8863c4e90b75efd9ff322592d648c47c9664207b6448350ad448a
|