설명 없음

ryoii 201fd2abcc Release 2.3.3 4 년 전
.github eea34e51fb Publish to maven central 4 년 전
API-Tester 34452e4b48 Update readme, changelog, docs, tester 5 년 전
docs 2879224bc0 Fix doc, close #470 4 년 전
gradle fda8fa6f39 Serializer impl and test 4 년 전
mirai-api-http 201fd2abcc Release 2.3.3 4 년 전
.gitignore fda8fa6f39 Serializer impl and test 4 년 전
CHANGELOG.md 201fd2abcc Release 2.3.3 4 년 전
LICENSE e0a5639554 LICENSE 6 년 전
README.md 81e59e6372 Update README.md 4 년 전
build.gradle.kts b4ef4947d6 Update buildscript 4 년 전
gradle.properties 201fd2abcc Release 2.3.3 4 년 전
gradlew 313f2c59f2 unfinished gradle 1111 6 년 전
gradlew.bat 313f2c59f2 unfinished gradle 1111 6 년 전
settings.gradle.kts fda8fa6f39 Serializer impl and test 4 년 전

README.md

logo
title ---- [![Gitter](https://badges.gitter.im/mamoe/mirai.svg)](https://gitter.im/mamoe/mirai?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) [![Actions Status](https://github.com/mamoe/mirai-api-http/workflows/Gradle%20CI/badge.svg)](https://github.com/mamoe/mirai-api-http/actions) Mirai 是一个在全平台下运行,提供 QQ Android 和 TIM PC 协议支持的高效率机器人框架 这个项目的名字来源于

京都动画作品《境界的彼方》栗山未来(Kuriyama Mirai)

CRYPTON初音未来为代表的创作与活动(Magical Mirai)

图标以及形象由画师DazeCake绘制

mirai-api-http

Mirai HTTP API (console) plugin

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

安装mirai-api-http

使用 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

Adapter

mirai-api-http 提供了多种连接方式, 并进行模块化分离成 adapter

对于较常使用的连接方式, 内置了4种 adapter

  • http: 基于轮询的 http 接口
  • ws: websocket server 形式的接口
  • reverse-ws: websocket client 形式的接口
  • webhook: http 回调形式的接口

adapter 可以多个同时开启, 请按需启用

Adapter 一览

迁移至 2.x

从 1.x 迁移至 2.x 有不少变动,提供迁移文档参考

可能无法覆盖所有变更

调试API

(2.x 未更新)

更新日志

点我查看

文档