ryoii 7cbc8e6078 Merge branch 'master' into dev 3 лет назад
..
.conf 4c37f81cc2 VuePress build settings 4 лет назад
adapter 7cbc8e6078 Merge branch 'master' into dev 3 лет назад
api 7cbc8e6078 Merge branch 'master' into dev 3 лет назад
misc 6c63ab8b99 Update README 4 лет назад
README.md f8ff6c7be3 fix(docs): 文档首页 API 文档连接错误 4 лет назад

README.md


home: true heroImage: https://raw.githubusercontent.com/mamoe/mirai/dev/docs/mirai.png tagline: Mirai HTTP API (console) plugin actionText: API文档 actionLink: api/API.html

features:

- title: 通用

details: Mirai-API-http插件 提供HTTP API供所有语言使用mirai

- title: 高效

- title: 便捷

footerColumn: 2 footerWrap:

安装

使用 Mirai Console Loader 安装mirai-api-http

  • MCL 支持自动更新插件,支持设置插件更新频道等功能

    ./mcl --update-package net.mamoe:mirai-api-http --channel stable --type plugin
    

手动安装mirai-api-http

  1. 运行 Mirai Console 生成 plugins 文件夹
  2. Releases 下载jar并将其放入plugins文件夹中

开始使用

  1. 编辑config/MiraiApiHttp/setting.yml配置文件 (没有则自行创建)
  2. 启动 Mirai Console
  3. 记录日志中出现的authKey

setting.yml 模板

## 配置文件中的值,全为默认值

## 启用的 adapter, 内置有 http, ws, reverse-ws, webhook
adapters:
  - http
  - ws

## 是否开启认证流程, 若为 true 则建立连接时需要验证 verifyKey
## 建议公网连接时开启
enableVerify: true
verifyKey: 1234567890

## 开启一些调式信息
debug: false

## 是否开启单 session 模式, 若为 true,则自动创建 session 绑定 console 中登录的 bot
## 开启后,接口中任何 sessionKey 不需要传递参数
## 若 console 中有多个 bot 登录,则行为未定义
## 确保 console 中只有一个 bot 登陆时启用
singleMode: false

## 历史消息的缓存大小
## 同时,也是 http adapter 的消息队列容量
cacheSize: 4096

## adapter 的单独配置,键名与 adapters 项配置相同
adapterSettings:
  ## 详情看 http adapter 使用说明 配置
  http:
    host: localhost
    port: 8080
    cors: [*]
  
  ## 详情看 websocket adapter 使用说明 配置
  ws:
    host: localhost
    port: 8080
    reservedSyncId: -1