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 - -   [](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] 消息段 - * [ ] 消息动作 - * [ ] 单用户接口 - * [ ] 用户消息事件 - * [ ] 用户通知事件 - * [ ] 用户动作 - * [ ] 单级群组接口 - * [ ] 群消息事件 - * [ ] 群通知事件 - * [ ] 群动作 - * [ ] 两级群组接口 - * [ ] 群组消息事件 - * [ ] 群组通知事件 - * [ ] 群组动作 - * [ ] 文件接口 - * [ ] 文件动作 - -## 安装 - -您可以将本仓库克隆到本地并作为一个目录使用: + +