perf: 优化aiocqhttp适配器对用户非法输入的处理

This commit is contained in:
Soulter
2025-02-05 00:02:18 +08:00
parent 47e253d76c
commit 36414c4b00
2 changed files with 5 additions and 2 deletions
+1 -1
View File
@@ -109,7 +109,7 @@ CONFIG_METADATA_2 = {
"id": "default",
"type": "aiocqhttp",
"enable": False,
"ws_reverse_host": "",
"ws_reverse_host": "0.0.0.0",
"ws_reverse_port": 6199,
},
"gewechat(微信)": {
@@ -122,7 +122,10 @@ class AiocqhttpAdapter(Platform):
def run(self) -> Awaitable[Any]:
if not self.host or not self.port:
return
logger.warning("aiocqhttp: 未配置 ws_reverse_host 或 ws_reverse_port,将使用默认值:http://0.0.0.0:6199")
self.host = "0.0.0.0"
self.port = 6199
self.bot = CQHttp(use_ws_reverse=True, import_name='aiocqhttp', api_timeout_sec=180)
@self.bot.on_message('group')
async def group(event: Event):