Back to Picoclaw

OneBot

docs/channels/onebot/README.md

0.2.81.3 KB
Original Source

Back to README

OneBot

OneBot is an open protocol standard for QQ bots, providing a unified interface for various QQ bot implementations (e.g. go-cqhttp, Mirai). It uses WebSocket for communication.

Configuration

json
{
  "channel_list": {
    "onebot": {
      "enabled": true,
      "type": "onebot",
      "ws_url": "ws://localhost:8080",
      "access_token": "",
      "allow_from": []
    }
  }
}
FieldTypeRequiredDescription
enabledboolYesWhether to enable the OneBot channel
ws_urlstringYesWebSocket URL of the OneBot server
access_tokenstringNoAccess token for connecting to the OneBot server
allow_fromarrayNoUser ID whitelist; empty means all users are allowed

Setup

  1. Deploy a OneBot-compatible implementation (e.g. napcat)
  2. Configure the OneBot implementation to enable the WebSocket service and set an access token (if needed)
  3. Fill in the WebSocket URL and access token in the configuration file