{"id":13459452,"url":"https://github.com/project-mirai/mirai-api-http","last_synced_at":"2025-05-15T07:06:09.234Z","repository":{"id":37329994,"uuid":"243544177","full_name":"project-mirai/mirai-api-http","owner":"project-mirai","description":"Mirai HTTP API (console) plugin","archived":false,"fork":false,"pushed_at":"2024-04-24T05:31:09.000Z","size":2064,"stargazers_count":1676,"open_issues_count":46,"forks_count":343,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-04-14T12:58:32.709Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/project-mirai.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-02-27T15:02:15.000Z","updated_at":"2025-04-07T08:24:39.000Z","dependencies_parsed_at":"2023-02-10T09:15:35.019Z","dependency_job_id":"c6b8ecca-4182-4141-9460-47852e774486","html_url":"https://github.com/project-mirai/mirai-api-http","commit_stats":null,"previous_names":[],"tags_count":70,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/project-mirai%2Fmirai-api-http","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/project-mirai%2Fmirai-api-http/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/project-mirai%2Fmirai-api-http/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/project-mirai%2Fmirai-api-http/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/project-mirai","download_url":"https://codeload.github.com/project-mirai/mirai-api-http/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254292042,"owners_count":22046426,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T09:01:22.860Z","updated_at":"2025-05-15T07:06:04.227Z","avatar_url":"https://github.com/project-mirai.png","language":"Kotlin","funding_links":[],"categories":["Kotlin","mirai-console 插件"],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n   \u003cimg width=\"160\" src=\"https://github.com/mamoe/mirai/blob/dev/docs/mirai.png\" alt=\"logo\"\u003e\u003c/br\u003e\n\n   \u003cimg width=\"95\" src=\"https://github.com/mamoe/mirai/blob/dev/docs/mirai.svg\" alt=\"title\"\u003e\n\n----\n\n[![Gitter](https://badges.gitter.im/mamoe/mirai.svg)](https://gitter.im/mamoe/mirai?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge)\n[![Actions Status](https://github.com/mamoe/mirai-api-http/workflows/Gradle%20CI/badge.svg)](https://github.com/mamoe/mirai-api-http/actions)\n\nMirai 是一个在全平台下运行，提供 QQ Android 和 TIM PC 协议支持的高效率机器人框架\n\n这个项目的名字来源于\n     \u003cp\u003e\u003ca href = \"http://www.kyotoanimation.co.jp/\"\u003e京都动画\u003c/a\u003e作品\u003ca href = \"https://zh.moegirl.org/zh-hans/%E5%A2%83%E7%95%8C%E7%9A%84%E5%BD%BC%E6%96%B9\"\u003e《境界的彼方》\u003c/a\u003e的\u003ca href = \"https://zh.moegirl.org/zh-hans/%E6%A0%97%E5%B1%B1%E6%9C%AA%E6%9D%A5\"\u003e栗山未来(Kuriyama \u003cb\u003eMirai\u003c/b\u003e)\u003c/a\u003e\u003c/p\u003e\n     \u003cp\u003e\u003ca href = \"https://www.crypton.co.jp/\"\u003eCRYPTON\u003c/a\u003e以\u003ca href = \"https://www.crypton.co.jp/miku_eng\"\u003e初音未来\u003c/a\u003e为代表的创作与活动\u003ca href = \"https://magicalmirai.com/2019/index_en.html\"\u003e(Magical \u003cb\u003eMirai\u003c/b\u003e)\u003c/a\u003e\u003c/p\u003e\n图标以及形象由画师\u003ca href = \"https://github.com/dazecake\"\u003eDazeCake\u003c/a\u003e绘制\n\u003c/div\u003e\n\n# mirai-api-http\nMirai HTTP API (console) plugin\n\n\u003cb\u003emirai-api-http插件 提供HTTP API供所有语言使用mirai\u003c/b\u003e\n\n## 安装`mirai-api-http`\n\n### 使用 [Mirai Console Loader](https://github.com/iTXTech/mirai-console-loader) 安装`mirai-api-http`\n\n* `MCL` 支持自动更新插件，支持设置插件更新频道等功能\n* `2.x` 版本需要切换到 `stable-v2` 的 channel\n\n`./mcl --update-package net.mamoe:mirai-api-http --channel stable-v2 --type plugin`\n\n* 启动 `MCL` 完成自动更新和启动\n\n`./mcl -u`\n\n## 开始使用\n\n1. 编辑`config/net.mamoe.mirai-api-http/setting.yml`配置文件 (没有则自行创建)\n2. 启动MCL `./mcl` \n3. 如果手动安装则启动 `mirai-console`(不建议)\n4. 记录日志中出现的`authKey`\n\n#### setting.yml模板\n\n```yaml\n## 配置文件中的值，全为默认值\n\n## 启用的 adapter, 内置有 http, ws, reverse-ws, webhook\nadapters:\n  - http\n  - ws\n\n## 是否开启认证流程, 若为 true 则建立连接时需要验证 verifyKey\n## 建议公网连接时开启\nenableVerify: true\nverifyKey: 1234567890\n\n## 开启一些调试信息\ndebug: false\n\n## 是否开启单 session 模式, 若为 true，则自动创建 session 绑定 console 中登录的 bot\n## 开启后，接口中任何 sessionKey 不需要传递参数\n## 若 console 中有多个 bot 登录，则行为未定义\n## 确保 console 中只有一个 bot 登录时启用\nsingleMode: false\n\n## 历史消息的缓存大小\n## 同时，也是 http adapter 的消息队列容量\ncacheSize: 4096\n\n## adapter 的单独配置，键名与 adapters 项配置相同\nadapterSettings:\n  ## 详情看 http adapter 使用说明 配置\n  http:\n    host: localhost\n    port: 8080\n    cors: [\"*\"]\n    unreadQueueMaxSize: 100\n  \n  ## 详情看 websocket adapter 使用说明 配置\n  ws:\n    host: localhost\n    port: 8080\n    reservedSyncId: -1\n```\n\n## Adapter\n\n`mirai-api-http` 提供了多种接口调用方式, 并进行模块化称为 `adapter`\n\n对于较常使用的调用方式, 内置了4种 `adapter`\n\n+ [http](docs/adapter/HttpAdapter.md): 基于轮询的 http 接口\n+ [ws](docs/adapter/WebsocketAdapter.md): websocket server 形式的接口\n+ [reverse-ws](docs/adapter/ReverseWebsocketAdapter.md): websocket client 形式的接口\n+ [webhook](docs/adapter/WebhookAdapter.md): http 回调形式的接口\n\n`adapter` 可以多个同时开启, 请按需启用\n\n[Adapter 一览](docs/adapter/Adapter.md)\n\n\n## 迁移至 2.x\n\n从 1.x 迁移至 2.x 有不少变动，提供[迁移文档](docs/misc/Migration2.md)参考\n\n可能无法覆盖所有变更\n\n## 调试API\n(2.x 未更新)\n\n## 更新日志\n[点我查看](CHANGELOG.md)\n\n## 文档\n\n[在线文档](https://docs.mirai.mamoe.net/mirai-api-http/)\n\n+ **[API文档参考](docs/api/API.md)**\n  + [状态码](docs/api/API.md#状态码)\n  + [获取插件信息](docs/api/API.md#获取插件信息)\n  + [缓存操作](docs/api/API.md#缓存操作)\n    + [通过messageId获取消息](docs/api/API.md#通过messageId获取消息)\n  + [获取账号信息](docs/api/API.md#获取账号信息)\n    + [获取好友列表](docs/api/API.md#获取好友列表)\n    + [获取群列表](docs/api/API.md#获取群列表)\n    + [获取群成员列表](docs/api/API.md#获取群成员列表)\n    + [获取Bot资料](docs/api/API.md#获取Bot资料)\n    + [获取好友资料](docs/api/API.md#获取好友资料)\n    + [获取群成员资料](docs/api/API.md#获取群成员资料)\n  + [消息发送与撤回](docs/api/API.md#消息发送与撤回)\n    + [发送好友消息](docs/api/API.md#发送好友消息)\n    + [发送群消息](docs/api/API.md#发送群消息)\n    + [发送临时会话消息](docs/api/API.md#发送临时会话消息)\n    + [发送头像戳一戳消息](docs/api/API.md#发送头像戳一戳消息)\n    + [撤回消息](docs/api/API.md#撤回消息)\n  + [账号管理](docs/api/API.md#账号管理)\n    + [删除好友](docs/api/API.md#删除好友)\n  + [群管理](docs/api/API.md#群管理)\n    + [禁言群成员](docs/api/API.md#禁言群成员)\n    + [解除群成员禁言](docs/api/API.md#解除群成员禁言)\n    + [移除群成员](docs/api/API.md#移除群成员)\n    + [退出群聊](docs/api/API.md#退出群聊)\n    + [全体禁言](docs/api/API.md#全体禁言)\n    + [解除全体禁言](docs/api/API.md#解除全体禁言)\n    + [设置群精华消息](docs/api/API.md#设置群精华消息)\n    + [获取群设置](docs/api/API.md#获取群设置)\n    + [修改群设置](docs/api/API.md#修改群设置)\n    + [获取群员资料](docs/api/API.md#获取群员设置)\n    + [修改群员资料](docs/api/API.md#修改群员设置)\n  + [事件处理](docs/api/API.md#事件处理)\n    + [添加好友申请](docs/api/API.md#添加好友申请)\n    + [用户入群申请](docs/api/API.md#用户入群申请（Bot需要有管理员权限）)\n    + [Bot被邀请入群申请](docs/api/API.md#Bot被邀请入群申请)\n+ **[事件类型参考](docs/api/EventType.md)**\n  + [Bot自身事件](docs/api/EventType.md#bot自身事件)\n  + [好友事件](docs/api/EventType.md#好友事件)\n  + [群事件](docs/api/EventType.md#群事件)\n  + [申请事件](docs/api/EventType.md#申请事件)\n+ **[消息类型参考](docs/api/MessageType.md)**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fproject-mirai%2Fmirai-api-http","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fproject-mirai%2Fmirai-api-http","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fproject-mirai%2Fmirai-api-http/lists"}