Skip to content

Commit db60f3c

Browse files
authored
Merge branch 'AstrBotDevs:master' into master
2 parents 1a1ee9a + 795aec9 commit db60f3c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+3811
-442
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,15 @@ astrbot
8383

8484
> Requires [uv](https://docs.astral.sh/uv/) to be installed.
8585
86+
> [!NOTE]
87+
> For macOS user: due to macOS security checks, the first run of the `astrbot` command may take longer (about 10-20s).
88+
89+
Update `astrbot`:
90+
91+
```bash
92+
uv tool upgrade astrbot
93+
```
94+
8695
### Docker Deployment
8796

8897
For users familiar with containers and looking for a more stable, production-ready deployment method, we recommend deploying AstrBot with Docker / Docker Compose.
@@ -216,12 +225,15 @@ pre-commit install
216225

217226
### QQ Groups
218227

228+
- Group 9: 1076659624 (New)
229+
- Group 10: 1078079676 (New)
219230
- Group 1: 322154837
220231
- Group 3: 630166526
221232
- Group 5: 822130018
222233
- Group 6: 753075035
223234
- Group 7: 743746109
224235
- Group 8: 1030353265
236+
225237
- Developer Group: 975206796
226238

227239
### Discord Server

README_fr.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,15 @@ astrbot
8383

8484
> [uv](https://docs.astral.sh/uv/) doit être installé.
8585
86+
> [!NOTE]
87+
> Pour les utilisateurs macOS : en raison des vérifications de sécurité de macOS, la première exécution de la commande `astrbot` peut prendre plus de temps (environ 10-20s).
88+
89+
Mettre à jour `astrbot` :
90+
91+
```bash
92+
uv tool upgrade astrbot
93+
```
94+
8695
### Déploiement Docker
8796

8897
Pour les utilisateurs familiers avec les conteneurs et qui souhaitent une méthode plus stable et adaptée à la production, nous recommandons de déployer AstrBot avec Docker / Docker Compose.

README_ja.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,15 @@ astrbot
8383

8484
> [uv](https://docs.astral.sh/uv/) のインストールが必要です。
8585
86+
> [!NOTE]
87+
> macOS ユーザーの場合:macOS のセキュリティチェックにより、`astrbot` コマンドの初回実行に時間がかかる場合があります(約 10〜20 秒)。
88+
89+
`astrbot` の更新:
90+
91+
```bash
92+
uv tool upgrade astrbot
93+
```
94+
8695
### Docker デプロイ
8796

8897
コンテナ運用に慣れており、より安定した本番向けのデプロイ方法を求めるユーザーには、Docker / Docker Compose での AstrBot デプロイをおすすめします。

README_ru.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,15 @@ astrbot
8383

8484
> Требуется установленный [uv](https://docs.astral.sh/uv/).
8585
86+
> [!NOTE]
87+
> Для пользователей macOS: из-за проверок безопасности macOS первый запуск команды `astrbot` может занять больше времени (около 10-20 секунд).
88+
89+
Обновить `astrbot`:
90+
91+
```bash
92+
uv tool upgrade astrbot
93+
```
94+
8695
### Развёртывание Docker
8796

8897
Для пользователей, знакомых с контейнерами и которым нужен более стабильный и подходящий для production способ, мы рекомендуем разворачивать AstrBot через Docker / Docker Compose.

README_zh-TW.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,15 @@ astrbot
8383

8484
> 需要安裝 [uv](https://docs.astral.sh/uv/)
8585
86+
> [!NOTE]
87+
> 對於 macOS 使用者:由於 macOS 安全性檢查,首次執行 `astrbot` 指令可能需要較長時間(約 10-20 秒)。
88+
89+
更新 `astrbot`
90+
91+
```bash
92+
uv tool upgrade astrbot
93+
```
94+
8695
### Docker 部署
8796

8897
對於熟悉容器、希望獲得更穩定且更適合正式環境部署方式的使用者,我們推薦使用 Docker / Docker Compose 部署 AstrBot。
@@ -208,10 +217,14 @@ pre-commit install
208217

209218
### QQ 群組
210219

220+
- 9 群: 1076659624 (新)
221+
- 10 群: 1078079676 (新)
211222
- 1 群:322154837
212223
- 3 群:630166526
213224
- 5 群:822130018
214225
- 6 群:753075035
226+
- 7 群:743746109
227+
- 8 群:1030353265
215228
- 開發者群:975206796
216229

217230
### Discord 群組

README_zh.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,15 @@ astrbot
8383

8484
> 需要安装 [uv](https://docs.astral.sh/uv/)
8585
86+
> [!NOTE]
87+
> 对于 macOS 用户:由于 macOS 安全检查,首次运行 `astrbot` 命令可能需要较长时间(约 10-20 秒)。
88+
89+
更新 `astrbot`
90+
91+
```bash
92+
uv tool upgrade astrbot
93+
```
94+
8695
### Docker 部署
8796

8897
对于熟悉容器、希望获得更稳定且更适合生产环境部署方式的用户,我们推荐使用 Docker / Docker Compose 部署 AstrBot。
@@ -209,6 +218,8 @@ pre-commit install
209218

210219
### QQ 群组
211220

221+
- 9 群: 1076659624 (新)
222+
- 10 群: 1078079676 (新)
212223
- 1 群:322154837
213224
- 3 群:630166526
214225
- 5 群:822130018

astrbot/cli/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "4.19.2"
1+
__version__ = "4.19.4"

astrbot/core/agent/runners/dashscope/dashscope_agent_runner.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ async def _handle_streaming_response(
302302

303303
while True:
304304
try:
305-
item_type, item_data = await asyncio.get_event_loop().run_in_executor(
305+
item_type, item_data = await asyncio.get_running_loop().run_in_executor(
306306
None, response_queue.get, True, 1
307307
)
308308
except queue.Empty:
@@ -388,7 +388,7 @@ async def _execute_dashscope_request(self):
388388

389389
# 发起请求
390390
partial = functools.partial(Application.call, **payload)
391-
response = await asyncio.get_event_loop().run_in_executor(None, partial)
391+
response = await asyncio.get_running_loop().run_in_executor(None, partial)
392392

393393
async for resp in self._handle_streaming_response(response, session_id):
394394
yield resp

astrbot/core/computer/booters/bay_manager.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,12 @@ async def ensure_running(self) -> str:
121121
async def wait_healthy(self, timeout: int = HEALTH_TIMEOUT_S) -> None:
122122
"""Block until Bay's ``/health`` endpoint returns 200."""
123123
url = f"http://127.0.0.1:{self._host_port}/health"
124-
deadline = asyncio.get_event_loop().time() + timeout
124+
loop = asyncio.get_running_loop()
125+
deadline = loop.time() + timeout
125126
last_error: str = ""
126127

127128
async with aiohttp.ClientSession() as session:
128-
while asyncio.get_event_loop().time() < deadline:
129+
while loop.time() < deadline:
129130
try:
130131
async with session.get(
131132
url, timeout=aiohttp.ClientTimeout(total=3)

astrbot/core/config/default.py

Lines changed: 69 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
from astrbot.core.utils.astrbot_path import get_astrbot_data_path
77

8-
VERSION = "4.19.2"
8+
VERSION = "4.19.4"
99
DB_PATH = os.path.join(get_astrbot_data_path(), "data_v4.db")
1010

1111
WEBHOOK_SUPPORTED_PLATFORMS = [
@@ -342,14 +342,20 @@ class ChatProviderTemplate(TypedDict):
342342
"企业微信智能机器人": {
343343
"id": "wecom_ai_bot",
344344
"type": "wecom_ai_bot",
345+
"hint": "如果发现字段有异常,请重新创建",
345346
"enable": True,
347+
"wecom_ai_bot_connection_mode": "long_connection", # long_connection, webhook
348+
"wecom_ai_bot_name": "",
349+
"wecomaibot_ws_bot_id": "",
350+
"wecomaibot_ws_secret": "",
351+
"wecomaibot_token": "",
352+
"wecomaibot_encoding_aes_key": "",
346353
"wecomaibot_init_respond_text": "",
347354
"wecomaibot_friend_message_welcome_text": "",
348-
"wecom_ai_bot_name": "",
349355
"msg_push_webhook_url": "",
350356
"only_use_webhook_url_to_send": False,
351-
"token": "",
352-
"encoding_aes_key": "",
357+
"wecomaibot_ws_url": "wss://openws.work.weixin.qq.com",
358+
"wecomaibot_heartbeat_interval": 30,
353359
"unified_webhook_mode": True,
354360
"webhook_uuid": "",
355361
"callback_server_host": "0.0.0.0",
@@ -732,6 +738,13 @@ class ChatProviderTemplate(TypedDict):
732738
"type": "string",
733739
"hint": "请务必填写正确,否则无法使用一些指令。",
734740
},
741+
"wecom_ai_bot_connection_mode": {
742+
"description": "企业微信智能机器人连接模式",
743+
"type": "string",
744+
"options": ["webhook", "long_connection"],
745+
"labels": ["Webhook 回调", "长连接"],
746+
"hint": "Webhook 回调模式需要配置 Token/EncodingAESKey。长连接模式需要配置 BotID/Secret。",
747+
},
735748
"wecomaibot_init_respond_text": {
736749
"description": "企业微信智能机器人初始响应文本",
737750
"type": "string",
@@ -742,6 +755,22 @@ class ChatProviderTemplate(TypedDict):
742755
"type": "string",
743756
"hint": "当用户当天进入智能机器人单聊会话,回复欢迎语,留空则不回复。",
744757
},
758+
"wecomaibot_token": {
759+
"description": "企业微信智能机器人 Token",
760+
"type": "string",
761+
"hint": "用于 Webhook 回调模式的身份验证。",
762+
"condition": {
763+
"wecom_ai_bot_connection_mode": "webhook",
764+
},
765+
},
766+
"wecomaibot_encoding_aes_key": {
767+
"description": "企业微信智能机器人 EncodingAESKey",
768+
"type": "string",
769+
"hint": "用于 Webhook 回调模式的消息加密解密。",
770+
"condition": {
771+
"wecom_ai_bot_connection_mode": "webhook",
772+
},
773+
},
745774
"msg_push_webhook_url": {
746775
"description": "企业微信消息推送 Webhook URL",
747776
"type": "string",
@@ -752,6 +781,40 @@ class ChatProviderTemplate(TypedDict):
752781
"type": "bool",
753782
"hint": "启用后,企业微信智能机器人的所有回复都改为通过消息推送 Webhook 发送。消息推送 Webhook 支持更多的消息类型(如图片、文件等)。",
754783
},
784+
"wecomaibot_ws_bot_id": {
785+
"description": "长连接 BotID",
786+
"type": "string",
787+
"hint": "企业微信智能机器人长连接模式凭证 BotID。",
788+
"condition": {
789+
"wecom_ai_bot_connection_mode": "long_connection",
790+
},
791+
},
792+
"wecomaibot_ws_secret": {
793+
"description": "长连接 Secret",
794+
"type": "string",
795+
"hint": "企业微信智能机器人长连接模式凭证 Secret。",
796+
"condition": {
797+
"wecom_ai_bot_connection_mode": "long_connection",
798+
},
799+
},
800+
"wecomaibot_ws_url": {
801+
"description": "长连接 WebSocket 地址",
802+
"type": "string",
803+
"invisible": True,
804+
"hint": "默认值为 wss://openws.work.weixin.qq.com,一般无需修改。",
805+
"condition": {
806+
"wecom_ai_bot_connection_mode": "long_connection",
807+
},
808+
},
809+
"wecomaibot_heartbeat_interval": {
810+
"description": "长连接心跳间隔",
811+
"type": "int",
812+
"invisible": True,
813+
"hint": "长连接模式心跳间隔(秒),建议 30 秒。",
814+
"condition": {
815+
"wecom_ai_bot_connection_mode": "long_connection",
816+
},
817+
},
755818
"lark_bot_name": {
756819
"description": "飞书机器人的名字",
757820
"type": "string",
@@ -796,7 +859,7 @@ class ChatProviderTemplate(TypedDict):
796859
"unified_webhook_mode": {
797860
"description": "统一 Webhook 模式",
798861
"type": "bool",
799-
"hint": "启用后,将使用 AstrBot 统一 Webhook 入口,无需单独开启端口。回调地址为 /api/platform/webhook/{webhook_uuid}。",
862+
"hint": "Webhook 模式下使用 AstrBot 统一 Webhook 入口,无需单独开启端口。回调地址为 /api/platform/webhook/{webhook_uuid}。",
800863
},
801864
"webhook_uuid": {
802865
"invisible": True,
@@ -1123,7 +1186,7 @@ class ChatProviderTemplate(TypedDict):
11231186
"enable": True,
11241187
"key": [],
11251188
"timeout": 120,
1126-
"api_base": "https://openrouter.ai/v1",
1189+
"api_base": "https://openrouter.ai/api/v1",
11271190
"proxy": "",
11281191
"custom_headers": {},
11291192
},

0 commit comments

Comments
 (0)