Small add-on: Goofish QR login + export Playwright state + Discord DM webhook forwarding
pip install -e .
cp .env.example .env # edit with credentials
# Playwright browser
python -m playwright install chromium
python -m bot.main- QR login on a headless server via Discord
/login qr(screenshots the real QR modal) - Exports a Playwright
storage_stateJSON via/login export_state(default:./xianyu_state.json) forUsagi-org/ai-goofish-monitor - Receives
ai-goofish-monitorwebhook notifications and forwards them as Discord DMs
| Requirement | Description |
|---|---|
| Python 3.11+ | Runtime |
| Discord bot token | Bot authentication |
| Goofish/Xianyu account | Scan QR from the 闲鱼 app |
| Chromium | Playwright browser |
| Command | Description |
|---|---|
/login qr |
Start QR login and receive QR image |
/login status |
Check whether the cookies/session are logged in |
/login export_state [path] |
Export storage_state JSON for ai-goofish-monitor |
In ai-goofish-monitor, set something like:
WEBHOOK_URL=http://<this-server>:8123/webhook/ai-goofish-monitor
WEBHOOK_METHOD=POST
WEBHOOK_HEADERS={"X-Webhook-Secret":"<optional secret>"}
WEBHOOK_BODY={"title":"{{title}}","content":"{{content}}"}
WEBHOOK_CONTENT_TYPE=JSONgoofish-watcher/
├── bot/
│ ├── main.py # discord client entry
│ └── commands/ # slash commands (login)
├── core/
│ ├── scanner.py # QR login + storage_state export
│ └── webhook_receiver.py # webhook -> DM forwarder
├── config.py # pydantic-settings config
├── Dockerfile
├── docker-compose.yml
└── goofish-watcher.service # systemd unit file
| Issue | Solution |
|---|---|
QR login says 非法访问 |
Goofish blocked the IP/session; try another IP or wait |
| Bot can't DM you | Enable DMs, verify DISCORD_USER_ID, and allow the bot to message |
| ai-goofish-monitor webhook not received | Check WEBHOOK_HOST/PORT/PATH, firewall, and optional secret |
- USAGE.md - setup guide, configuration, commands
- DEPLOY.md - production deployment (docker, systemd, vps)
MIT