|
7 | 7 |
|
8 | 8 | VERSION = "4.21.0" |
9 | 9 | DB_PATH = os.path.join(get_astrbot_data_path(), "data_v4.db") |
| 10 | +PERSONAL_WECHAT_CONFIG_METADATA = { |
| 11 | + "weixin_oc_base_url": { |
| 12 | + "description": "Base URL", |
| 13 | + "type": "string", |
| 14 | + "hint": "默认值: https://ilinkai.weixin.qq.com", |
| 15 | + }, |
| 16 | + "weixin_oc_bot_type": { |
| 17 | + "description": "扫码参数 bot_type", |
| 18 | + "type": "string", |
| 19 | + "hint": "默认值: 3", |
| 20 | + }, |
| 21 | + "weixin_oc_qr_poll_interval": { |
| 22 | + "description": "二维码状态轮询间隔(秒)", |
| 23 | + "type": "int", |
| 24 | + "hint": "每隔多少秒轮询一次二维码状态。", |
| 25 | + }, |
| 26 | + "weixin_oc_long_poll_timeout_ms": { |
| 27 | + "description": "getUpdates 长轮询超时时间(毫秒)", |
| 28 | + "type": "int", |
| 29 | + "hint": "会话消息拉取接口超时参数。", |
| 30 | + }, |
| 31 | + "weixin_oc_api_timeout_ms": { |
| 32 | + "description": "HTTP 请求超时(毫秒)", |
| 33 | + "type": "int", |
| 34 | + "hint": "通用 API 请求超时参数。", |
| 35 | + }, |
| 36 | + "weixin_oc_token": { |
| 37 | + "description": "登录后 token(可留空)", |
| 38 | + "type": "string", |
| 39 | + "hint": "扫码登录成功后会自动写入;高级场景可手动填写。", |
| 40 | + }, |
| 41 | +} |
10 | 42 |
|
11 | 43 | WEBHOOK_SUPPORTED_PLATFORMS = [ |
12 | 44 | "qq_official_webhook", |
@@ -364,6 +396,16 @@ class ChatProviderTemplate(TypedDict): |
364 | 396 | "callback_server_host": "0.0.0.0", |
365 | 397 | "port": 6198, |
366 | 398 | }, |
| 399 | + "个人微信": { |
| 400 | + "id": "weixin_personal", |
| 401 | + "type": "weixin_oc", |
| 402 | + "enable": False, |
| 403 | + "weixin_oc_base_url": "https://ilinkai.weixin.qq.com", |
| 404 | + "weixin_oc_bot_type": "3", |
| 405 | + "weixin_oc_qr_poll_interval": 1, |
| 406 | + "weixin_oc_long_poll_timeout_ms": 35_000, |
| 407 | + "weixin_oc_api_timeout_ms": 15_000, |
| 408 | + }, |
367 | 409 | "飞书(Lark)": { |
368 | 410 | "id": "lark", |
369 | 411 | "type": "lark", |
@@ -869,6 +911,7 @@ class ChatProviderTemplate(TypedDict): |
869 | 911 | "type": "bool", |
870 | 912 | "hint": "Webhook 模式下使用 AstrBot 统一 Webhook 入口,无需单独开启端口。回调地址为 /api/platform/webhook/{webhook_uuid}。", |
871 | 913 | }, |
| 914 | + **PERSONAL_WECHAT_CONFIG_METADATA, |
872 | 915 | "webhook_uuid": { |
873 | 916 | "invisible": True, |
874 | 917 | "description": "Webhook UUID", |
|
0 commit comments