fix: 增大了默认的maxtoken防止溢出,messagecq改异步get_image防止阻塞

This commit is contained in:
tcmofashi
2025-03-14 15:38:33 +08:00
parent e2c5d42634
commit d3fe02e467
7 changed files with 207 additions and 286 deletions

View File

@@ -74,6 +74,7 @@ class ChatBot:
reply_message=None,
platform="qq",
)
await message_cq.initialize()
message_json = message_cq.to_dict()
# 进入maimbot
@@ -120,8 +121,13 @@ class ChatBot:
# 用户屏蔽,不区分私聊/群聊
if event.user_id in global_config.ban_user_id:
return
if event.reply and hasattr(event.reply, 'sender') and hasattr(event.reply.sender, 'user_id') and event.reply.sender.user_id in global_config.ban_user_id:
if (
event.reply
and hasattr(event.reply, "sender")
and hasattr(event.reply.sender, "user_id")
and event.reply.sender.user_id in global_config.ban_user_id
):
logger.debug(f"跳过处理回复来自被ban用户 {event.reply.sender.user_id} 的消息")
return
# 处理私聊消息
@@ -171,6 +177,7 @@ class ChatBot:
reply_message=event.reply,
platform="qq",
)
await message_cq.initialize()
message_json = message_cq.to_dict()
# 进入maimbot