diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 1cc2dba3..8885153f 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -3,7 +3,7 @@ module.exports = { 'es2021': true, 'node': true }, - 'ignorePatterns': ['src/core/'], + 'ignorePatterns': ['src/core/', 'src/core.lib/'], 'extends': [ 'eslint:recommended', 'plugin:@typescript-eslint/recommended' diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 00000000..2714af10 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,81 @@ +name: Bug 反馈 +description: 报告可能的 NapCat 异常行为 +title: '[BUG] ' +labels: bug +body: + - type: markdown + attributes: + value: | + 欢迎来到 NapCat 的 Issue Tracker!请填写以下表格来提交 Bug。 + 在提交新的 Bug 反馈前,请确保您: + * 已经搜索了现有的 issues,并且没有找到可以解决您问题的方法 + * 不与现有的某一 issue 重复 + - type: input + id: system-version + attributes: + label: 系统版本 + description: 运行 QQNT 的系统版本 + placeholder: Windows 10 Pro Workstation 22H2 + validations: + required: true + - type: input + id: qqnt-version + attributes: + label: QQNT 版本 + description: 可在 QQNT 的「关于」的设置页中找到 + placeholder: 9.9.7-21804 + validations: + required: true + - type: input + id: napcat-version + attributes: + label: NapCat 版本 + description: 可在 LiteLoaderQQNT 的设置页或是 QQNT 的设置页侧栏中找到 + placeholder: 1.0.0 + validations: + required: true + - type: input + id: onebot-client-version + attributes: + label: OneBot 客户端 + description: 连接至 NapCat 的客户端版本信息 + placeholder: Overflow 2.16.0-2cf7991-SNAPSHOT + validations: + required: true + - type: textarea + id: what-happened + attributes: + label: 发生了什么? + description: 填写你认为的 NapCat 的不正常行为 + validations: + required: true + - type: textarea + id: how-reproduce + attributes: + label: 如何复现 + description: 填写应当如何操作才能触发这个不正常行为 + placeholder: | + 1. xxx + 2. xxx + 3. xxx + validations: + required: true + - type: textarea + id: what-expected + attributes: + label: 期望的结果? + description: 填写你认为 NapCat 应当执行的正常行为 + validations: + required: true + - type: textarea + id: napcat-log + attributes: + label: NapCat 运行日志 + description: 粘贴相关日志内容到此处 + render: shell + - type: textarea + id: onebot-client-log + attributes: + label: OneBot 客户端运行日志 + description: 粘贴 OneBot 客户端的相关日志内容到此处 + render: shell \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..5663385c --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,67 @@ +name: "Build" +on: + push: + +jobs: + build-linux: + if: ${{ startsWith(github.event.head_commit.message, 'build:') }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + target_platform: [linux,darwin] + target_arch: [x64, arm64] + steps: + - name: Clone Main Repository + uses: actions/checkout@v4 + with: + repository: 'NapNeko/NapCatQQ' + submodules: true + token: ${{ secrets.NAPCAT_BUILD }} + - name: Use Node.js 20.X + uses: actions/setup-node@v4 + with: + node-version: 20.x + - name: Build NuCat Linux + run: | + npm i --arch=${{ matrix.target_arch }} --platform=${{ matrix.target_platform }} + npm run build:prod + cd dist + npm i --omit=dev --arch=${{ matrix.target_arch }} --platform=${{ matrix.target_platform }} + cd .. + - name: Upload Artifact + uses: actions/upload-artifact@v4 + with: + name: NapCat.${{ matrix.target_platform }}.${{ matrix.target_arch }} + path: dist + build-win32: + if: ${{ startsWith(github.event.head_commit.message, 'build:') }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + target_platform: [win32] + target_arch: [x64] + steps: + - name: Clone Main Repository + uses: actions/checkout@v4 + with: + repository: 'NapNeko/NapCatQQ' + submodules: true + token: ${{ secrets.NAPCAT_BUILD }} + - name: Use Node.js 20.X + uses: actions/setup-node@v4 + with: + node-version: 20.x + - name: Build NuCat Linux + run: | + npm i --arch=${{ matrix.target_arch }} --platform=${{ matrix.target_platform }} + npm run build:prod + cd dist + npm i --omit=dev --arch=${{ matrix.target_arch }} --platform=${{ matrix.target_platform }} + cd .. + - name: Upload Artifact + uses: actions/upload-artifact@v4 + with: + name: NapCat.${{ matrix.target_platform }}.${{ matrix.target_arch }} + path: dist \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f8a3855d..3feeb1df 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,7 +16,7 @@ jobs: - name: Clone Main Repository uses: actions/checkout@v4 with: - repository: 'NapNeko/NapCat' + repository: 'NapNeko/NapCatQQ' submodules: true token: ${{ secrets.NAPCAT_BUILD }} - name: Use Node.js 20.X @@ -46,7 +46,7 @@ jobs: - name: Clone Main Repository uses: actions/checkout@v4 with: - repository: 'NapNeko/NapCat' + repository: 'NapNeko/NapCatQQ' submodules: true token: ${{ secrets.NAPCAT_BUILD }} - name: Use Node.js 20.X @@ -65,3 +65,28 @@ jobs: with: name: NapCat.${{ matrix.target_platform }}.${{ matrix.target_arch }} path: dist + release-napcat: + needs: [build-win32,build-linux] + runs-on: ubuntu-latest + steps: + - name: Download All Artifact + uses: actions/download-artifact@v4 + + - name: Compress subdirectories + run: | + for dir in */; do + base=$(basename "$dir") + zip -r "${base}.zip" "$dir" + done + - name: Create Release Draft and Upload Artifacts + uses: softprops/action-gh-release@v1 + with: + name: NapCat V0.0.0 + token: ${{ secrets.NAPCAT_BUILD }} + files: | + NapCat.win32.x64.zip + NapCat.linux.x64.zip + NapCat.linux.arm64.zip + NapCat.darwin.x64.zip + NapCat.darwin.arm64.zip + draft: true diff --git a/README.md b/README.md index 0dd6aff9..efca330b 100644 --- a/README.md +++ b/README.md @@ -10,13 +10,15 @@ NapCatQQ(瞌睡猫QQ,不准叫我NCQQ!),像睡着了一样在后台低 由于 Linux 上的 QQ 图形依赖较多,会导致内存占用小高,大约 **100+M**,目前正在研究如何优化 +具体占用会因人而异,QQ 群、好友越多占用越高 + ## 下载 前往 Release 页面下载最新版本 ## 启动 -NapCat 是基于 官方NTQQ 实现的Bot框架,因此先需要安装官方QQ +NapCat 是基于 官方NTQQ 实现的Bot框架,因此先需要安装官方QQ,**注意同个账号不能同时登录原版 QQ 和 NapCatQQ** *如果没有安装 QQ 请往后翻查看安装方法* @@ -62,7 +64,9 @@ json 配置内容参数解释: ### Windows 启动 -运行`powershell ./napcat.ps1`, 或者 `napcat.bat`,如果出现乱码,可以尝试运行`napcat_utf8.ps1` +运行`powershell ./napcat.ps1`, 或者 `napcat.bat`,如果出现乱码,可以尝试运行`napcat-utf8.ps1` 或 `napcat-utf8.bat` + +*如果出现 powershell 运行不了,以管理员身份打开 powershell,输入 `Set-ExecutionPolicy RemoteSigned`* ### Linux 启动 @@ -80,17 +84,13 @@ json 配置内容参数解释: 目前还在研究怎么精简安装,暂时只能安装官方QQ整体依赖 -```bash -下载QQ的deb包 +下载QQ [deb x86版本](https://dldir1.qq.com/qqfile/qq/QQNT/Linux/QQ_3.2.7_240403_amd64_01.deb) [deb arm版本](https://dldir1.qq.com/qqfile/qq/QQNT/Linux/QQ_3.2.7_240403_arm64_01.deb) [rpm x86版本](https://dldir1.qq.com/qqfile/qq/QQNT/Linux/QQ_3.2.7_240403_x86_64_01.rpm) [rpm arm版本](https://dldir1.qq.com/qqfile/qq/QQNT/Linux/QQ_3.2.7_240403_aarch64_01.rpm) -``` - -```bash ```bash sudo apt install ./qq.deb @@ -141,6 +141,9 @@ $env:FFMPEG_PATH="d:\ffmpeg\bin\ffmpeg.exe" 不用管,这是正常现象,是因为 QQ 本身的问题,不影响使用 +## API 文档 + +参考 [LLOneBot](https://llonebot.github.io/zh-CN/develop/api) 的文档