{"id":21238581,"url":"https://github.com/simple-robot/simbot-component-mirai","last_synced_at":"2026-03-16T04:04:03.923Z","repository":{"id":37009247,"uuid":"436869672","full_name":"simple-robot/simbot-component-mirai","owner":"simple-robot","description":"simple-robot下的mirai组件","archived":false,"fork":false,"pushed_at":"2023-09-27T10:02:30.000Z","size":9221,"stargazers_count":20,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"dev/main","last_synced_at":"2025-04-05T16:36:39.752Z","etag":null,"topics":["kotlin","mirai","qqbot","simbot","simple-robot"],"latest_commit_sha":null,"homepage":"https://component-mirai.simbot.forte.love/","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/simple-robot.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2021-12-10T06:06:55.000Z","updated_at":"2024-07-20T03:30:17.000Z","dependencies_parsed_at":"2023-09-26T09:15:52.218Z","dependency_job_id":null,"html_url":"https://github.com/simple-robot/simbot-component-mirai","commit_stats":null,"previous_names":[],"tags_count":45,"template":false,"template_full_name":null,"purl":"pkg:github/simple-robot/simbot-component-mirai","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simple-robot%2Fsimbot-component-mirai","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simple-robot%2Fsimbot-component-mirai/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simple-robot%2Fsimbot-component-mirai/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simple-robot%2Fsimbot-component-mirai/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simple-robot","download_url":"https://codeload.github.com/simple-robot/simbot-component-mirai/tar.gz/refs/heads/dev/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simple-robot%2Fsimbot-component-mirai/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264639844,"owners_count":23642313,"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":["kotlin","mirai","qqbot","simbot","simple-robot"],"created_at":"2024-11-21T00:35:47.086Z","updated_at":"2026-03-16T04:04:03.883Z","avatar_url":"https://github.com/simple-robot.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\u003cimg src=\".simbot/icon.png\" alt=\"logo\" style=\"width:230px; height:230px; border-radius:50%; \" /\u003e\n\u003ch2\u003e\n    ~ simple-robot for mirai ~ \n\u003c/h2\u003e\n\u003ca href=\"https://github.com/simple-robot/simbot-component-mirai/releases/latest\"\u003e\u003cimg alt=\"release\" src=\"https://img.shields.io/github/v/release/simple-robot/simbot-component-mirai\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://repo1.maven.org/maven2/love/forte/simbot/component/simbot-component-mirai-core/\" target=\"_blank\"\u003e\n  \u003cimg alt=\"release\" src=\"https://img.shields.io/maven-central/v/love.forte.simbot.component/simbot-component-mirai-core\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://www.yuque.com/simpler-robot/simpler-robot-doc\" target=\"_blank\"\u003e\n  \u003cimg alt=\"doc\" src=\"https://img.shields.io/badge/doc-yuque-brightgreen\" /\u003e\u003c/a\u003e\n   \u003chr\u003e\n   \u003cimg alt=\"stars\" src=\"https://img.shields.io/github/stars/simple-robot/simbot-component-mirai\" /\u003e\n   \u003cimg alt=\"forks\" src=\"https://img.shields.io/github/forks/simple-robot/simbot-component-mirai\" /\u003e\n   \u003cimg alt=\"watchers\" src=\"https://img.shields.io/github/watchers/simple-robot/simbot-component-mirai\" /\u003e\n   \u003cimg alt=\"repo size\" src=\"https://img.shields.io/github/repo-size/simple-robot/simbot-component-mirai\" /\u003e\n   \u003cimg alt=\"lines\" src=\"https://img.shields.io/tokei/lines/github/simple-robot/simbot-component-mirai\" /\u003e\n   \u003cimg alt=\"issues\" src=\"https://img.shields.io/github/issues-closed/simple-robot/simbot-component-mirai?color=green\" /\u003e\n   \u003cimg alt=\"last commit\" src=\"https://img.shields.io/github/last-commit/simple-robot/simbot-component-mirai\" /\u003e\n   \u003ca href=\"./COPYING\"\u003e\u003cimg alt=\"copying\" src=\"https://img.shields.io/github/license/simple-robot/simbot-component-mirai\" /\u003e\u003c/a\u003e\n\n\u003c/div\u003e\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n此为基于 [simbot3](https://github.com/simple-robot/simpler-robot) 对库 [**mirai**](https://github.com/mamoe/mirai) 的组件支持。\n\n\n## 文档\n\nSimple Robot 官方文档：[simbot.forte.love](https://simbot.forte.love)\n\nsimbot-mirai 组件文档：[component-mirai.simbot.forte.love](https://component-mirai.simbot.forte.love)\n\nAPI文档：[文档引导站点](https://docs.simbot.forte.love)\n\n\n## 版本说明\n\n\u003e 其他参考：[命名概述](https://simbot.forte.love/docs/overviews/naming-overview/)\n\nsimbot官方组件采用 `X.y.z[.status][-suffix]` 的方式。其中，`X` 代表为当前依赖的 [simbot核心库](https://github.com/simple-robot/simpler-robot) 的 `MAJOR.MINOR`。\n例如假若当前依赖的核心库版本为 `v3.0.1`，则 `X` 为 `3.0`。\n\n`y` 和 `z` 以及其他后缀均为常见的语义化版本规则中的对应值，其中 `z` 通常在不包含新功能的修复性更新中增加计数，`y` 则会在包含增加新功能、修改旧功能以及破坏性变更时增加计数，并将 `z` 归零。\n\n\n\n## mirai 依赖说明\n\nsimbot-mirai组件会不定时的根据 [mirai最后的release版本](https://github.com/mamoe/mirai/releases/latest) 进行更新。\n\n\u003e 偶尔会跟进非 `release` 版本，例如 `xxx-RC`，但非必要不会。\n\n## 快速开始\n\n参考文档的 [《快速开始》](https://www.yuque.com/simpler-robot/simpler-robot-doc/fvdmq1)\n\n### 使用\n\n注：mirai组件仅编译时依赖 [simbot](https://github.com/simple-robot/simpler-robot) 核心库，因此你必须引入一个具体的核心库版本。\n\n**gradle kotlin dsl**\n\n```kotlin\nimplementation(\"love.forte.simbot:simbot-core:$SIMBOT_VERSION\")\nimplementation(\"love.forte.simbot.component:simbot-component-mirai-core:$COMPONENT_VERSION\")\n```\n**gradle groovy dsl**\n\n```gradle\nimplementation 'love.forte.simbot:simbot-core:$SIMBOT_VERSION'\nimplementation 'love.forte.simbot.component:simbot-component-mirai-core:$COMPONENT_VERSION'\n```\n\n**maven**\n\n```xml\n\u003cdependencies\u003e\n    \u003cdependency\u003e\n        \u003cgroupId\u003elove.forte.simbot.boot\u003c/groupId\u003e\n        \u003cartifactId\u003esimboot-core-spring-boot-starter\u003c/artifactId\u003e\n        \u003cversion\u003e${simbot.version}\u003c/version\u003e\n    \u003c/dependency\u003e\n    \u003cdependency\u003e\n        \u003cgroupId\u003elove.forte.simbot.component\u003c/groupId\u003e\n        \u003cartifactId\u003esimbot-component-mirai-core\u003c/artifactId\u003e\n        \u003cversion\u003e${simbot.mirai.version}\u003c/version\u003e\n    \u003c/dependency\u003e\n\u003c/dependencies\u003e\n```\n\n## 其他说明和注意事项\n\n### 签名服务\n\n请参考 mirai 的 [关于签名服务](https://mirai.mamoe.net/topic/2373/%E5%85%B3%E4%BA%8E%E7%AD%BE%E5%90%8D%E6%9C%8D%E5%8A%A1/2?lang=zh-CN) 并自行选择、搭建签名服务即可。\n签名服务的使用被 mirai 直接操作，理论上并没有什么需要经过 simbot-mirai 组件的操作（做多只需要在main方法一开始执行些什么），且 simbot-mirai 组件与 mirai 本身一样不会内置签名服务。\n\n### `cache` 目录的默认行为\n\n从 [#120](https://github.com/simple-robot/simbot-component-mirai/pull/120) 开始，\nmirai组件中 `cache` 文件夹的默认行为与 **mirai 原本的**行为不再相同。\n\n当你从其他位置通过各种工具得到了 `device.json` 和 `cache` 文件夹后，你需要稍作调整。\n\n目前组件中针对每个bot的 `cache` 目录规则为 `cache/$CODE` ，也就是 `cache` \n目录下以QQ号为名称的子目录。\n\n举个例子，如果一个bot的qq号为 `123456`，那么它所使用的 cacheDir 为 \n\n```\ncache\n  \\- 123456\n```\n\n因此当你希望使用一些外部的 `cache` 目录时，请记得将内容物调整到具体的子目录中。\n\n### 变更mirai版本\n\n有些时候，mirai组件的更新速度可能无法赶上 [mirai](https://github.com/mamoe/mirai) 的版本发布，此时你可以自行更替mirai版本。\n\n**gradle kotlin dsl**\n\n```kotlin\nimplementation(\"love.forte.simbot:simbot-core:$SIMBOT_VERSION\")\nimplementation(\"love.forte.simbot.component:simbot-component-mirai-core:$COMPONENT_VERSION\") {\n    exclude(\"net.mamoe\") // 排除 groupId = 'net.mamoe' 的所有依赖\n}\n// 然后自行引入一个新的\nimplementation(\"net.mamoe:mirai-core-jvm:$MIRAI_VERSION\")\n```\n**gradle groovy dsl**\n\n```gradle\nimplementation 'love.forte.simbot:simbot-core:$SIMBOT_VERSION'\nimplementation 'love.forte.simbot.component:simbot-component-mirai-core:$COMPONENT_VERSION' {\n    exclude group: 'net.mamoe' // 排除 groupId = 'net.mamoe' 的所有依赖\n}\n\n// 然后自行引入一个新的\nimplementation 'net.mamoe:mirai-core-jvm:$MIRAI_VERSION'\n```\n\n**maven**\n```xml\n\u003cdependencies\u003e\n    \u003cdependency\u003e\n        \u003cgroupId\u003elove.forte.simbot.boot\u003c/groupId\u003e\n        \u003cartifactId\u003esimboot-core-spring-boot-starter\u003c/artifactId\u003e\n        \u003cversion\u003e${simbot.version}\u003c/version\u003e\n    \u003c/dependency\u003e\n    \u003cdependency\u003e\n        \u003cgroupId\u003elove.forte.simbot.component\u003c/groupId\u003e\n        \u003cartifactId\u003esimbot-component-mirai-core\u003c/artifactId\u003e\n        \u003cversion\u003e${simbot.mirai.version}\u003c/version\u003e\n        \u003cexclusions\u003e\n            \u003cexclusion\u003e\n                \u003cgroupId\u003enet.mamoe\u003c/groupId\u003e\n                \u003c!--  排除 groupId = 'net.mamoe' 的所有依赖 --\u003e\n                \u003cartifactId\u003e*\u003c/artifactId\u003e\n            \u003c/exclusion\u003e\n        \u003c/exclusions\u003e\n    \u003c/dependency\u003e\n\n    \u003c!-- 然后自行引入一个新的 --\u003e\n    \u003cdependency\u003e\n        \u003cgroupId\u003enet.mamoe\u003c/groupId\u003e\n        \u003cartifactId\u003emirai-core-jvm\u003c/artifactId\u003e\n        \u003cversion\u003e${mirai.version}\u003c/version\u003e\n    \u003c/dependency\u003e\n\u003c/dependencies\u003e\n```\n\n\n### 走马观花\n\n```kotlin\n// simbot-core / simbot-boot\nsuspend fun MiraiFriendMessageEvent.onEvent() {\n    author().send(\"Hello World\")\n}\n```\n\n\n```kotlin\n// simbot-boot\n@Listener\n@Filter(\"签到\")\nsuspend fun MiraiGroupMessageEvent.onEvent() {\n    reply(\"签到成功\")\n}\n```\n\n```kotlin\n@Listener\n@Filter(\"叫我{{name,.+}}\")\nsuspend fun MiraiGroupMessageEvent.onEvent(name: String) {\n    group.send(At(author.id) + \"好的，以后就叫你$name了\".toText())\n}\n```\n\n# License\n\n```\nCopyright (C) 2022-2023 ForteScarlet.\n\nThis program is free software: you can redistribute it and/or modify it under the terms \nof the GNU Affero General Public License as published by the Free Software Foundation, \neither version 3 of the License, or (at your option) any later version.\n\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; \nwithout even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. \nSee the GNU Affero General Public License for more details.\n\nYou should have received a copy of the GNU Affero General Public License along with this program. \nIf not, see \u003chttps://www.gnu.org/licenses/\u003e.\n```\n\n\n## 衍生软件\n\n直接/间接引用 `simbot-component-mirai` 的项目需要以 `AGPLv3` 协议开源。\n\n本仓库引用开源软件[**mirai**](https://github.com/mamoe/mirai)，衍生软件同样需受其协议约束。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimple-robot%2Fsimbot-component-mirai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimple-robot%2Fsimbot-component-mirai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimple-robot%2Fsimbot-component-mirai/lists"}