Skip to main content

phone-act-x

微信视频号私信自动回复 — 贷款业务场景


部署指南(WorkBuddy 里操作)

第一步:安装

pip install --upgrade phone-act-x playwright
python -m playwright install chromium

每行单独执行一次,等它跑完再执行下一行。这一步只做一次,以后不用重复。

第二步:填写你的信息

⚠️ 首次使用需要先向管理员要一个授权码(AUTH_TOKEN),否则无法启动。

import os
os.environ["BOT_PHONE"] = "13912345678"             # 改成你的11位手机号
os.environ["AUTH_TOKEN"] = "管理员给你的token"        # 必填,向管理员索要
os.environ["BOT_LOCATION"] = "我在深圳,可全国放款"   # 改成你的所在地

如果你要用 AI 回复(更聪明),还要加三行:

os.environ["AI_API_KEY"] = "你的key"
os.environ["AI_API_URL"] = "https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions"
os.environ["AI_MODEL"] = "qwen3.7-plus"

第三步:扫码登录

from phone_act.headless import save_qrcode
save_qrcode()

执行后会在当前目录生成 browser_data/qrcode.png,打开这个图片,用微信扫一扫。然后执行:

from phone_act.headless import confirm_login
confirm_login()

看到 [CONFIRM] login success! state saved 就说明登录成功了。这一步只做一次,cookie 会持久保存。

第四步:启动机器人

无 AI 模式(免费,纯规则自动回复):

from phone_act.headless import VideoChannelBot
bot = VideoChannelBot()
bot.start()
bot.run_forever()

AI 模式(更智能,需 AI key):

from phone_act import EnhancedBot
EnhancedBot().run()

看到 [BOT] baseline done, polling... 就说明开始跑了。Ctrl+C 停止

第五步:导出客户号码

每天结束时执行:

phone-act-leads          # 今天新增的留号客户
phone-act-leads --all    # 全部历史

会生成 leads.md 文件,打开即可看到客户名称和手机号。


日常操作总结

做什么 执行什么 多久一次
早上来启动 EnhancedBot().run() 每天
晚上下班 Ctrl+C 停掉 每天
看新客户号码 phone-act-leads 每天下班前
登录过期了 重新走第三步 偶尔(几天到几周)
换手机号了 改第二步的 BOT_PHONE 需要时

机器人回复逻辑

  1. 新客户打招呼 → 问年龄 → 问征信 → 征信不好问爱人 → 要号码 → 拿到号码停止
  2. 客户问"怎么联系你" → 不说你的号码,先要对方的
  3. 客户坚持要你的联系方式 → 用中文分段给号码,如 "记下号码 壹叁捌,零零壹叁,捌零零零,加微信聊"
  4. 检测到客户发来11位手机号 → 自动记下来,停止追问

常见问题

Q: 收到提醒 "BOT_PHONE 未设置"? A: 第二步没执行或手机号不对,重新执行第二步。

Q: 提示 "state.json not found"? A: 还没登录或登录过期了,重新走第三步。

Q: 机器人怎么不回复了? A: 可能登录过期了,重新扫码;或者达到每日上限了(默认100条/天)。

Q: 提示 "授权失败"? A: 你的手号换了,AUTH_TOKEN 是绑定手机号的,找管理员重新要一个。


管理员:为新销售生成授权码

phone-act --gen-token 13912345678

输出示例:

手机号: 13912345678
Token:  c50a618f9711c986

销售配置:
  os.environ["AUTH_TOKEN"] = "c50a618f9711c986"

把 Token 发给对应销售即可。Token 绑定手机号,换了号码需要重新生成。


环境变量参考

变量 必填 说明 默认值
BOT_PHONE 你的11位手机号
AUTH_TOKEN 管理员给的授权码
BOT_LOCATION 所在地 "我在北京,可全国放款"
AI_API_KEY AI key
AI_API_URL AI 接口 dashscope 兼容模式
AI_MODEL AI 模型 qwen3.7-plus
BOT_DAILY_LIMIT 每天最多回多少条 100
BOT_POLL_MIN 最短轮询间隔(秒) 25
BOT_POLL_MAX 最长轮询间隔(秒) 45

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.6.tar.gz (33.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

phone_act_x-1.7.6-py3-none-any.whl (32.0 kB view details)

Uploaded Python 3

File details

Details for the file phone_act_x-1.7.6.tar.gz.

File metadata

  • Download URL: phone_act_x-1.7.6.tar.gz
  • Upload date:
  • Size: 33.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.4

File hashes

Hashes for phone_act_x-1.7.6.tar.gz
Algorithm Hash digest
SHA256 290b5de5f46884ad373166331b69cadf846e504c0e489b43a1c4660547961d5a
MD5 63ff2b6372eaaff3e9b68254eeccf549
BLAKE2b-256 c71ee78a576ac4d8219f85f47f3c18399cd4f707d32a6bb33b69f5b4566c822e

See more details on using hashes here.

File details

Details for the file phone_act_x-1.7.6-py3-none-any.whl.

File metadata

  • Download URL: phone_act_x-1.7.6-py3-none-any.whl
  • Upload date:
  • Size: 32.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.4

File hashes

Hashes for phone_act_x-1.7.6-py3-none-any.whl
Algorithm Hash digest
SHA256 471c1455462e6d45bee604025d2b5f00fa9bdcaf21c35393e770ddd10c712dfb
MD5 9a1c13cc4118911e5e3d6bd7bca3c2e3
BLAKE2b-256 1f986f2fe999539b8aba2e30190713c0f703a0722bb08813cc2eae9550591979

See more details on using hashes here.

Release history Release notifications | RSS feed

1.8.0

2 files

1.7.9

2 files

1.7.8

2 files

1.7.7

2 files

This release

1.7.6 This release

2 files

1.7.5

2 files

1.7.3

2 files

1.7.2

2 files

1.7.1

2 files

1.7.0

2 files

1.6.1

2 files

1.6.0

2 files

1.5.0

2 files

1.4.2

2 files

1.4.1

2 files

1.4.0

2 files

1.3.1

2 files

1.2.9

2 files

1.2.8

2 files

1.2.7

2 files

1.2.6

2 files

1.2.5

2 files

1.2.4

2 files

1.2.3

2 files

1.2.2

2 files

1.2.1

2 files

1.2.0

2 files

1.1.0

2 files

1.0.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page