Skip to content

Adapter Guide

This guide explains how to configure and use adapters in onebots.

Supported Adapters

onebots currently supports the following platform adapters:

PlatformStatusPackageDescription
QQ Official Bot✅ Implemented@onebots/adapter-qqSupports QQ channels, group chats, private chats
ICQQ✅ Implemented@onebots/adapter-icqqSupports QQ via unofficial protocol with more complete features
Kook✅ Implemented@onebots/adapter-kookSupports channels, private chats, server management
WeChat✅ Implemented@onebots/adapter-wechatSupports WeChat Official Accounts
Discord✅ Implemented@onebots/adapter-discordSupports Discord bots
Telegram✅ Implemented@onebots/adapter-telegramSupports private chats, groups, channels
Feishu✅ Implemented@onebots/adapter-feishuSupports private chats, group chats, rich text messages
DingTalk✅ Implemented@onebots/adapter-dingtalkSupports enterprise internal apps and custom bots
Slack✅ Implemented@onebots/adapter-slackSupports channel messages, private chats, app commands
WeCom✅ Implemented@onebots/adapter-wecomSupports app message push, contact sync
Microsoft Teams✅ Implemented@onebots/adapter-teamsSupports channel messages, private chats, adaptive cards
Line✅ Implemented@onebots/adapter-lineSupports Line bot messages and events
Email✅ Implemented@onebots/adapter-emailSupports SMTP sending and IMAP receiving
WhatsApp✅ Implemented@onebots/adapter-whatsappSupports WhatsApp Business API
Zulip✅ Implemented@onebots/adapter-zulipSupports Zulip streams and private messages

Installation

Install adapters based on the platforms you want to use:

bash
# QQ Official Bot
npm install @onebots/adapter-qq

# Kook
npm install @onebots/adapter-kook

# WeChat
npm install @onebots/adapter-wechat

# Discord
npm install @onebots/adapter-discord discord.js

# Telegram
npm install @onebots/adapter-telegram grammy

# Feishu
npm install @onebots/adapter-feishu

# DingTalk
npm install @onebots/adapter-dingtalk

# Slack
npm install @onebots/adapter-slack @slack/web-api

# WeCom
npm install @onebots/adapter-wecom

# Microsoft Teams
npm install @onebots/adapter-teams botbuilder botframework-connector

For detailed instructions, see Quick Start.

Configuration

onebots uses YAML format configuration files, supporting multiple protocols per account.

Configuration Structure

yaml
# Global configuration
port: 6727              # HTTP server port
log_level: info         # Log level
timeout: 30             # Login timeout (seconds)

# General configuration (protocol default configuration)
general:
  onebot.v11:           # OneBot V11 protocol general configuration
    use_http: true
    use_ws: true
    access_token: ''
    heartbeat_interval: 5000
  onebot.v12:           # OneBot V12 protocol general configuration
    use_http: true
    use_ws: true
    access_token: ''
    heartbeat_interval: 5000
  satori.v1:            # Satori protocol general configuration
    use_http: true
    use_ws: true
    token: ''
  milky.v1:             # Milky protocol general configuration
    use_http: true
    use_ws: true
    token: ''

# Account configuration
# Format: {platform}.{account_id}
wechat.my_wechat_mp:
  # Protocol configuration
  onebot.v11:
    use_http: true
    use_ws: true
  
  # WeChat platform configuration
  app_id: your_app_id
  app_secret: your_app_secret
  token: your_token

For complete configuration examples, see Configuration Guide.