Commit Graph
4956 Commits
Author SHA1 Message Date
手瓜一十雪 0fcd0e80e0 Revert "添加自动登录 | feat(login): automatically restore last logged-in account (#1980)"
This reverts commit 31c45bf18e4ea2cc23f6492304fef88afb8e8302.
2026-08-07 17:47:00 +08:00
Chace 624ecf5b9a fix: restore PNG thumbnails for direct video sends (#2000) 2026-08-07 17:47:00 +08:00
叫我饼干ちゃん 63a349d119 添加自动登录 | feat(login): automatically restore last logged-in account (#1980)
* feat(login): automatically restore last logged-in account

* docs(shell): correct quick login argument examples
2026-08-07 17:47:00 +08:00
Leslie Lau 56549cd0f2 fix: report non-latest private message recalls (#1998) 2026-08-07 17:47:00 +08:00
Zizheng Guo ead24423b5 feat(group): add group management APIs (#1996) 2026-08-07 17:46:59 +08:00
Chace f0e045df35 fix: 修复合并转发视频过期及移动端延迟显示问题 (#1983)
* fix: 修复合并转发视频过期问题

* fix: 修复移动端合并转发内容延迟显示问题

* fix: 同步 ffmpegAddon 视频封面处理产物
2026-08-07 17:46:59 +08:00
Airline233 33ee94ab0f feat(qzone): add QQ space message deletion functionality (#1978)
- Add deleteQzoneMsg API method to NTQQWebApi for deleting Qzone posts by tid
- Implement buildQzoneDeleteBody to construct form-encoded request payload
- Implement parseQzoneDeleteResponse to validate deletion API response
- Add QzoneDeleteResponse and QzoneDeleteParams type definitions
- Create DeleteQzoneMsg OneBot action handler with payload validation
- Register delete_qzone_msg action in router and action handlers
- Add example payload and response for DeleteQzoneMsg action
- Add comprehensive unit tests for delete body construction and response parsing
- Fix indentation inconsistency in createAlbumCommentRequest call
2026-08-07 17:46:59 +08:00
Airline233 cbec362ed1 feat(qzone): add QQ space message publishing and image upload (#1965)
- Add QzonePublishResponse interface and parsing logic for publish API responses
- Add buildQzonePublishBody function to construct publish request parameters
- Add buildQzoneUploadImageBody function to construct image upload request parameters
- Add parseQzoneUploadImageResponseText function to parse upload API responses
- Add toQzoneRichval function to format image data for publish requests
- Add publishQzoneMsg method to NTQQWebApi for publishing space messages with optional images
- Add uploadImageToQzone method to NTQQWebApi for uploading images to QQ space
- Add getQzoneAuth private method to retrieve authentication tokens (skey, pskey, g_tk)
- Add SendQzoneMsg action handler to expose QQ space publishing via OneBot API
- Add comprehensive unit tests for all Qzone data construction and parsing functions
- Update action router to register SendQzoneMsg action
- Update action examples to demonstrate Qzone publishing usage
2026-08-07 17:46:58 +08:00
手瓜一十雪 766ca6e071 Update QQNT release download URLs
Refresh the downstream release workflow to use the newer QQNT 3.2.30-50969 AppImage URLs for both x86_64 and arm64 builds.

Update release note prompt and AI model

Clarifies the release note prompt to require strict output format without wrapping the result in a code block. Also updates the release publish workflow to use `google/gemma-4-26b-a4b-it:free` instead of the previous OpenAI model endpoint setting.

Update QQNT installer URL in release workflow

Switches the release publish workflow to download a newer QQNT x64 installer (9.9.32.50969) from the updated qqdl.gtimg.cn source instead of the previous dldir1v6.qq.com link.

Add mappings for QQ 50969 builds

Add appid/QUA entries and native/packet send-recv offsets for the new 9.9.32-50969 Windows build and 3.2.30-50969 Linux x64/arm64 builds. Also normalize the existing 3.2.30-50828 x64 native recv offset format by removing the leading zero.
2026-08-07 17:46:36 +08:00
colGem 7c2514be6c fix: 将显式 group_id 优先级提升至 getTempChatInfo 缓存之前 (#1963)
## 问题
调用 send_private_msg 时,即使显式传入了 group_id 参数以指定通过某个群发起临时会话,由于 createContext() 中 getTempChatInfo(查询旧的临时会话缓存)的优先级高于显式 group_id,导致实际使用的是旧缓存所在群,而非调用方指定的群。

当缓存所在群不允许临时会话时(QQ 错误码 103),即使传入的 group_id 对应的群已开启临时会话,消息发送仍然失败。

## 根因
createContext() 的判断顺序为:
  1. 是好友 → C2C
  2. 不是好友 → getTempChatInfo 命中缓存 → 用缓存群
  3. 缓存未命中且传了 group_id → 用显式群

第 2 步应该在第 3 步之后:调用方显式指定的 group_id 是主动意图,应优先于内部缓存。

## 修复
将 if (payload.group_id) 判断移至 getTempChatInfo 之前,使优先级变为:
  1. 是好友 → C2C
  2. 不是好友且传了 group_id → 用显式群
  3. 缓存命中 → 用缓存群(兜底)

未传入 group_id 时的行为完全不变。

## 测试

已通过 patch 编译产物 napcat.mjs 在生产环境验证,确认 group_id 参数现在可以
正确指定临时会话来源群。

Signed-off-by: colGem <62532175+colGem-ga@users.noreply.github.com>
2026-07-19 20:20:11 +08:00
738e272d2c fix(onebot): 引用回复解析中 quick_reply 形参未解构导致 reply 段丢失 (#1952)
* fix(onebot): destructure quick_reply in replyElement converter

parseMessageSegments passes the whole RecvMessageContext object as the
4th argument to element converters, but replyElement declared the
parameter as `quick_reply` without destructuring. The object is always
truthy, so every reply element took the quick-reply branch and skipped
lookup methods 2/3 whenever method 1 found no match, dropping the reply
segment from the reported OneBot message (it degrades to at + text).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix(onebot): fall back to msgSeq match when msgRandom mismatches in reply lookup

All three reply lookup methods matched candidates only by msgRandom
whenever records.msgRandom was present. When the recorded msgRandom is
stale or inconsistent with the message database, the quoted message
returned by a seq-based query was discarded even though its msgSeq
matched exactly. Match by msgRandom first and fall back to an exact
msgSeq match.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: xulang <xuxiaolang2003@gmail.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-08 09:46:59 +08:00
Yahoo f7edbfd8d9 fix(onebot): relax packet status check for send poke (#1945) 2026-07-06 12:41:49 +08:00
墨梓柒 74dc33fee6 fix: return real used_space/total_space for get_group_file_system_info (#1944)
The action hardcoded used_space=0 and total_space=10GiB. The kernel's
getGroupFileList call already returns the group's space usage in its
groupSpaceResult, so read it (a single-item fetch) instead of the
placeholders. Falls back to the previous constants when the field is
absent, so there is no regression.

Also relax the empty-count guard from `!groupFileCount` to `=== undefined`
so a group with zero files is not mistaken for "Group not found".
2026-07-05 11:10:44 +08:00
mitsukina c95dd3d030 Add mappings for 9.9.32 and 3.2.30 builds
Update external version metadata to support new QQ releases. Added appid/qua entries for 9.9.32-50828 and 3.2.30-50828, plus corresponding send/recv native and packet offsets across x64 and arm64 targets.
2026-07-03 19:21:27 +08:00
Bluemangoo 68e6a9bff9 fix: 修复如[CQ:face,id=*,raw=[object Object]]的问题。 (#1932) 2026-06-24 15:38:47 +08:00
手瓜一十雪 5c18a62530 add .claude to gitignore 2026-06-20 12:46:49 +08:00
手瓜一十雪 a82a5d5203 chore: .claude delete 2026-06-20 12:46:08 +08:00
手瓜一十雪 93efce86ca feat: re 2026-06-20 12:41:32 +08:00
Ryokuryuneko 091c012427 feat(webui): 添加双重登录验证(2FA)功能 (#1920)
* feat(webui): 添加双重登录验证(2FA)功能

* fix: 修复 store.delete 类型错误,添加完整项目文件

* feat(webui): 添加双重登录验证(2FA)功能

- 后端:实现 TOTP 验证码生成和验证
- 后端:添加 enable2FA 和 totpSecret 配置项
- 后端:登录处理器支持 2FA 验证
- 前端:添加 2FA 登录流程和配置页面

* feat(webui): 添加双重登录验证(2FA)功能

- 后端:实现 TOTP 验证码生成和验证 (TotpHelper.ts)
- 后端:添加 enable2FA 和 totpSecret 配置项 (config.ts)
- 后端:登录处理器支持 2FA 验证,添加 2FA 管理 API (Auth.ts)
- 后端:注册 2FA 相关路由 (auth.ts)
- 前端:登录页面添加 2FA 验证步骤 (web_login.tsx)
- 前端:添加 2FA 相关 API 调用方法 (webui_manager.ts)
- 前端:添加 2FA 配置页面 (webui.tsx)

* fix: 更新 AuthResponse 类型定义以支持 2FA

* fix: 修复 setLocalToken 类型错误

* fix: 修复 TotpHelper.ts 类型错误

* fix: address PR review feedback

- Remove database files from tracking
- Use local QRCodeSVG instead of third-party API
- Remove unused verify2FACode method
- Remove IP-based challenge storage (password already validated)
- Require TOTP code to disable 2FA
- Remove duplicate loginWithTokenAndTotp method
- Remove unused generateTotp method
- Use consistent English error messages

* fix: remove unused store import

* chore: translate 2FA UI to Chinese
2026-06-20 09:56:54 +08:00
tzhd427 8a3faf64f9 对WebUI布局的修改 (#1906)
* 把“系统设置-修改密码”移动到“系统设置-WebUI配置”中

* 修正语法错误

* 把修改密码移动到上方
2026-06-17 01:01:10 +08:00
cc10143 fbd70bbb04 fix: reset QQLoginStatus on KickedOffLine to prevent WebUI re-login block (#1896)
When QQ kicks the bot offline, the WebUI incorrectly shows the account as still
logged in, blocking users from re-login via QR code or password until NapCat is
restarted.

Root cause: The KickedOffLine event handlers in both the shell (base.ts) and
framework (napcat.ts) only set the error message without resetting
QQLoginStatus. The QQGetQRcodeHandler and other login endpoints check
getQQLoginStatus() and reject all re-login attempts when it remains true.

Fix: Set QQLoginStatus to false in both event handlers, ensuring the WebUI
state syncs with the actual account status when kicked offline.

Two changes:
- napcat-shell/base.ts: add setQQLoginStatus(false) before setQQLoginError()
- napcat-framework/napcat.ts: register a KickedOffLine listener that resets
  the login status (the framework previously had no KickedOffLine listener)

Fixes: #508, #1818
2026-06-11 14:43:16 +08:00
MliKiowa c405b6d0a4 docs: 社区进一步限制
Signed-off-by: MliKiowa <nanaeonn@outlook.com>
2026-06-09 23:45:19 +08:00
手瓜一十雪 3a4b335062 feat 2026-06-08 20:01:03 +08:00
Qiao 9aa11fd7c4 fix: 校验群名片设置结果 (#1880) 2026-06-04 23:56:45 +08:00
手瓜一十雪 8ae11bfdca Add 49738 build metadata to external JSONs
Register new builds and architecture-specific offsets/IDs for 9.9.31-49738 and 3.2.29-49738. Updated packages/napcat-core/external/appid.json to add appid/qua entries, and napi2native.json and packet.json to add send/recv offsets for x64 (and arm64 where applicable). These additions track the new builds and their native mappings.
2026-06-03 12:13:20 +08:00
Qiao 6acf350613 feat(onebot): add custom face management actions (#1879) 2026-06-02 22:51:27 +08:00
liuwanwan 0af6445d5a fix: 修复 lint 校验失败 (#1867) 2026-05-28 14:14:50 +08:00
liuwanwan a716a1a185 fix: correct HTTP method case comparison in httpApiRequest (#1865)
Express req.method returns uppercase strings ('GET', 'POST', etc.),
so `req.method === 'get'` never matches. This caused GET requests
to fall through to the else-if branch instead of directly using
req.query as the payload.

Closes NapNeko/NapCatQQ#1864
2026-05-26 22:41:33 +08:00
手瓜一十雪 8c9fc7edf4 README: suggest SnowLuma as GUI replacement
Replace the previous "New Feature" section with a short suggestion to try SnowLuma as a NapCat GUI alternative. Removes the v4.8.115+ notes about Stream API and recommending string IDs, simplifying the README and pointing users to the SnowLuma GitHub repository.
2026-05-26 18:23:23 +08:00
idranme 1abad76ac9 feat: 新增获取群组今日打卡列表功能 (#1855)
* feat: add group signed list API and OneBot action

* feat: register GetGroupSignedList action handler
2026-05-24 20:16:14 +08:00
手瓜一十雪 484c181050 Set rootDir in package tsconfigs
Add compilerOptions.rootDir = ".." to tsconfig.json for napcat-onebot, napcat-shell, and napcat-webui-backend to ensure the TypeScript compiler uses the monorepo package root for source resolution. Also remove an extraneous blank line in theme.tsx near FileManager.uploadWebUIFont (minor formatting cleanup).
2026-05-22 22:31:11 +08:00
手瓜一十雪 9d652be35d fix: #1774 2026-05-22 22:27:19 +08:00
手瓜一十雪 f226c83595 Skip pnpm install scripts; defer QR code fetch & fix #1804
CI: use `pnpm i --ignore-scripts` in release-publish workflow to avoid running package install scripts during CI.

Shell: defer showing the QR code until after attempting WebUi quick-login/password fallback. Adds checks for NAPCAT_QUICK_ACCOUNT and quick-password env vars (and WebUi quick-login list), runs WebUi quick config, and only calls getQRCodePicture() if no fallback was attempted and the user is not logged in. Includes error handling for the quick-login attempt.
2026-05-22 22:23:45 +08:00
手瓜一十雪 b565f876c5 Merge branch 'main' of https://github.com/NapNeko/NapCatQQ 2026-05-22 22:12:05 +08:00
手瓜一十雪 19a5febb1a fix: #1827 2026-05-22 22:06:00 +08:00
Copilotandsj817 bbf822035f fix: restart HTTP server when host changes (#1836)
* Initial plan

* fix: restart HTTP server when host changes

Agent-Logs-Url: https://github.com/NapNeko/NapCatQQ/sessions/0ead0c47-df0d-4666-8877-775c9c641ed8

Co-authored-by: sj817 <74231782+sj817@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: sj817 <74231782+sj817@users.noreply.github.com>
2026-05-22 22:05:23 +08:00
手瓜一十雪 a2b0ac10a0 fix: #1843 2026-05-22 22:02:38 +08:00
手瓜一十雪 279b3ea4eb Add 9.9.30 & 9.9.31 x64 external entries
Add external mappings for Windows x64 versions 9.9.30-48762 and 9.9.31-49599 across appid, napi2native, and packet files. appid.json: add appid 537352525 (9.9.30-48762) and 537355779 (9.9.31-49599) with QUA strings. napi2native.json: add send/recv hashes for 9.9.30-48762-x64 (0A9B1BC / 1F0324D) and 9.9.31-49599-x64 (0AF885C / 20058E1). packet.json: add send/recv offsets for 9.9.30-48762-x64 (2F3B960 / 2F3EEE0) and 9.9.31-49599-x64 (3082C40 / 30861C8).
2026-05-22 21:58:30 +08:00
手瓜一十雪 33cc11ba84 Update tsconfig: bundler resolution & path mappings
Switch moduleResolution to "bundler" in base and package tsconfigs and consolidate path aliases for monorepo packages. Remove several package-level baseUrl entries and update package paths to reference ../../packages/* (add explicit napcat-common/src and napcat-image-size/src mappings). Also add a rootDir override for napcat-core. These changes unify module resolution and path aliases so TypeScript and bundlers resolve workspace packages consistently.
2026-05-21 19:16:44 +08:00
手瓜一十雪 b058604077 PR build: add dispatch script & secure workflow
Introduce a safe PR build dispatch flow and related helpers.

- Add GitHubAPI.createWorkflowDispatch to .github/scripts/lib/github.ts and tighten getRepository nullability.
- Add .github/scripts/pr-build-dispatch.ts to dispatch an untrusted workflow_run (workflow_dispatch) for PR builds.
- Rewrite .github/workflows/build-pr.yml to split privileged checks (pull_request_target / issue_comment) from untrusted execution (workflow_dispatch):
  - Add workflow_dispatch inputs for PR metadata.
  - Ensure privileged jobs only check conditions, post comments and dispatch the untrusted build.
  - Untrusted build jobs (framework/shell/publish) run under workflow_dispatch, checkout PR code into a separate workspace, clear GITHUB_TOKEN in build steps, and set stricter permissions and persist-credentials:false where appropriate.
  - Adjust concurrency, outputs, and inter-job dependencies to work with inputs rather than passing sensitive data between privileged and untrusted contexts.
- Update trigger-docker and result-comment flows to rely on workflow_dispatch inputs and only run in the untrusted run where appropriate.

- Change packages/napcat-vite/vite-plugin-version.js to read NAPCAT_GITHUB_TOKEN (instead of GITHUB_TOKEN) to avoid exposing Actions write tokens in untrusted builds.

These changes aim to improve security by preventing execution of PR-controlled code with elevated repo permissions and by isolating token usage.
2026-05-19 15:52:47 +08:00
H3CoF6 1c703a60ed fix(album): refactor group album like payload and implement cancel like action (#1844) 2026-05-19 09:54:15 +08:00
时瑾 285ba9cf2d ci: pin pnpm to v9 via pnpm/action-setup
pnpm 10 exits non-zero on [ERR_PNPM_IGNORED_BUILDS] by default, which
broke CI after the global pnpm version on GitHub runners bumped.

Replace ad-hoc `npm i -g pnpm` calls with pnpm/action-setup@v4 pinned to
version 9 across build-ci.yml, build-pr.yml, and drop the redundant
Install pnpm step from pr-build-run.ts.
2026-05-16 14:07:11 +08:00
Copilotandsj817 b253fd82c4 Fix WebUI login page stuck when navigating via token URL (#1835)
* Initial plan

* Fix: set isPasskeyLoading=false when token is in URL to prevent permanently disabled input on login failure

Agent-Logs-Url: https://github.com/NapNeko/NapCatQQ/sessions/fa88593a-3466-40e5-80ff-82c47e1c56e6

Co-authored-by: sj817 <74231782+sj817@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: sj817 <74231782+sj817@users.noreply.github.com>
2026-05-13 10:34:26 +08:00
Ventiの酒 8996b35dd1 fix: enable wss connections and add certificate verification toggle in WebSocket Client (#1823)
* fix: enable wss connections and add certificate verification toggle in WebSocket Client

Previous behavior: the WebSocket Client only supported unencrypted ws:// connections; wss:// URLs were not handled and would fail to connect, providing no option to disable TLS certificate validation for development or self-signed certificates.
Fixed behavior: secure WebSocket connections (wss://) are now fully supported. A verifyCertificate configuration option has been introduced, defaulting to true. When set to false, certificate errors (e.g., self-signed certificates) are ignored, enabling safe local testing while maintaining strict validation by default for production.

* fix: improve wss certificate verification and add tests

Previous behavior: wsOptions used 'any' type without type safety, verifyCertificate was added to napcat-protocol without implementation, and no tests existed for the new config option.

Fixed behavior: wsOptions now uses proper WebSocket.ClientOptions type for compile-time safety, verifyCertificate removed from napcat-protocol (no WebSocket client implementation exists there), and comprehensive tests added to validate config loading and default values.
2026-05-13 10:33:47 +08:00
Bluemangoo 25db6f0835 add ptt to text (#1837) 2026-05-13 10:31:07 +08:00
手瓜一十雪 2c8f9743da Add 9.9.30-48517 appid and napi2native entries
Add mappings for version 9.9.30-48517: update packages/napcat-core/external/appid.json with appid 537352474 and qua "V1_WIN_NQ_9.9.30_48517_GW_B", and update packages/napcat-core/external/napi2native.json with the x64 mapping (send: "0A9B1BC", recv: "1F0324D"). These entries add support for the new 9.9.30-48517 release.
2026-04-26 18:10:40 +08:00
手瓜一十雪 fc26077283 fix: #1793 2026-04-26 17:26:53 +08:00
手瓜一十雪 e9bbc82f37 fix: #1801 2026-04-26 17:21:16 +08:00
时瑾 600f2a4518 fix: replace nclatest proxy with ghfast.top, add dual install commands 2026-04-18 01:29:58 +08:00
时瑾 abf57e688c feat: add proxy prefix to install URL, change TTL to 5 days
- comment.ts: Add PROXY_BASE constant (https://nclatest.znin.net);
  install curl command now uses proxy URL for CN users;
  '24小时' -> '5天'; Docker '7天' -> '5天'
- pr-publish-release.ts: Import PROXY_BASE, use proxy URL in release body,
  '24小时' -> '5天'
2026-04-18 00:31:40 +08:00