diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..c0c911f --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +* @YiriMiraiProject diff --git a/.github/ISSUE_TEMPLATE/01_BUG_REPORT.md b/.github/ISSUE_TEMPLATE/01_BUG_REPORT.md new file mode 100644 index 0000000..a1dd373 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/01_BUG_REPORT.md @@ -0,0 +1,37 @@ +--- +name: Bug Report +about: Create a report to help YiriMirai OneBot to improve +title: "bug: " +labels: "bug" +assignees: "" +--- + +# Bug Report + +**YiriMirai OneBot version:** + + + +**Current behavior:** + + + +**Expected behavior:** + + + +**Steps to reproduce:** + + + +**Related code:** + + + +``` +insert short code snippets here +``` + +**Other information:** + + diff --git a/.github/ISSUE_TEMPLATE/02_FEATURE_REQUEST.md b/.github/ISSUE_TEMPLATE/02_FEATURE_REQUEST.md new file mode 100644 index 0000000..5719147 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/02_FEATURE_REQUEST.md @@ -0,0 +1,35 @@ +--- +name: Feature Request +about: Suggest an idea for this project +title: "feat: " +labels: "enhancement" +assignees: "" +--- + +# Feature Request + +**Describe the Feature Request** + + + +**Describe Preferred Solution** + + + +**Describe Alternatives** + + + +**Related Code** + + + +**Additional Context** + + + +**If the feature request is approved, would you be willing to submit a PR?** +_(Help can be provided if you need assistance submitting a PR)_ + +- [ ] Yes +- [ ] No diff --git a/.github/ISSUE_TEMPLATE/03_CODEBASE_IMPROVEMENT.md b/.github/ISSUE_TEMPLATE/03_CODEBASE_IMPROVEMENT.md new file mode 100644 index 0000000..bcd6cb7 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/03_CODEBASE_IMPROVEMENT.md @@ -0,0 +1,7 @@ +--- +name: Codebase improvement +about: Provide your feedback for the existing codebase. Suggest a better solution for algorithms, development tools, etc. +title: "dev: " +labels: "enhancement" +assignees: "" +--- diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..715c95b --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,6 @@ +--- +blank_issues_enabled: false +contact_links: + - name: YiriMirai OneBot Community Support + url: https://github.com/YiriMiraiProject/YiriMiraiOneBot/discussions + about: Please ask and answer questions here. diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..f999e76 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,28 @@ +# Pull Request + +请检查您的PR引入的更改类型: + +- [ ] 错误修复 +- [ ] 新功能 +- [ ] 代码风格更新(格式化、重命名) +- [ ] 重构(无功能变化,无API变化) +- [ ] 与构建相关的变化 +- [ ] 文档内容变化 +- [ ] 其他(请描述): + +## 当前的行为是什么? + +问题编号:N/A + +## 新的功能是什么? + +What's the new feature? + +## 这是否引入了重大变更? + +- [ ] 是 +- [ ] 否 + +## 其他信息 + +More infomation. diff --git a/.github/labels.yml b/.github/labels.yml new file mode 100644 index 0000000..6fc63e1 --- /dev/null +++ b/.github/labels.yml @@ -0,0 +1,78 @@ +--- +- name: "breaking-change" + color: ee0701 + description: "A change that changes the API or breaks backward compatibility for users." +- name: "bugfix" + color: ee0701 + description: "Inconsistencies or issues which will cause a problem for users or implementors." +- name: "documentation" + color: 0052cc + description: "Solely about the documentation of the project." +- name: "enhancement" + color: 1d76db + description: "Enhancement of the code, not introducing new features." +- name: "refactor" + color: 1d76db + description: "Updating the code with simpler, easier to understand or more efficient syntax or methods, but not introducing new features." +- name: "performance" + color: 1d76db + description: "Improving performance of the project, not introducing new features." +- name: "new-feature" + color: 0e8a16 + description: "New features or options." +- name: "maintenance" + color: 2af79e + description: "Generic maintenance tasks." +- name: "ci" + color: 1d76db + description: "Work that improves the continuous integration." +- name: "dependencies" + color: 1d76db + description: "Change in project dependencies." + +- name: "in-progress" + color: fbca04 + description: "Issue is currently being worked on by a developer." +- name: "stale" + color: fef2c0 + description: "No activity for quite some time." +- name: "no-stale" + color: fef2c0 + description: "This is exempt from the stale bot." + +- name: "security" + color: ee0701 + description: "Addressing a vulnerability or security risk in this project." +- name: "incomplete" + color: fef2c0 + description: "Missing information." +- name: "invalid" + color: fef2c0 + description: "This is off-topic, spam, or otherwise doesn't apply to this project." + +- name: "beginner-friendly" + color: 0e8a16 + description: "Good first issue for people wanting to contribute to this project." +- name: "help-wanted" + color: 0e8a16 + description: "We need some extra helping hands or expertise in order to resolve this!" + +- name: "priority-critical" + color: ee0701 + description: "Must be addressed as soon as possible." +- name: "priority-high" + color: b60205 + description: "After critical issues are fixed, these should be dealt with before any further issues." +- name: "priority-medium" + color: 0e8a16 + description: "This issue may be useful, and needs some attention." +- name: "priority-low" + color: e4ea8a + description: "Nice addition, maybe... someday..." + +- name: "major" + color: b60205 + description: "This PR causes a major bump in the version number." +- name: "minor" + color: 0e8a16 + description: "This PR causes a minor bump in the version number." diff --git a/.github/workflows/labels.yml b/.github/workflows/labels.yml new file mode 100644 index 0000000..494824c --- /dev/null +++ b/.github/workflows/labels.yml @@ -0,0 +1,21 @@ +--- +name: Sync labels + +on: + push: + branches: + - main + paths: + - .github/labels.yml + +jobs: + labels: + name: ♻️ Sync labels + runs-on: ubuntu-latest + steps: + - name: ⤵️ Check out code from GitHub + uses: actions/checkout@v2 + - name: 🚀 Run Label Syncer + uses: micnncim/action-label-syncer@v1.2.0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/lock.yml b/.github/workflows/lock.yml new file mode 100644 index 0000000..20524e8 --- /dev/null +++ b/.github/workflows/lock.yml @@ -0,0 +1,32 @@ +--- +name: Lock + +on: + schedule: + - cron: "0 9 * * *" + workflow_dispatch: + +jobs: + lock: + name: 🔒 Lock closed issues and PRs + runs-on: ubuntu-latest + steps: + - uses: dessant/lock-threads@v2.0.3 + with: + github-token: ${{ github.token }} + issue-lock-inactive-days: "30" + issue-lock-reason: "" + issue-comment: > + Issue closed and locked due to lack of activity. + + If you encounter this same issue, please open a new issue and refer + to this closed one. + pr-lock-inactive-days: "1" + pr-lock-reason: "" + pr-comment: > + Pull Request closed and locked due to lack of activity. + + If you'd like to build on this closed PR, you can clone it using + this method: https://stackoverflow.com/a/14969986 + + Then open a new PR, referencing this closed PR in your message. diff --git a/.github/workflows/pr-labels.yml b/.github/workflows/pr-labels.yml new file mode 100644 index 0000000..9f23629 --- /dev/null +++ b/.github/workflows/pr-labels.yml @@ -0,0 +1,20 @@ +--- +name: PR Labels + +on: + pull_request: + types: [opened, labeled, unlabeled, synchronize] + +jobs: + pr_labels: + name: 🏭 Verify + runs-on: ubuntu-latest + steps: + - name: 🏷 Verify PR has a valid label + uses: jesusvasquez333/verify-pr-label-action@v1.4.0 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + valid-labels: >- + breaking-change, bugfix, documentation, enhancement, + refactor, performance, new-feature, maintenance, ci, dependencies + disable-reviews: true diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml new file mode 100644 index 0000000..5d5a671 --- /dev/null +++ b/.github/workflows/stale.yml @@ -0,0 +1,44 @@ +--- +name: Stale + +on: + schedule: + - cron: "0 8 * * *" + workflow_dispatch: + +jobs: + stale: + name: 🧹 Clean up stale issues and PRs + runs-on: ubuntu-latest + steps: + - name: 🚀 Run stale + uses: actions/stale@v3 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + days-before-stale: 30 + days-before-close: 7 + remove-stale-when-updated: true + stale-issue-label: "stale" + exempt-issue-labels: "no-stale,help-wanted" + stale-issue-message: > + There hasn't been any activity on this issue recently, and in order + to prioritize active issues, it will be marked as stale. + + Please make sure to update to the latest version and + check if that solves the issue. Let us know if that works for you + by leaving a 👍 + + Because this issue is marked as stale, it will be closed and locked + in 7 days if no further activity occurs. + + Thank you for your contributions! + stale-pr-label: "stale" + exempt-pr-labels: "no-stale" + stale-pr-message: > + There hasn't been any activity on this pull request recently, and in + order to prioritize active work, it has been marked as stale. + + This PR will be closed and locked in 7 days if no further activity + occurs. + + Thank you for your contributions! diff --git a/README.md b/README.md index 9801b2d..7f9ed56 100644 --- a/README.md +++ b/README.md @@ -1,85 +1,133 @@ -# YiriMiraiOneBot - -![OneBot: 12 (shields.io)](https://img.shields.io/badge/OneBot-12-black) ![GitHub License](https://img.shields.io/github/license/YiriMiraiProject/YiriMiraiOneBot) ![GitHub Repo stars](https://img.shields.io/github/stars/YiriMiraiProject/YiriMiraiOneBot) [![codecov](https://codecov.io/gh/XYCode-Kerman/YiriMiraiOneBot/graph/badge.svg?token=6ZBJ2BfX4B)](https://codecov.io/gh/XYCode-Kerman/YiriMiraiOneBot) - -YiriMiraiOneBot 是一个 OneBot 12 协议上的 Python SDK,延续 YiriMirai 项目轻量级、低耦合的编码风格。 - -尽管 YiriMiraiOneBot 中带有 Mirai 字样,但由于 OneBot 协议在多个平台上都有不同的实现,因此你也可以将其用于 [LagRange](https://github.com/LagrangeDev/Lagrange.Core) 等项目。并且,从 OneBot 12 开始,OneBot 标准不再与 QQ 紧耦合 -,而是适用于一切支持聊天机器人的地方,因此你也可以将本项目用于编写其他平台上的机器人。 - -> 警告:YiriMiraiOneBot 正处于开发状态,请勿将其用于生产环境。 - -## 功能 -* 适配器 - * [ ] HTTP 适配器 - * [ ] HTTP Webhook 适配器 - * [ ] 正向 WebSocket 适配器 - * [x] 反向 Websocket 适配器 -* 消息类型 - * [x] Text - * [x] Image - * [x] Mention - * [x] Mention_all - * [x] Voice - * [x] Audio - * [x] Video - * [x] File - * [x] Location - * [x] Reply -* 接口定义 - * [ ] 元接口 - * [ ] 元事件 - * [ ] 元动作 - * [ ] 消息接口 - * [x] 消息段 - * [ ] 消息动作 - * [ ] 单用户接口 - * [ ] 用户消息事件 - * [ ] 用户通知事件 - * [ ] 用户动作 - * [ ] 单级群组接口 - * [ ] 群消息事件 - * [ ] 群通知事件 - * [ ] 群动作 - * [ ] 两级群组接口 - * [ ] 群组消息事件 - * [ ] 群组通知事件 - * [ ] 群组动作 - * [ ] 文件接口 - * [ ] 文件动作 - -## 安装 - -您可以将本仓库克隆到本地并作为一个目录使用: + +
+ YiriMirai OneBot +
+ Explore the docs » +
+
+ Report a Bug + · + Request a Feature + .Ask a Question +
+ +
+
+ +[![Project license](https://img.shields.io/github/license/YiriMiraiProject/YiriMiraiOneBot.svg?style=flat-square)](LICENSE) + +[![Pull Requests welcome](https://img.shields.io/badge/PRs-welcome-ff69b4.svg?style=flat-square)](https://github.com/YiriMiraiProject/YiriMiraiOneBot/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22) +[![code with love by YiriMiraiProject](https://img.shields.io/badge/%3C%2F%3E%20with%20%E2%99%A5%20by-YiriMiraiProject-ff1414.svg?style=flat-square)](https://github.com/YiriMiraiProject) + +
+ + + +--- + +## 关于 + +YiriMirai OneBot 是一个 OneBot 12 协议上的 Python SDK,延续 YiriMirai 项目轻量级、低耦合的编码风格。 + +尽管 YiriMirai OneBot 中带有 Mirai 字样,但由于 OneBot 协议在多个平台上都有不同的实现,因此你也可以将其用于 [LagRange](https://github.com/LagrangeDev/Lagrange.Core) 等项目。并且,从 OneBot 12 开始,OneBot 标准不再与 QQ 紧耦合 ,而是适用于一切支持聊天机器人的地方,因此你也可以将本项目用于编写其他平台上的机器人。 + +### 特性 + +YiriMirai OneBot 在设计之初便是支持**异步并发**的,因此你可以用它来编写高性能的机器人应用,或者是开发**SaaS**应用,并将其用于多个场景之中。 + +YiriMirai OneBot 不再**与 `mirai-api-http` 耦合**,而是适用于一切支持 OneBot 11/12 标准的地方。 + +YiriMirai OneBot 的姊妹项目 YiriBot 正在开发,该框架将提供更多适用于聊天机器人开发的**高级API**和**插件系统**。 + +## 快速上手 + +### 先决条件 + +你需要拥有一台安装了**Windows**或**Linux**操作系统的计算机,并在上方安装**Python 3.8 及以上**的解释器和**Poetry** 包管理器。 + +### 安装 + +由于 YiriMirai OneBot 暂未发布到 PyPI,因此你需要手动安装: ```bash -git clone https://github.com/YiriMiraiProject/YiriMiraiOneBot.git ./YiriMiraiOneBot -cd YiriMiraiOneBot +git clone https://github.com/YiriMiraiProject/YiriMiraiOneBot.git poetry install ``` ## 使用 -WIP... +更多详情,请查看 [快速上手 - YiriMirai OneBot Documents](https://docs.yiri-mirai.online/getting-started/)。 -## 参与开发 +## 开发路线图 -参与 YiriMiraiOneBot 的开发,需要遵循开发守则(WIP),并为新添加的代码提供测试代码。 +查看 [Issues](https://github.com/YiriMiraiProject/YiriMiraiOneBot/issues) 了解我们的开发计划(和可能的Bug),以及: -## 开源协议 +- [近期的新功能计划](https://github.com/YiriMiraiProject/YiriMiraiOneBot/issues?q=label%3Aenhancement+is%3Aopen+sort%3Areactions-%2B1-desc) +- [最严重的 Bug](https://github.com/YiriMiraiProject/YiriMiraiOneBot/issues?q=is%3Aissue+is%3Aopen+label%3Abug+sort%3Areactions-%2B1-desc) +- [最新的 Bug](https://github.com/YiriMiraiProject/YiriMiraiOneBot/issues?q=is%3Aopen+is%3Aissue+label%3Abug) -本项目采用 LGPL-3.0、Anti-996 许可证开源,因此使用本项目时,你需要注意以下几点: +## 获取支持 -1. 你可以自由的在代码中以`import`的形式导入并使用 YiriMiraiOneBot 提供的功能,**而不需要开源你使用 YiriMiraiOneBot 编写的业务代码**。 +你可以通过如下方式来获取我们的支持: -2. 如果你对 YiriMiraiOneBot 的代码进行了修改,**你需要同时发布你修改后的 YiriMiraiOneBot**。 +- [GitHub Discussions](https://github.com/YiriMiraiProject/YiriMiraiOneBot/discussions) +- 联系 [YiriMirai Project](https://github.com/YiriMiraiProject) 的组织成员 -3. 如果你引用或修改了本库中的代码(包括`import`本库),你就必须**遵守你所在司法管辖区与劳动和就业相关法律、法规、规则和标准**。 +## 帮助我们的开发 - 如果该司法管辖区没有此类法律、法规、规章和标准或其法律、法规、规章和标准不可执行,则你**必须遵守国际劳工标准的核心公约**。 +如果您想对 YiriMirai OneBot 的积极开发表示**感谢**或/和支持: -4. 使用`0d8f2f`提交以前的代码时,请遵循 AGPL-3.0 协议。 +- 为项目添加 [GitHub Star](https://github.com/YiriMiraiProject/YiriMiraiOneBot)。 +- 在 Twitter 上谈论 YiriMirai OneBot。 +- 在 [Dev.to](https://dev.to/)、[Medium](https://medium.com/) 或您的个人博客上撰写有关该项目的有趣文章。 +让我们一起努力,让 YiriMirai OneBot 变得**更好**! + +## 做出贡献 + +首先,感谢您抽出时间为我们做出贡献!有了您的贡献,开源社区才能成为学习、启发和创造的好地方。您的任何贡献都将惠及其他人,我们将**感激不尽**。 + + +请阅读[我们的贡献指南](docs/CONTRIBUTING.md),并感谢您的参与! + +## 作者和其他贡献者 + +这个项目最初由 [Yiri Mirai Project](https://github.com/YiriMiraiProject) 的成员 [XYCode Kerman](https://github.com/XYCode-Kerman) 发起。 + +有关所有作者和贡献者的完整名单,请参阅[贡献者页面](https://github.com/YiriMiraiProject/YiriMiraiOneBot/contributors)。 + +## 安全性 + +YiriMirai OneBot 遵循良好的安全惯例,但无法保证 100% 的安全性。 + +YiriMirai OneBot 按**"原样 "**提供,不提供任何**担保**。使用风险自负。 + +如需了解更多信息和报告安全问题,请参阅我们的[安全文档](docs/SECURITY.md)。 + +> [!caution] +> +> 请勿通过 Issue 或 Discussion 报告安全性问题,你应当将其发送至 [security@yiri-mirai.online](mailto:security@yiri-mirai.online)。 + +## 许可证 + +本项目采用 **GNU 宽通用公共许可证 v3** 和 **反 996 许可证** 开源,因此使用本项目时,你需要注意以下几点: + +1. 你可以自由的在代码中以`import`的形式导入并使用 YiriMiraiOneBot 提供的功能,**而不需要开源你使用 YiriMiraiOneBot 编写的业务代码**。 +2. 如果你对 YiriMiraiOneBot 的代码进行了修改,**你需要同时发布你修改后的 YiriMiraiOneBot**。 +3. 如果你引用或修改了本库中的代码(包括`import`本库),你就必须**遵守你所在司法管辖区与劳动和就业相关法律、法规、规则和标准**。 + 如果该司法管辖区没有此类法律、法规、规章和标准或其法律、法规、规章和标准不可执行,则你**必须遵守国际劳工标准的核心公约**。 +4. 使用`0d8f2f`提交以前的代码时,请遵循 AGPL-3.0 协议。 5. 有关LGPL-3.0许可证的更多详细信息,请参见 [GNU 宽通用公共许可证 v3.0 - GNU 工程 - 自由软件基金会](https://www.gnu.org/licenses/lgpl-3.0.html)。 +6. 有关Anti-996许可证的更多详细信息,请参见[Anti-996 License Version 1.0](https://github.com/kattgu7/Anti-996-License)和[996.ICU](https://996.icu/#/zh_CN)。 + +## 致谢 + +在本项目的开发过程中,我们深受开源软件社区的启发和支持。没有这些无私的开源贡献者,我们的项目将无法实现。 + +首先,我们向所有参与开源项目的开发者表示最诚挚的感谢。是你们的努力和智慧,构建了一个强大、灵活且不断进步的技术生态系统,让我们能够站在巨人的肩膀上,实现创新和突破。 + +特别感谢**Pydantic**和**Websockets**库的维护者和贡献者,你们的代码为我们提供了坚实的基础,使我们能够专注于项目的核心功能和创新点。 + +其次,我们向所有支持和推动**开源运动**、**自由软件运动**、**反 996 运动**的组织和个人以及致敬。你们的努力让开源不仅仅是一种技术实践,更是一种促进知识共享、协作和创新的文化。 -6. 有关Anti-996许可证的更多详细信息,请参见[Anti-996 License Version 1.0](https://github.com/kattgu7/Anti-996-License)和[996.ICU](https://996.icu/#/zh_CN)。 \ No newline at end of file +我们相信,开源的力量将继续推动技术的发展和创新,我们期待与开源社区共同成长,为建设一个更加开放和协作的技术世界贡献力量。 diff --git a/docs/CODE_OF_CONDUCT.md b/docs/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..e15f2d7 --- /dev/null +++ b/docs/CODE_OF_CONDUCT.md @@ -0,0 +1,45 @@ +# CONTRIBUTOR COVENANT CODE OF CONDUCT(贡献者公约行为准则) + +## 我们的承诺 + +为了营造一个开放和友好的环境,我们作为贡献者和维护者承诺使我们的项目和社区成为每个人无骚扰的体验,无论年龄、体型、残疾、种族、性别特征、性别认同和表达、经验水平、教育程度、社会经济地位、国籍、个人外貌、种族、宗教或性取向。 + +## 我们的标准 + +有助于创造积极环境的行为示例包括: + +- 使用欢迎和包容的语言 +- 尊重不同的观点和经验 +- 优雅地接受建设性批评 +- 专注于对社区最有利的事情 +- 对其他社区成员表示同情 + +参与者不可接受的行为示例包括: + +- 使用性化语言或图像以及不受欢迎的性注意或进步 +- 挑衅、侮辱/贬损性评论和个人或政治攻击 +- 公开或私下骚扰 +- 未经明确许可发布他人的私人信息,如物理或电子地址 +- 其他在专业场合可能被认为是不恰当的行为 + +## 我们的责任 + +项目维护者负责澄清可接受行为的标准,并期望对任何不可接受行为的实例采取适当和公正的纠正措施。 + +项目维护者有权和责任删除、编辑或拒绝不符合本行为准则的评论、提交、代码、wiki编辑、问题和其他贡献,或者禁止任何贡献者因他们认为不适当、威胁、冒犯或有害的其他行为,暂时或永久。 + +### 范围 + +本行为准则适用于所有项目空间,并且当个人在公共空间代表项目或其社区时也适用。代表项目或社区的示例包括使用官方项目电子邮件地址、通过官方社交媒体账户发布或作为在线或离线事件的指定代表行事。项目代表的定义和澄清可能由项目维护者进一步定义和澄清。 + +### 执行 + +可报告滥用、骚扰或不可接受行为的实例,通过使用任何私人联系地址联系项目维护者。所有投诉都将被审查和调查,并将以必要和适当的方式响应情况。项目团队有义务对事件的报告者保持机密性。具体的执行政策的更多细节可能会单独发布。 + +不以善意遵循或执行行为准则的项目维护者可能会面临其他项目领导成员决定的临时或永久的后果。 + +## 归属 + +本行为准则改编自贡献者公约,版本1.4,可在 https://www.contributor-covenant.org/version/1/4/code-of-conduct.html 查看。 + +有关此行为准则的常见问题答案,请访问 https://www.contributor-covenant.org/faq diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md new file mode 100644 index 0000000..2a5f7f7 --- /dev/null +++ b/docs/CONTRIBUTING.md @@ -0,0 +1,41 @@ +# CONTRIBUTING(贡献指南) + +当您想为这个仓库做出贡献时,请首先通过问题、电子邮件或与仓库所有者的任何其他方法讨论您希望进行的更改,然后再进行更改。 + +请注意我们有一个行为准则,请在与项目的所宨互动中遵循它。 + +## 开发环境设置 + +要设置开发环境,请按照以下步骤: + +```sh +git clone https://github.com/YiriMiraiProject/YiriMiraiOneBot +poetry install +``` + +## 问题和功能请求 + +您发现了源代码中的错误、文档中的错误,或者也许您想要一个新功能?查看GitHub讨论,看看是否已经在讨论。您可以通过在GitHub上提交问题来帮助我们。在您创建问题之前,请确保搜索问题存档——您的问题可能已经被解决! + +请尝试创建以下类型的错误报告: + +- **可复现**:包括复现问题的步骤。 +- **具体**:尽可能多地包括细节:哪个版本,什么环境等。 +- **独特**:不要重复已经打开的问题。 +- **限定在单个错误**:一个报告一个错误。 + +更好的是:**提交一个带有修复或新功能的拉取请求!** + +## 如何提交拉取请求 + +首先在我们仓库中搜索与您的提交相关的开放或已关闭的拉取请求,除非你想做无用功。然后 + +1. Fork 项目 + +2. 创建您的功能分支(`git checkout -b feature/amazing_feature`) + +3. 提交您的更改(`git commit -m ':sparkles: a good feature'`) + +4. 推送到分支(`git push origin feature/amazing_feature`) + +5. 打开拉取请求 diff --git a/docs/SECURITY.md b/docs/SECURITY.md new file mode 100644 index 0000000..dc4c074 --- /dev/null +++ b/docs/SECURITY.md @@ -0,0 +1,23 @@ +# SECURITY POLICY(安全政策) + +## 报告漏洞 + +如果在YiriMirai OneBot中存在任何漏洞,请不要犹豫立即报告它们。 + +1. 使用任何**私人联系地址**,例如发送邮件到[security@yiri-mirai.online](mailto:security@yiri-mirai.online) + +2. 描述漏洞。 + +3. 如果您有修复方案,请在您的消息中附上或总结它! + +4. 我们将评估漏洞,并在必要时发布修复或缓解措施来解决它。我们将与您联系以告知结果,并将在报告中对您进行致谢。 + +**请不要在发布修复之前公开披露漏洞!** + +除非我们: + +1. 发布了修复 + +2. 因任何原因拒绝解决漏洞 + +**您就可以公开披露它。** diff --git "a/docs/\345\274\200\345\217\221\345\256\210\345\210\231.md" "b/docs/\345\274\200\345\217\221\345\256\210\345\210\231.md" deleted file mode 100644 index 1fd1e94..0000000 --- "a/docs/\345\274\200\345\217\221\345\256\210\345\210\231.md" +++ /dev/null @@ -1,29 +0,0 @@ -# YiriMiraiOneBot 开发守则 - -除非本项目另有说明,否则编码一律需要遵循[PEP8](https://peps.python.org/pep-0008/)。不符合开发守则的PR将会被关闭。 - -## 开发前的工作 - -开发前,您应当提前通过[Issue](https://github.com/YiriMiraiProject/YiriMiraiOneBot/issues)与维护者进行交流,确保你即将进行的工作是我们所需要的。 - -修复Bug前,应当先提起[Issue](https://github.com/YiriMiraiProject/YiriMiraiOneBot/issues)报告该问题。增加新功能前,应当先在[Issue](https://github.com/YiriMiraiProject/YiriMiraiOneBot/issues)中说明自己将会增加的内容,获得项目维护者的同意后,再开始开发。 - -## Issues - -提起Issue前,应当**善用搜索功能**,检查当前有无相同的Issue。 - -### 报告问题 - -对于报告问题的Issue,应当附上有关的日志信息,如该问题与系统环境有关,还应当附上有关的环境信息。 - -### 增加新功能 - -对于增加新功能的Issue,应当描述新功能的内容,并说明其对已有代码的侵入程度,以及合并方式(直接修改仓库、发起PR)。 - -## 分支 - -| 分支 | 用途 | 备注 | -| ---------------- | ---------- | ---------------------------------------- | -| main | 主分支 | | -| develop | 开发分支 | 足以作为一个新版本发布时,合并到main分支 | -| feature_`新功能` | 新功能分支 | 合并到develop分支 | \ No newline at end of file