@kotori-bot/kotori-plugin-adapter-onebot
Version:
Adapter For Onebot 11
79 lines (64 loc) • 3.02 kB
Markdown
# @kotori-bot/kotori-plugin-adapter-onebot

Base on [OneBot 11 Standard](https://github.com/botuniverse/onebot-11), you can use the these programs that support OneBot 11's implement to connect with qq:
- For Linux: [NapCat](https://napneko.github.io/)
- For Windows: [LiteLoaderQQNT](https://liteloaderqqnt.github.io/) with [LLOneBot](https://llonebot.github.io/)
- No more available: [go-cqhttp](https://docs.go-cqhttp.org/)
## Config
```typescript
export const config = Tsu.Union(
Tsu.Object({
mode: Tsu.Literal('ws').describe('Connect mode: WebSocket'),
port: Tsu.Number().port().describe('WebSocket server port'),
address: Tsu.String()
.regexp(/^ws(s)?:\/\/([\w-]+\.)+[\w-]+(\/[\w-./?%&=]*)?$/)
.default('ws://127.0.0.1')
.describe('WebSocket address'),
retry: Tsu.Number().int().min(1).default(10).describe('try reconnect times when disconnected')
}),
Tsu.Object({
mode: Tsu.Literal('ws-reverse').describe('Connect mode: WebSocket Reverse')
})
)
```
## Supports
### Events
- on_message (exclude `MessageScope.CHANNEL`)
- on_message_delete (exclude `MessageScope.CHANNEL`)
- on_request (exclude `RequestScope.CHANNEL`)
- on_group_increase
- on_group_decrease
- on_group_admin
- on_group_ban
- custom: onebot_poke
### Api
- sendPrivateMsg
- sendGroupMsg
- deleteMsg
- getUserInfo
- getFriendList
- getGroupInfo
- getGroupList
- getGroupMemberInfo
- getGroupMemberList
- setGroupName
- leaveGroup
- setGroupAdmin
- setGroupCard
- setGroupAvatar
- setGroupBan
- setGroupWholeBan
- setGroupNotice
- setGroupKick
### Elements
- text
- mention
- mentionAll
- image
- voice
- video
- reply
## Reference
- [Kotori Docs](https://kotori.js.org/)
- [go-cqhttp 帮助中心](https://docs.go-cqhttp.org/)
- [OneBot](https://onebot.dev/)