Skip to content

Commit 66f149f

Browse files
wyf9advan101224HuangJingithub-actions[bot]RhenCloud
authored
v0.3 (#15)
* upload cqface map 0-89 * dc add ping replace / allowed_mentions set to avoid mention spam * cqface mapping to unicode done (but db outdated...) Co-authored-by: advan10 <honyu_reflame@outlook.com> Co-authored-by: 1224HuangJin <169712528+1224HuangJin@users.noreply.github.com> * [skip ci] style: code auto-fix & format * update cqface map 245-417 Co-authored-by: 1224HuangJin <169712528+1224HuangJin@users.noreply.github.com> * update cqface db 419-470 (end?) * others -> tg: process image with padding to avoid tg api limits (aspect ratio < 20) * [skip ci] style: code auto-fix & format * qq .amr voice file parse 2 ogg * [skip ci] style: code auto-fix & format * [untested] built-in commands prefix support * [skip ci] style: code auto-fix & format * refactor: rename user to nickname, add username field * feat: fetch username in mattermost driver * update cqface map 419-470 (end) - performance optimize by replace if...elif with match...case (?) Co-authored-by: 1224HuangJin <169712528+1224HuangJin@users.noreply.github.com> * user -> nickname * temp disable get_qid func in napcat * [skip ci] style: code auto-fix & format * [untested] fastapi shared http server * [skip ci] style: code auto-fix & format * update HTTP server port to 9080 - enhance media fetching with retry logic - webhook_path is no longer a secret now - uvicorn log catching - yunhu driver tested * [untested] napcat support forwarding messages handle * [skip ci] style: code auto-fix & format * fix: cross-platform mentions now only matches binded users * [untested] napcat forwarding cqface * [skip ci] style: code auto-fix & format * db migration support & napcat forwarding enhancement * [skip ci] style: code auto-fix & format * bump version * reduce qq forward node logs * qq forward download image as base64 - add global base_url config - adjust the function of forward_render_base_url (renamed from forward_assets_base_url) * db migration use db_version number instead of program version - qq forward assets from base64 to single file hosting - qq asset url probe script * [skip ci] style: code auto-fix & format * update NapCat and rules documentation for merged-forward rendering and TTL settings * qq -> discord: better mention reply & untrusted uids handling - qq fix seq get (?) - qq combined forward: uid not trusted flag * qq combined forward: mine whitelist - qq -> discord: ??? * [skip ci] style: code auto-fix & format * fix: discord bot sending now will fallback to user_id when username is not found, not sending message content directly * [untested] qq: lagrange & onebot v11 protocol support * [skip ci] style: code auto-fix & format * fix some lint error and add ty to recommandation extensions * upd workflow - add ty & github annotations support * add code-spell-checker to recommended extensions * feat: add cross-platform ping by nickname support * add prek.toml with ruff and ty hooks * feat(qq): add ws_ssl_verify config and enable qid support * feat: improve cross-platform ping by target resolution * fix(telegram): add command pass-through for /ping * feat: add docker support with Dockerfile and docker-compose * add docker image CI workflow * add 0.*-dev branches to docker workflow * add Docker Hub support to workflow * modded something about except Excepion: ...? - workflow condition blacklist to whitelist - rm BLE001 from ruff ignore lst * [skip ci] style: code auto-fix & format * add command help showing when typing /(command_prefix) such as /nb * fix http server start logging issue * [skip ci] style: code auto-fix & format * remove docs folder, package.json and pnpm-lock.yaml (docs moving to separate repo) Agent-Logs-Url: https://github.com/siiway/NextBridge/sessions/c0abbf3d-296e-4b0b-9156-874e7793cfa5 Co-authored-by: columbiahyperseleneia <258614957+columbiahyperseleneia@users.noreply.github.com> * replace python-olm with fresholm * fix: voice / video messges forwarded to qq will not send header Co-authored-by: Copilot <copilot@github.com> * fix: import error - username **IS NOT** user display name (nickname), **IS** user id (string not number) --------- Co-authored-by: advan10 <honyu_reflame@outlook.com> Co-authored-by: 1224HuangJin <169712528+1224HuangJin@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: RhenCloud <i@rhen.cloud> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: columbiahyperseleneia <258614957+columbiahyperseleneia@users.noreply.github.com> Co-authored-by: Copilot <copilot@github.com>
1 parent d8e500d commit 66f149f

92 files changed

Lines changed: 5962 additions & 1564 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.codegeexignore

Lines changed: 0 additions & 23 deletions
This file was deleted.

.dockerignore

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Python
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
*.so
6+
.Python
7+
*.egg-info/
8+
dist/
9+
build/
10+
*.egg
11+
12+
# Virtual environments
13+
venv/
14+
env/
15+
ENV/
16+
.venv
17+
18+
# IDE
19+
.vscode/
20+
.idea/
21+
*.swp
22+
*.swo
23+
*~
24+
25+
# OS
26+
.DS_Store
27+
Thumbs.db
28+
29+
# Git
30+
.git/
31+
.gitignore
32+
33+
# Documentation
34+
docs/
35+
*.md
36+
!README.md
37+
38+
# Tests
39+
tests/
40+
*_test.py
41+
test_*.py
42+
43+
# Data (will be mounted as volume)
44+
data/
45+
*.db
46+
*.log
47+
48+
# Lock files (will be regenerated)
49+
uv.lock
50+
pnpm-lock.yaml
51+
52+
# Other
53+
.env
54+
.env.local

.envrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# .envrc
2+
export VIRTUAL_ENV=.venv
3+
layout python3

.github/workflows/docker.yml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: Docker Image CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- 0.*-dev
8+
paths-ignore:
9+
- ".github/**"
10+
- "docs/**"
11+
- "**/*.md"
12+
pull_request:
13+
branches:
14+
- main
15+
- 0.*-dev
16+
workflow_dispatch:
17+
18+
env:
19+
REGISTRY: ghcr.io
20+
IMAGE_NAME: ${{ github.repository }}
21+
DOCKERHUB_REGISTRY: docker.io
22+
DOCKERHUB_IMAGE_NAME: ${{ vars.DOCKERHUB_USERNAME }}/${{ github.repository }}
23+
24+
jobs:
25+
build-and-push:
26+
runs-on: ubuntu-latest
27+
permissions:
28+
contents: read
29+
packages: write
30+
31+
steps:
32+
- name: Checkout repository
33+
uses: actions/checkout@v4
34+
35+
- name: Set up QEMU
36+
uses: docker/setup-qemu-action@v3
37+
38+
- name: Set up Docker Buildx
39+
uses: docker/setup-buildx-action@v3
40+
41+
- name: Log in to the Container registry
42+
uses: docker/login-action@v3
43+
with:
44+
registry: ${{ env.REGISTRY }}
45+
username: ${{ github.actor }}
46+
password: ${{ secrets.GITHUB_TOKEN }}
47+
48+
- name: Log in to Docker Hub
49+
if: ${{ github.event_name != 'pull_request' }}
50+
uses: docker/login-action@v3
51+
with:
52+
registry: ${{ env.DOCKERHUB_REGISTRY }}
53+
username: ${{ vars.DOCKERHUB_USERNAME }}
54+
password: ${{ secrets.DOCKERHUB_TOKEN }}
55+
56+
- name: Extract metadata (tags, labels) for Docker
57+
id: meta
58+
uses: docker/metadata-action@v5
59+
with:
60+
images: |
61+
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
62+
${{ env.DOCKERHUB_REGISTRY }}/${{ env.DOCKERHUB_IMAGE_NAME }}
63+
tags: |
64+
type=ref,event=branch
65+
type=ref,event=pr
66+
type=semver,pattern={{version}}
67+
type=semver,pattern={{major}}.{{minor}}
68+
type=semver,pattern={{major}}
69+
type=sha,prefix={{branch}}-
70+
type=raw,value=latest,enable={{is_default_branch}}
71+
72+
- name: Build and push Docker image
73+
uses: docker/build-push-action@v5
74+
with:
75+
context: .
76+
push: ${{ github.event_name != 'pull_request' }}
77+
tags: ${{ steps.meta.outputs.tags }}
78+
labels: ${{ steps.meta.outputs.labels }}
79+
platforms: linux/amd64,linux/arm64
80+
cache-from: type=gha
81+
cache-to: type=gha,mode=max
Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
1-
name: Ruff Lint & Format & Auto Fix
1+
name: Ruff + Ty Auto Fix
22

33
on:
44
push:
5-
branches-ignore:
6-
- "dependabot/**"
7-
- "temp/**"
8-
- "scratch/**"
9-
paths-ignore:
10-
- ".github/**"
11-
- "docs/**"
12-
- "**/*.md"
5+
paths:
6+
- "**/*.py"
7+
- "**/*.pyi"
8+
- "pyproject.toml"
9+
- "pyrightconfig.json"
10+
- "uv.lock"
1311
pull_request:
12+
paths:
13+
- "**/*.py"
14+
- "**/*.pyi"
15+
- "pyproject.toml"
16+
- "pyrightconfig.json"
17+
- "uv.lock"
1418
workflow_dispatch:
1519

1620
jobs:
@@ -25,13 +29,19 @@ jobs:
2529
with:
2630
token: ${{ secrets.GITHUB_TOKEN }}
2731

32+
- name: Set up uv
33+
uses: astral-sh/setup-uv@v6
34+
2835
- name: Install Ruff & Run Fix (lint issues)
2936
uses: astral-sh/ruff-action@v3
3037
with:
31-
args: "check --fix"
38+
args: "check --fix --output-format=github"
3239

3340
- name: Run Ruff format
34-
run: ruff format .
41+
run: ruff format --output-format=github
42+
43+
- name: Run Ty check
44+
run: uv run ty check --output-format=github
3545

3646
- name: Auto commit fixes with Verified badge
3747
uses: siiway/verified_bot_commit@v0

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# sync to .codegeexignore
21
# Python-generated files
32
__pycache__/
43
*.py[oc]

.vscode/extensions.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33
"charliermarsh.ruff",
44
"tamasfe.even-better-toml",
55
"yzhang.markdown-all-in-one",
6-
"astral-sh.ty",
6+
// "astral-sh.ty",
77
"ms-python.python",
8-
"redhat.vscode-yaml"
8+
"redhat.vscode-yaml",
9+
"astral-sh.ty",
10+
"streetsidesoftware.code-spell-checker"
911
]
10-
}
12+
}

.vscode/mcp.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// {
2+
// "servers": {
3+
// "NapCat API docs": {
4+
// "command": "npx",
5+
// "args": [
6+
// "-y",
7+
// "apifox-mcp-server@0.0.17",
8+
// "--project-id=5348325"
9+
// ],
10+
// "env": {
11+
// "APIFOX_ACCESS_TOKEN": "${input:access-token}"
12+
// },
13+
// "type": "stdio"
14+
// }
15+
// },
16+
// "inputs": [
17+
// {
18+
// "id": "access-token",
19+
// "type": "promptString",
20+
// "description": "Please enter your Apifox Access Token"
21+
// }
22+
// ]
23+
// }

.vscode/settings.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
{
2-
"Codegeex.RepoIndex": true,
32
"ty.diagnosticMode": "workspace",
4-
"python.defaultInterpreterPath": "${workspaceFolder}/.venv/Scripts/python.exe"
3+
"[python]": {
4+
"diffEditor.ignoreTrimWhitespace": false,
5+
"editor.formatOnType": true,
6+
"editor.wordBasedSuggestions": "off",
7+
"editor.defaultFormatter": "charliermarsh.ruff"
8+
}
59
}

AGENTS.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# NextBridge 开发
2+
3+
1. 请忽略本文档语言,跟随用户的语言回答
4+
2. 项目使用 `uv` 作为包管理器,依赖须写入 `pyproject.toml` 而非 `requirements.txt``uv.lock`
5+
3. 项目可用 lint: `ruff check --fix` & `ruff format` (未在虚拟环境可能需要 `uv run ...`)
6+
4. 在 增/删/改 功能时,同步修改对应的中文 & 英文文档部分 (`docs/` 下)
7+
5. 在增加新 driver 时,需要在 `README.md``Special Thanks` 部分增加 driver 使用的库 (没有则不管)
8+
6. 在达到 1.0 版本之前,不需要考虑代码的旧版本兼容性 (但是需要记忆下破坏性修改,以便在 release notes 中提及)
9+
10+
# 可用的 driver api 文档
11+
12+
> [!IMPORTANT]
13+
> 请只根据现在**正在编辑的功能**按需读取
14+
15+
## QQ (NapCat) API Docs
16+
17+
https://s.apifox.cn/apidoc/docs-site/5348325/llms.txt
18+
19+
## QQ (Lagrange) API Docs
20+
21+
Lagrange.OneBot: https://lagrange-onebot.apifox.cn/llms.txt
22+
23+
## QQ (OneBot v11) API Docs
24+
25+
https://github.com/botuniverse/onebot-11#%E5%86%85%E5%AE%B9%E7%9B%AE%E5%BD%95
26+
27+
## Yunhu API Docs
28+
29+
- 接入准备:
30+
- 开发须知: https://www.yhchat.com/document/1-3
31+
- 服务端 API 列表: https://www.yhchat.com/document/1-4
32+
- 服务端错误代码: https://www.yhchat.com/document/1-5
33+
- 消息管理:
34+
- 发送消息: https://www.yhchat.com/document/400-410
35+
- 批量发送消息: https://www.yhchat.com/document/400-421
36+
- 流式发送消息: https://www.yhchat.com/document/400-455
37+
- 编辑消息: https://www.yhchat.com/document/400-437
38+
- 撤回消息: https://www.yhchat.com/document/400-451
39+
- 消息列表: https://www.yhchat.com/document/400-450
40+
- 上传图片: https://www.yhchat.com/document/400-452
41+
- 上传视频: https://www.yhchat.com/document/400-453
42+
- 上传文件: https://www.yhchat.com/document/400-454
43+
44+
> 其他相关性小的 API 已省略.

0 commit comments

Comments
 (0)