← 返回
效率工具 中文

Onebot Adapter 1.0.0

Connect OpenClaw to OneBot protocol for QQ bot integration. Use when receiving or sending QQ messages via NapCat or other OneBot servers.
将OpenClaw连接至OneBot协议以实现QQ机器人集成,用于通过NapCat或其他OneBot服务器接收或发送QQ消息。
haohaodlam
效率工具 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 658
下载
💾 18
安装
1
版本
#latest

概述

OneBot Adapter

Connect OpenClaw to OneBot protocol servers like NapCat for QQ bot functionality.

Quick Start

1. Configure Connection

Set OneBot server URL in environment or config:

export ONEBOT_WS_URL="ws://127.0.0.1:3001"
export ONEBOT_HTTP_URL="http://127.0.0.1:3000"
export ONEBOT_TOKEN="your-token"

2. Receive Messages

Use the WebSocket listener script to receive QQ messages:

python scripts/onebot_ws_listener.py

3. Send Messages

Use HTTP API to send messages:

from scripts.onebot_client import OneBotClient

client = OneBotClient()
client.send_private_msg(user_id=123456, message="Hello!")
client.send_group_msg(group_id=789012, message="Group message")

Connection Modes

WebSocket (Recommended)

  • Real-time bidirectional communication
  • Receives events instantly
  • Supports both sending and receiving

HTTP

  • Request-response model
  • Good for simple sending
  • Requires polling for receiving

Common Tasks

Get Login Info

client.get_login_info()

Get Friend/Group List

client.get_friend_list()
client.get_group_list()

Handle Messages

See references/message-handling.md for message parsing and response patterns.

NapCat Specific

NapCat is a OneBot11 implementation based on NTQQ.

Default ports:

  • WebSocket: 3001
  • HTTP: 3000
  • WebUI: 6099

Token authentication is optional but recommended for public deployments.

Troubleshooting

Connection refused: Check if OneBot server is running and ports are correct.

Authentication failed: Verify token matches OneBot server configuration.

Message not delivered: Check user_id/group_id exists and bot has permission.

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-30 04:37 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

productivity

Obsidian

steipete
操作 Obsidian 仓库(纯 Markdown 笔记)并通过 obsidian-cli 自动化。
★ 429 📥 103,687
productivity

Weather

steipete
获取当前天气和预报(无需API密钥)
★ 444 📥 226,102
productivity

Word / DOCX

ivangdavila
创建、检查和编辑 Microsoft Word 文档及 DOCX 文件,支持样式、编号、修订记录、表格、分节符及兼容性检查等功能。
★ 437 📥 147,168