新增内置OneBot工具支持,包括禁言、获取群信息等功能,并优化工具调用逻辑

This commit is contained in:
FuQuan233 2025-10-31 17:07:10 +08:00
parent b4f7b2797c
commit 63e446d5e4
4 changed files with 267 additions and 4 deletions

View file

@ -381,8 +381,13 @@ async def process_messages(group_id: int):
# 发送工具调用提示
await handler.send(Message(f"正在使用{mcp_client.get_friendly_name(tool_name)}"))
# 执行工具调用
result = await mcp_client.call_tool(tool_name, tool_args)
# 执行工具调用传递群组和机器人信息用于QQ工具
result = await mcp_client.call_tool(
tool_name,
tool_args,
group_id=event.group_id,
bot_id=str(event.self_id)
)
new_messages.append({
"role": "tool",