{"_id":"@amatsuka/chat-adapter-qq","_rev":"11-482cd285240f93dea68c51e182f58bbf","name":"@amatsuka/chat-adapter-qq","dist-tags":{"latest":"0.1.13"},"versions":{"0.1.0":{"name":"@amatsuka/chat-adapter-qq","version":"0.1.0","keywords":["chat","qq","bot","adapter"],"license":"MIT","_id":"@amatsuka/chat-adapter-qq@0.1.0","maintainers":[{"name":"wsyzxjn","email":"amatsukamao@qq.com"}],"homepage":"https://github.com/wsyzxjn/chat-adapter-qq#readme","bugs":{"url":"https://github.com/wsyzxjn/chat-adapter-qq/issues"},"dist":{"shasum":"02f2fad90557aed89ba60ff2725b96061bf2545e","tarball":"https://registry.npmjs.org/@amatsuka/chat-adapter-qq/-/chat-adapter-qq-0.1.0.tgz","fileCount":4,"integrity":"sha512-yF0T40IbXAUd/eF26QZSP79G+VfnwCLKoHnB54jPM9c+qLlfirucOdOTCTA3Ih68uFpmP+Nbe33gRor+tkP8zQ==","signatures":[{"sig":"MEUCIF5ActRK1c5b0bxPfXprgFQqur2F+lJLtngDpILwDDeQAiEAhTgjHeP3LDqJ/uIyFSiVA1GBVcbhi++uh/m8UXSixrQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":68586},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"f8c974dfef3ffbbf306e7ffb413a28ac704349c2","scripts":{"dev":"tsup --watch","test":"node ./node_modules/vitest/vitest.mjs run","build":"tsup","clean":"rm -rf dist","test:bot":"node --env-file=.env.local --experimental-strip-types test/server.mjs","typecheck":"node ./node_modules/typescript/bin/tsc --noEmit","test:watch":"node ./node_modules/vitest/vitest.mjs","pretest:bot":"pnpm run build","test:coverage":"node ./node_modules/vitest/vitest.mjs run --coverage","build:production":"NODE_ENV=production tsup"},"_npmUser":{"name":"wsyzxjn","email":"amatsukamao@qq.com"},"repository":{"url":"git+https://github.com/wsyzxjn/chat-adapter-qq.git","type":"git"},"_npmVersion":"11.12.1","description":"QQ adapter for chat","directories":{},"_nodeVersion":"24.15.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"pnpm@10.30.1+sha512.3590e550d5384caa39bd5c7c739f72270234b2f6059e13018f975c313b1eb9fefcc09714048765d4d9efe961382c312e624572c0420762bdc5d5940cdf9be73a","devDependencies":{"tsup":"^8.5.1","vitest":"^4.1.5","typescript":"^5.9.3","@types/node":"^25.6.2","@chat-adapter/state-memory":"^4.28.1"},"peerDependencies":{"chat":"^4.28.1"},"_npmOperationalInternal":{"tmp":"tmp/chat-adapter-qq_0.1.0_1778346673683_0.814221798820898","host":"s3://npm-registry-packages-npm-production"}},"0.1.4":{"name":"@amatsuka/chat-adapter-qq","version":"0.1.4","keywords":["chat","qq","bot","adapter"],"license":"MIT","_id":"@amatsuka/chat-adapter-qq@0.1.4","maintainers":[{"name":"wsyzxjn","email":"amatsukamao@qq.com"}],"homepage":"https://github.com/wsyzxjn/chat-adapter-qq#readme","bugs":{"url":"https://github.com/wsyzxjn/chat-adapter-qq/issues"},"dist":{"shasum":"f8d14131e03e0b0ec2a6ec7250686e84c5d2b4d6","tarball":"https://registry.npmjs.org/@amatsuka/chat-adapter-qq/-/chat-adapter-qq-0.1.4.tgz","fileCount":5,"integrity":"sha512-Wg5MyuS+sqpu/IBUUhkjcQu85f//qny+qpCcl7wpFB0+0pvMS+ltSqk6hWLDJrydFGG8o4pxtdGyP+aeaD/PpQ==","signatures":[{"sig":"MEYCIQDh0BnZVUEUaQbFdpJ8h/EBo4wVE81Pp6GdsRY8IHZLbQIhAMXmotLoSHhOUoKgrgg34bdGokOSKDSlkGlTsgBCX0ZG","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@amatsuka%2fchat-adapter-qq@0.1.4","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":201853},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"016474d433a94fc62f71fcd662b6d8c7c5d92a2d","scripts":{"dev":"tsup --watch","test":"node --test test/*.test.*","build":"tsup","clean":"rm -rf dist","pretest":"pnpm run build","test:bot":"node --env-file=.env.local --experimental-strip-types test/server.mjs","typecheck":"node ./node_modules/typescript/bin/tsc --noEmit","test:watch":"node --test --watch test/*.test.*","pretest:bot":"pnpm run build","test:bot:ws":"QQ_MODE=ws node --env-file=.env.ws.local --experimental-strip-types test/server.mjs","test:coverage":"node --test --test-coverage test/*.test.*","build:production":"NODE_ENV=production tsup"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:6510bdf7-cd01-467e-afe1-76080c04ab5f"}},"repository":{"url":"git+https://github.com/wsyzxjn/chat-adapter-qq.git","type":"git"},"_npmVersion":"11.11.0","description":"QQ adapter for chat","directories":{},"_nodeVersion":"24.14.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"pnpm@10.30.1+sha512.3590e550d5384caa39bd5c7c739f72270234b2f6059e13018f975c313b1eb9fefcc09714048765d4d9efe961382c312e624572c0420762bdc5d5940cdf9be73a","devDependencies":{"tsup":"^8.5.1","typescript":"^5.9.3","@types/node":"^25.6.2","@chat-adapter/state-memory":"^4.28.1"},"peerDependencies":{"chat":"^4.28.1"},"_npmOperationalInternal":{"tmp":"tmp/chat-adapter-qq_0.1.4_1778434798519_0.03265587630645683","host":"s3://npm-registry-packages-npm-production"}},"0.1.5":{"name":"@amatsuka/chat-adapter-qq","version":"0.1.5","keywords":["chat","qq","bot","adapter"],"license":"MIT","_id":"@amatsuka/chat-adapter-qq@0.1.5","maintainers":[{"name":"wsyzxjn","email":"amatsukamao@qq.com"}],"homepage":"https://github.com/wsyzxjn/chat-adapter-qq#readme","bugs":{"url":"https://github.com/wsyzxjn/chat-adapter-qq/issues"},"dist":{"shasum":"de1dce67e81eb7fd36ff5ad551bd3a55ee0e139b","tarball":"https://registry.npmjs.org/@amatsuka/chat-adapter-qq/-/chat-adapter-qq-0.1.5.tgz","fileCount":5,"integrity":"sha512-EwYGJJ4P0vtEuhA+Tz8hRCLLRDfMM3jV2pHZrVVMRxxgdQzlj1T/NWULw/2J1MfsCstTz52ODkAe0l4nadICkw==","signatures":[{"sig":"MEYCIQCa8SbdO7ig4vsT42+bGm5vmLb8hRcUD3unks43SeHdzQIhAJR1l0EemW4iVM7+DCvVQwmuHpVYW2WPNOHAgbUrihUg","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@amatsuka%2fchat-adapter-qq@0.1.5","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":212023},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"d13a47afdd8ea424c9005e2cd73bd9404d1eb2a8","scripts":{"dev":"tsup --watch","test":"node --test test/*.test.*","build":"tsup","clean":"rm -rf dist","pretest":"pnpm run build","test:bot":"node --env-file=.env.local --experimental-strip-types test/server.mjs","typecheck":"node ./node_modules/typescript/bin/tsc --noEmit","test:watch":"node --test --watch test/*.test.*","pretest:bot":"pnpm run build","test:bot:ws":"QQ_MODE=ws node --env-file=.env.ws.local --experimental-strip-types test/server.mjs","test:coverage":"node --test --test-coverage test/*.test.*","build:production":"NODE_ENV=production tsup"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:6510bdf7-cd01-467e-afe1-76080c04ab5f"}},"repository":{"url":"git+https://github.com/wsyzxjn/chat-adapter-qq.git","type":"git"},"_npmVersion":"11.11.0","description":"QQ adapter for chat","directories":{},"_nodeVersion":"24.14.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"pnpm@10.30.1+sha512.3590e550d5384caa39bd5c7c739f72270234b2f6059e13018f975c313b1eb9fefcc09714048765d4d9efe961382c312e624572c0420762bdc5d5940cdf9be73a","devDependencies":{"tsup":"^8.5.1","typescript":"^5.9.3","@types/node":"^25.6.2","@chat-adapter/state-memory":"^4.28.1"},"peerDependencies":{"chat":"^4.28.1"},"_npmOperationalInternal":{"tmp":"tmp/chat-adapter-qq_0.1.5_1778438062728_0.005223304253257011","host":"s3://npm-registry-packages-npm-production"}},"0.1.6":{"name":"@amatsuka/chat-adapter-qq","version":"0.1.6","keywords":["chat","qq","bot","adapter"],"license":"MIT","_id":"@amatsuka/chat-adapter-qq@0.1.6","maintainers":[{"name":"wsyzxjn","email":"amatsukamao@qq.com"}],"homepage":"https://github.com/wsyzxjn/chat-adapter-qq#readme","bugs":{"url":"https://github.com/wsyzxjn/chat-adapter-qq/issues"},"dist":{"shasum":"fa92055b43bafa7eb87da4317e8a0f0ebd681809","tarball":"https://registry.npmjs.org/@amatsuka/chat-adapter-qq/-/chat-adapter-qq-0.1.6.tgz","fileCount":5,"integrity":"sha512-j83dnXs6o3iRvE9VfEKfptbqB28/zwag0nt45RNpir3/WkoMxh5w4afzcjJsBehz7jwxV6IMoeohosBJInGPzA==","signatures":[{"sig":"MEUCICZuoIOBfbgz5LlqbKZhmzt69zU1YkVu78D2fo9p2yAeAiEA4acI8FDlG4TxpqkDEXBnEcqjU6pTkG4pA+hXCoVTc7o=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@amatsuka%2fchat-adapter-qq@0.1.6","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":218864},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"ac1e501ded72549f03c04819eff23f7ebd6f7900","scripts":{"dev":"tsup --watch","test":"node --test test/*.test.*","build":"tsup","clean":"rm -rf dist","pretest":"pnpm run build","test:bot":"node --env-file=.env.local --experimental-strip-types test/server.mjs","typecheck":"node ./node_modules/typescript/bin/tsc --noEmit","test:watch":"node --test --watch test/*.test.*","pretest:bot":"pnpm run build","test:bot:ws":"QQ_MODE=ws node --env-file=.env.ws.local --experimental-strip-types test/server.mjs","test:coverage":"node --test --test-coverage test/*.test.*","build:production":"NODE_ENV=production tsup"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:6510bdf7-cd01-467e-afe1-76080c04ab5f"}},"repository":{"url":"git+https://github.com/wsyzxjn/chat-adapter-qq.git","type":"git"},"_npmVersion":"11.11.0","description":"QQ adapter for chat","directories":{},"_nodeVersion":"24.14.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"pnpm@10.30.1+sha512.3590e550d5384caa39bd5c7c739f72270234b2f6059e13018f975c313b1eb9fefcc09714048765d4d9efe961382c312e624572c0420762bdc5d5940cdf9be73a","devDependencies":{"tsup":"^8.5.1","typescript":"^5.9.3","@types/node":"^25.6.2","@chat-adapter/state-memory":"^4.28.1"},"peerDependencies":{"chat":"^4.28.1"},"_npmOperationalInternal":{"tmp":"tmp/chat-adapter-qq_0.1.6_1778440491788_0.6205779853225621","host":"s3://npm-registry-packages-npm-production"}},"0.1.7":{"name":"@amatsuka/chat-adapter-qq","version":"0.1.7","keywords":["chat","qq","bot","adapter"],"license":"MIT","_id":"@amatsuka/chat-adapter-qq@0.1.7","maintainers":[{"name":"wsyzxjn","email":"amatsukamao@qq.com"}],"homepage":"https://github.com/wsyzxjn/chat-adapter-qq#readme","bugs":{"url":"https://github.com/wsyzxjn/chat-adapter-qq/issues"},"dist":{"shasum":"a472f740520dae08412963794e090b48df0f0eaa","tarball":"https://registry.npmjs.org/@amatsuka/chat-adapter-qq/-/chat-adapter-qq-0.1.7.tgz","fileCount":5,"integrity":"sha512-xcbytpBRnsArYk1C+PIQcXuxLLjM9/W9PxS6WVlxrHm/CAtEWonZCA11DkZml1GfEtLP2dkFYzDRmW4gGlYqpw==","signatures":[{"sig":"MEYCIQCMdwClXKzpBs9J6DvX+bfywf02ozD9J73TOEhpeGj6YAIhAO8CI8czFCLpmTNLH8JmqmejYeYNvA7lAVMDYoc4OIvq","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@amatsuka%2fchat-adapter-qq@0.1.7","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":227813},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"56811414a2e2860d5a402b2eeefe5929024b8f85","scripts":{"dev":"tsup --watch","test":"node --test test/*.test.*","build":"tsup","clean":"rm -rf dist","pretest":"pnpm run build","test:bot":"node --env-file=.env.local --experimental-strip-types test/server.mjs","typecheck":"node ./node_modules/typescript/bin/tsc --noEmit","test:watch":"node --test --watch test/*.test.*","pretest:bot":"pnpm run build","test:bot:ws":"QQ_MODE=ws node --env-file=.env.ws.local --experimental-strip-types test/server.mjs","test:coverage":"node --test --test-coverage test/*.test.*","build:production":"NODE_ENV=production tsup"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:6510bdf7-cd01-467e-afe1-76080c04ab5f"}},"repository":{"url":"git+https://github.com/wsyzxjn/chat-adapter-qq.git","type":"git"},"_npmVersion":"11.11.0","description":"QQ adapter for chat","directories":{},"_nodeVersion":"24.14.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"pnpm@10.30.1+sha512.3590e550d5384caa39bd5c7c739f72270234b2f6059e13018f975c313b1eb9fefcc09714048765d4d9efe961382c312e624572c0420762bdc5d5940cdf9be73a","devDependencies":{"tsup":"^8.5.1","typescript":"^5.9.3","@types/node":"^25.6.2","@chat-adapter/state-memory":"^4.28.1"},"peerDependencies":{"chat":"^4.28.1"},"_npmOperationalInternal":{"tmp":"tmp/chat-adapter-qq_0.1.7_1778483326507_0.32643776508988065","host":"s3://npm-registry-packages-npm-production"}},"0.1.8":{"name":"@amatsuka/chat-adapter-qq","version":"0.1.8","keywords":["chat","qq","bot","adapter"],"license":"MIT","_id":"@amatsuka/chat-adapter-qq@0.1.8","maintainers":[{"name":"wsyzxjn","email":"amatsukamao@qq.com"}],"homepage":"https://github.com/wsyzxjn/chat-adapter-qq#readme","bugs":{"url":"https://github.com/wsyzxjn/chat-adapter-qq/issues"},"dist":{"shasum":"e4c40f4c841fc005f10343b8c20e622b27e695b4","tarball":"https://registry.npmjs.org/@amatsuka/chat-adapter-qq/-/chat-adapter-qq-0.1.8.tgz","fileCount":5,"integrity":"sha512-7Bfv41T7PatxAvryIdYy6Qd7NsCSLnQN2QMUA353pe2YQ5mXWG+c6aL172Iayh8TiVpPR3tNmNl5tSuBoCxTPQ==","signatures":[{"sig":"MEUCIQCyJ6a1NbLA/Hq5dBpVblTcxye4vmoHYn/GGNeRnr1/PgIgFbT1j8SoeRvL7uKTY96grRG9LrQC30zqJMbo1LBzLGc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@amatsuka%2fchat-adapter-qq@0.1.8","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":243968},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"22766f56e14db50a93ba34b78c79823081ab825a","scripts":{"dev":"tsup --watch","test":"node --test test/*.test.*","build":"tsup","clean":"rm -rf dist","pretest":"pnpm run build","test:bot":"node --env-file=.env.local --experimental-strip-types test/server.mjs","typecheck":"node ./node_modules/typescript/bin/tsc --noEmit","test:watch":"node --test --watch test/*.test.*","pretest:bot":"pnpm run build","test:bot:ws":"QQ_MODE=ws node --env-file=.env.ws.local --experimental-strip-types test/server.mjs","test:coverage":"node --test --test-coverage test/*.test.*","build:production":"NODE_ENV=production tsup"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:6510bdf7-cd01-467e-afe1-76080c04ab5f"}},"repository":{"url":"git+https://github.com/wsyzxjn/chat-adapter-qq.git","type":"git"},"_npmVersion":"11.11.0","description":"QQ adapter for chat","directories":{},"_nodeVersion":"24.14.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"pnpm@10.30.1+sha512.3590e550d5384caa39bd5c7c739f72270234b2f6059e13018f975c313b1eb9fefcc09714048765d4d9efe961382c312e624572c0420762bdc5d5940cdf9be73a","devDependencies":{"tsup":"^8.5.1","typescript":"^5.9.3","@types/node":"^25.6.2","@chat-adapter/state-memory":"^4.28.1"},"peerDependencies":{"chat":"^4.28.1"},"_npmOperationalInternal":{"tmp":"tmp/chat-adapter-qq_0.1.8_1778505975813_0.36275509989722954","host":"s3://npm-registry-packages-npm-production"}},"0.1.9":{"name":"@amatsuka/chat-adapter-qq","version":"0.1.9","keywords":["chat","qq","bot","adapter"],"license":"MIT","_id":"@amatsuka/chat-adapter-qq@0.1.9","maintainers":[{"name":"wsyzxjn","email":"amatsukamao@qq.com"}],"homepage":"https://github.com/wsyzxjn/chat-adapter-qq#readme","bugs":{"url":"https://github.com/wsyzxjn/chat-adapter-qq/issues"},"dist":{"shasum":"8cb0e2d4e1a028c9a1366fca602dd608aa2a900b","tarball":"https://registry.npmjs.org/@amatsuka/chat-adapter-qq/-/chat-adapter-qq-0.1.9.tgz","fileCount":5,"integrity":"sha512-z/MjipG8IL3UVHs1P9v3JXfLDmQCjd61QF5mye5o1uuN/GcXeTJVPLM4LmR4JJHaZKAnaZ0+zWT8wl4KdF8zxw==","signatures":[{"sig":"MEYCIQCd6arU8c6Y0/65RkzU+9VD2jvJjiMJmQQ6KeZVfq0rggIhAISGcFFLJZL81DYSzChm725f1fqwELwwP/izpehlHpqc","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@amatsuka%2fchat-adapter-qq@0.1.9","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":247100},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"8d0cf527241189f50096ff62f37f8fb6a98a848b","scripts":{"dev":"tsup --watch","test":"node --test test/*.test.*","build":"tsup","clean":"rm -rf dist","pretest":"pnpm run build","test:bot":"node --env-file=.env.local --experimental-strip-types test/server.mjs","typecheck":"node ./node_modules/typescript/bin/tsc --noEmit","test:watch":"node --test --watch test/*.test.*","pretest:bot":"pnpm run build","test:bot:ws":"QQ_MODE=ws node --env-file=.env.ws.local --experimental-strip-types test/server.mjs","test:coverage":"node --test --test-coverage test/*.test.*","build:production":"NODE_ENV=production tsup"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:6510bdf7-cd01-467e-afe1-76080c04ab5f"}},"repository":{"url":"git+https://github.com/wsyzxjn/chat-adapter-qq.git","type":"git"},"_npmVersion":"11.11.0","description":"QQ adapter for chat","directories":{},"_nodeVersion":"24.14.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"pnpm@10.30.1+sha512.3590e550d5384caa39bd5c7c739f72270234b2f6059e13018f975c313b1eb9fefcc09714048765d4d9efe961382c312e624572c0420762bdc5d5940cdf9be73a","devDependencies":{"tsup":"^8.5.1","typescript":"^5.9.3","@types/node":"^25.6.2","@chat-adapter/state-memory":"^4.28.1"},"peerDependencies":{"chat":"^4.28.1"},"_npmOperationalInternal":{"tmp":"tmp/chat-adapter-qq_0.1.9_1778578561729_0.647847164725154","host":"s3://npm-registry-packages-npm-production"}},"0.1.10":{"name":"@amatsuka/chat-adapter-qq","version":"0.1.10","keywords":["chat","qq","bot","adapter"],"license":"MIT","_id":"@amatsuka/chat-adapter-qq@0.1.10","maintainers":[{"name":"wsyzxjn","email":"amatsukamao@qq.com"}],"homepage":"https://github.com/wsyzxjn/chat-adapter-qq#readme","bugs":{"url":"https://github.com/wsyzxjn/chat-adapter-qq/issues"},"dist":{"shasum":"84a6dbb21cbb535eaa8b48b75e2fdc80efb6076e","tarball":"https://registry.npmjs.org/@amatsuka/chat-adapter-qq/-/chat-adapter-qq-0.1.10.tgz","fileCount":4,"integrity":"sha512-SGBTXaQ+sQYeefK4F0l01eUu+vMj+0wx6Ojqlz5RLdCinHtVaTMktb6ur9B8Mn4MOtTCyvgKfx0BYt9a+6+A6w==","signatures":[{"sig":"MEQCIANr2rCbWk8aGq33Z5p5S5hKbP+grUCJlQBSNCA6oRmwAiAR5j9z5KBtCjVwcSm6SmtAiq26N4qWd6cx2gibCiBbvQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@amatsuka%2fchat-adapter-qq@0.1.10","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":102323},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"9f8c51d0ee3035fe3fd027b653774659ccb54287","scripts":{"dev":"tsup --watch","test":"node --test test/*.test.*","build":"tsup","clean":"rm -rf dist","pretest":"pnpm run build","test:bot":"node --env-file=.env.local --experimental-strip-types test/server.mjs","typecheck":"node ./node_modules/typescript/bin/tsc --noEmit","test:watch":"node --test --watch test/*.test.*","pretest:bot":"pnpm run build","test:bot:ws":"QQ_MODE=ws node --env-file=.env.ws.local --experimental-strip-types test/server.mjs","test:coverage":"node --test --test-coverage test/*.test.*","build:production":"NODE_ENV=production tsup"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:6510bdf7-cd01-467e-afe1-76080c04ab5f"}},"repository":{"url":"git+https://github.com/wsyzxjn/chat-adapter-qq.git","type":"git"},"_npmVersion":"11.11.0","description":"QQ adapter for chat","directories":{},"_nodeVersion":"24.14.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"pnpm@10.30.1+sha512.3590e550d5384caa39bd5c7c739f72270234b2f6059e13018f975c313b1eb9fefcc09714048765d4d9efe961382c312e624572c0420762bdc5d5940cdf9be73a","devDependencies":{"tsup":"^8.5.1","typescript":"^5.9.3","@types/node":"^25.6.2","@chat-adapter/state-memory":"^4.28.1"},"peerDependencies":{"chat":"^4.28.1"},"_npmOperationalInternal":{"tmp":"tmp/chat-adapter-qq_0.1.10_1778587967438_0.40926174036650753","host":"s3://npm-registry-packages-npm-production"}},"0.1.11":{"name":"@amatsuka/chat-adapter-qq","version":"0.1.11","keywords":["chat","qq","bot","adapter"],"license":"MIT","_id":"@amatsuka/chat-adapter-qq@0.1.11","maintainers":[{"name":"wsyzxjn","email":"amatsukamao@qq.com"}],"homepage":"https://github.com/wsyzxjn/chat-adapter-qq#readme","bugs":{"url":"https://github.com/wsyzxjn/chat-adapter-qq/issues"},"dist":{"shasum":"f81b00ed96fd4812f750ddea84e2b6e773523f94","tarball":"https://registry.npmjs.org/@amatsuka/chat-adapter-qq/-/chat-adapter-qq-0.1.11.tgz","fileCount":4,"integrity":"sha512-c0tw/R+kKfljtP2AsEHeVnaG9vU0udYcifxcmb/6W34QcIGkC5v21JklYHeG7aCAKaHPgkoSTx3jSN6TD48OOQ==","signatures":[{"sig":"MEUCID00nveT6qTqXiCEG9zGVEJDcQqiGdbT+SHOaUWFYa4YAiEArywa3lq0XFsI5CV9dgFQbaefZ0nJO+Ekd0XVjjhvLc0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@amatsuka%2fchat-adapter-qq@0.1.11","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":98968},"type":"module","exports":{".":"./dist/index.mjs","./package.json":"./package.json"},"gitHead":"c33ff8ad3b75f28e36d9b8bbd2073e9b825e2885","scripts":{"test":"node --test test/*.test.*","build":"tsdown","pretest":"pnpm run build","test:bot":"node --env-file=.env.local --experimental-strip-types test/server.mjs","typecheck":"tsc && tsc -p test/tsconfig.json","test:watch":"node --test --watch test/*.test.*","pretest:bot":"pnpm run build","test:bot:ws":"QQ_MODE=ws node --env-file=.env.ws.local --experimental-strip-types test/server.mjs","test:coverage":"node --test --test-coverage test/*.test.*","build:production":"NODE_ENV=production tsdown --sourcemap false"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:6510bdf7-cd01-467e-afe1-76080c04ab5f"}},"repository":{"url":"git+https://github.com/wsyzxjn/chat-adapter-qq.git","type":"git"},"_npmVersion":"11.12.1","description":"QQ adapter for chat","directories":{},"_nodeVersion":"24.15.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"pnpm@10.30.1+sha512.3590e550d5384caa39bd5c7c739f72270234b2f6059e13018f975c313b1eb9fefcc09714048765d4d9efe961382c312e624572c0420762bdc5d5940cdf9be73a","devDependencies":{"tsdown":"^0.22.0","typescript":"^6.0.3","@types/node":"^25.6.2","@chat-adapter/state-memory":"^4.28.1"},"peerDependencies":{"chat":"^4.28.1"},"_npmOperationalInternal":{"tmp":"tmp/chat-adapter-qq_0.1.11_1779017086897_0.24130751251035476","host":"s3://npm-registry-packages-npm-production"}},"0.1.12":{"name":"@amatsuka/chat-adapter-qq","version":"0.1.12","keywords":["chat","qq","bot","adapter"],"license":"MIT","_id":"@amatsuka/chat-adapter-qq@0.1.12","maintainers":[{"name":"wsyzxjn","email":"amatsukamao@qq.com"}],"homepage":"https://github.com/wsyzxjn/chat-adapter-qq#readme","bugs":{"url":"https://github.com/wsyzxjn/chat-adapter-qq/issues"},"dist":{"shasum":"33a875d584717ea74537c013a4f4f50bea62c915","tarball":"https://registry.npmjs.org/@amatsuka/chat-adapter-qq/-/chat-adapter-qq-0.1.12.tgz","fileCount":4,"integrity":"sha512-zOPA7sha4Z7enpKNxcDd3Q4YeuP2/jFa1l+5Z3yvqR3n0NtxLrDeLbWhE9CC4gl/gHTQu+TxfQX7Z/0o7fx14w==","signatures":[{"sig":"MEQCIGy2ZWoYkm10YmVkik2iAmDmvmBJP71W+lKSeNkxLwn9AiBQofM0W7BTk9dH9e9hS2b1+oukqAvL8u6VaFNXXqkKRA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@amatsuka%2fchat-adapter-qq@0.1.12","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":102676},"type":"module","exports":{".":"./dist/index.mjs","./package.json":"./package.json"},"gitHead":"63affffb2380db02aba98c25b083c9468187c6c0","scripts":{"test":"node --test test/*.test.*","build":"tsdown","pretest":"pnpm run build","test:bot":"pnpm run build && node --env-file=.env.local --experimental-strip-types test/server.mjs","typecheck":"tsc && tsc -p test/tsconfig.json","test:watch":"node --test --watch test/*.test.*","test:bot:ws":"pnpm run build && QQ_MODE=ws node --env-file=.env.ws.local --experimental-strip-types test/server.mjs","test:coverage":"node --test --test-coverage test/*.test.*","build:production":"NODE_ENV=production tsdown --sourcemap false","test:c2c-proactive":"pnpm run build && node --env-file=.env.local --experimental-strip-types test/c2c-proactive.ts"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:6510bdf7-cd01-467e-afe1-76080c04ab5f"}},"repository":{"url":"git+https://github.com/wsyzxjn/chat-adapter-qq.git","type":"git"},"_npmVersion":"11.12.1","description":"QQ adapter for chat","directories":{},"_nodeVersion":"24.15.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"pnpm@10.30.1+sha512.3590e550d5384caa39bd5c7c739f72270234b2f6059e13018f975c313b1eb9fefcc09714048765d4d9efe961382c312e624572c0420762bdc5d5940cdf9be73a","devDependencies":{"tsdown":"^0.22.0","typescript":"^6.0.3","@types/node":"^25.6.2","@chat-adapter/state-memory":"^4.28.1"},"peerDependencies":{"chat":"^4.28.1"},"_npmOperationalInternal":{"tmp":"tmp/chat-adapter-qq_0.1.12_1779293751040_0.9122987800123337","host":"s3://npm-registry-packages-npm-production"}},"0.1.13":{"name":"@amatsuka/chat-adapter-qq","version":"0.1.13","description":"QQ adapter for chat","type":"module","types":"./dist/index.d.mts","exports":{".":"./dist/index.mjs","./package.json":"./package.json"},"scripts":{"build":"tsdown","build:production":"NODE_ENV=production tsdown --sourcemap false","pretest":"pnpm run build","test":"node --test test/*.test.*","test:coverage":"node --test --test-coverage test/*.test.*","test:watch":"node --test --watch test/*.test.*","test:bot":"pnpm run build && node --env-file=.env.local --experimental-strip-types test/server.mjs","test:bot:ws":"pnpm run build && QQ_MODE=ws node --env-file=.env.ws.local --experimental-strip-types test/server.mjs","test:c2c-proactive":"pnpm run build && node --env-file=.env.local --experimental-strip-types test/c2c-proactive.ts","typecheck":"tsc && tsc -p test/tsconfig.json"},"peerDependencies":{"chat":"^4.34.0"},"devDependencies":{"@chat-adapter/state-memory":"^4.34.0","@types/node":"^25.6.2","tsdown":"^0.22.0","typescript":"^6.0.3"},"repository":{"type":"git","url":"git+https://github.com/wsyzxjn/chat-adapter-qq.git"},"homepage":"https://github.com/wsyzxjn/chat-adapter-qq#readme","bugs":{"url":"https://github.com/wsyzxjn/chat-adapter-qq/issues"},"publishConfig":{"access":"public"},"engines":{"node":">=20"},"keywords":["chat","chat-sdk","chat-adapter","qq","bot","adapter"],"license":"MIT","packageManager":"pnpm@10.30.1+sha512.3590e550d5384caa39bd5c7c739f72270234b2f6059e13018f975c313b1eb9fefcc09714048765d4d9efe961382c312e624572c0420762bdc5d5940cdf9be73a","gitHead":"2f0b2a676b92baf1a6bf893aca4df963c56146c8","_id":"@amatsuka/chat-adapter-qq@0.1.13","_nodeVersion":"24.18.0","_npmVersion":"11.16.0","dist":{"integrity":"sha512-34E+8pztPJ80aSJi349PcmTyzoaEvbBa5GLpiJCORLKjJ+Ja3pTsTnLDvjLdHRp70TqM7Y4XH4NG7HGF6mrq1Q==","shasum":"ccfd7a0869b0f4e7ba9e0c020cdc223751472d20","tarball":"https://registry.npmjs.org/@amatsuka/chat-adapter-qq/-/chat-adapter-qq-0.1.13.tgz","fileCount":4,"unpackedSize":117655,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@amatsuka%2fchat-adapter-qq@0.1.13","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIAQTnYO8lX07EL3qqFs4uHW6avOOSAQH4557GKsQ6eL/AiEAwmZwxxmwmIbDb93nWt16bQLUCUWD0znkWhnY/TQDDPE="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:6510bdf7-cd01-467e-afe1-76080c04ab5f"}},"directories":{},"maintainers":[{"name":"wsyzxjn","email":"amatsukamao@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/chat-adapter-qq_0.1.13_1784357266108_0.8308275274448154"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-09T17:11:13.467Z","modified":"2026-07-18T06:47:46.578Z","0.1.0":"2026-05-09T17:11:13.817Z","0.1.4":"2026-05-10T17:39:58.691Z","0.1.5":"2026-05-10T18:34:22.927Z","0.1.6":"2026-05-10T19:14:51.949Z","0.1.7":"2026-05-11T07:08:46.646Z","0.1.8":"2026-05-11T13:26:15.944Z","0.1.9":"2026-05-12T09:36:01.886Z","0.1.10":"2026-05-12T12:12:47.609Z","0.1.11":"2026-05-17T11:24:47.038Z","0.1.12":"2026-05-20T16:15:51.225Z","0.1.13":"2026-07-18T06:47:46.263Z"},"bugs":{"url":"https://github.com/wsyzxjn/chat-adapter-qq/issues"},"license":"MIT","homepage":"https://github.com/wsyzxjn/chat-adapter-qq#readme","keywords":["chat","chat-sdk","chat-adapter","qq","bot","adapter"],"repository":{"type":"git","url":"git+https://github.com/wsyzxjn/chat-adapter-qq.git"},"description":"QQ adapter for chat","maintainers":[{"name":"wsyzxjn","email":"amatsukamao@qq.com"}],"readme":"# @amatsuka/chat-adapter-qq\n\n[![npm](https://img.shields.io/npm/v/@amatsuka/chat-adapter-qq)](https://www.npmjs.com/package/@amatsuka/chat-adapter-qq)\n\nQQ 机器人开放平台 API v2 的 [Chat SDK](https://www.npmjs.com/package/chat) 适配器。\n\n## 功能\n\n- 接收 QQ 私聊（C2C）和群聊消息\n- 支持 Webhook 和 Socket Mode\n- 发送文本、QQ Markdown、Markdown Keyboard、媒体附件和 Chat SDK `files`\n- 将按钮回调映射到 `chat.onAction`\n- 支持 `chat.onDirectMessage`、`chat.openDM`、消息撤回和 Chat SDK 状态持久化历史\n- 保留 QQ 原始 payload，方便读取平台特有字段\n\n## 安装\n\n```bash\npnpm add @amatsuka/chat-adapter-qq chat @chat-adapter/state-memory\n```\n\n要求 Node.js 20 或更高版本；当前适配器基于 Chat SDK 4.34。\n\n## 快速开始\n\n```ts\nimport { Chat } from \"chat\";\nimport { createMemoryState } from \"@chat-adapter/state-memory\";\nimport { createQQAdapter } from \"@amatsuka/chat-adapter-qq\";\n\nconst qq = createQQAdapter({\n  appId: process.env.QQ_APP_ID!,\n  clientSecret: process.env.QQ_CLIENT_SECRET!,\n  userName: \"my-qq-bot\",\n});\n\nexport const bot = new Chat({\n  userName: \"my-qq-bot\",\n  adapters: { qq },\n  state: createMemoryState(),\n});\n\nbot.onDirectMessage(async (thread, message) => {\n  await thread.post(`收到：${message.text}`);\n});\n\nqq.onEvent(\"FRIEND_ADD\", async (event) => {\n  console.log(\"QQ 好友添加事件\", event.data);\n});\n```\n\n## Webhook\n\n```ts\nimport { bot } from \"./bot\";\n\nexport async function POST(request: Request): Promise<Response> {\n  return bot.webhooks.qq(request);\n}\n```\n\n默认会校验 QQ Webhook 签名和 `X-Bot-Appid`。回调校验挑战（`op=13`）会由适配器处理。\n\n## Socket Mode\n\n```ts\nimport { Chat } from \"chat\";\nimport { createMemoryState } from \"@chat-adapter/state-memory\";\nimport { createQQAdapter, QQ_INTENTS } from \"@amatsuka/chat-adapter-qq\";\n\nconst qq = createQQAdapter({\n  appId: process.env.QQ_APP_ID!,\n  clientSecret: process.env.QQ_CLIENT_SECRET!,\n  mode: \"socket\",\n  socketMode: {\n    intents:\n      QQ_INTENTS.GROUP_AND_C2C_EVENT |\n      QQ_INTENTS.INTERACTION |\n      QQ_INTENTS.MESSAGE_AUDIT,\n  },\n});\n\nconst bot = new Chat({\n  userName: \"my-qq-bot\",\n  adapters: { qq },\n  state: createMemoryState(),\n});\n\nawait bot.initialize();\n```\n\n默认会读取 `/gateway/bot` 的 `shards` 与 `session_start_limit`，自动启动全部推荐分片并遵守 Identify 并发限制。设置 `shard: [index, total]` 可只启动指定分片，设置 `autoSharding: false` 可强制单分片。连接会按 QQ Gateway 关闭码选择 Resume、重新 Identify 或停止重连，并使用带上限的指数退避。\n\n如果宿主自己维护 WebSocket，也可以把 QQ payload 交给：\n\n```ts\nawait qq.handleSocketModePayload(payload);\n```\n\n## 配置\n\n日常接入只需要 `appId` 和 `clientSecret`。\n\n| 字段 | 必填 | 说明 |\n| --- | --- | --- |\n| `appId` | 是 | QQ 机器人应用 ID |\n| `clientSecret` | 是 | QQ 控制台密钥，用于获取 OpenAPI Access Token |\n| `mode` | 否 | `webhook` 或 `socket`，默认 `webhook` |\n| `userName` | 否 | Chat SDK 里的机器人名称，默认 `qq-bot` |\n| `botSecret` | 否 | Webhook 签名密钥；默认使用 `clientSecret` |\n| `socketMode` | 否 | Socket Mode 配置 |\n| `sandbox` | 否 | 使用 QQ 沙箱 OpenAPI 域名 |\n| `logger` | 否 | 自定义 Chat SDK logger |\n\n更多高级配置可直接查看 `QQAdapterConfig` 类型。\n\n## QQ 平台事件\n\n消息、斜线命令和按钮点击会进入 Chat SDK 标准 handler。QQ 平台特有事件通过适配器实例监听：\n\n```ts\nqq.onEvent(\"FRIEND_ADD\", async (event) => {\n  console.log(event.type, event.data);\n});\n\nqq.onEvent([\"GROUP_ADD_ROBOT\", \"GROUP_DEL_ROBOT\"], async (event) => {\n  console.log(event.type, event.data);\n});\n\nconst unsubscribe = qq.onEvent(async (event) => {\n  console.log(\"QQ platform event\", event.type);\n});\n```\n\n主动/public 消息被 QQ 以 HTTP 201/202 异步接受时，返回消息的 `raw._chat_delivery_status` 为 `accepted`，并保留 `_chat_http_status`、`_chat_async_code` 和 `_chat_async_message`。后续结果可通过 `MESSAGE_AUDIT_PASS` / `MESSAGE_AUDIT_REJECT` 监听；Socket Mode 需要订阅 `QQ_INTENTS.MESSAGE_AUDIT`。\n\n## QQ 专有发送\n\n通用文本、Markdown、Card 和媒体附件走 `thread.post()`：\n\n```ts\nawait thread.post({\n  raw: \"图片说明\",\n  attachments: [\n    {\n      type: \"image\",\n      url: \"https://example.com/image.png\",\n    },\n  ],\n});\n```\n\nChat SDK `files` 也会走同一上传流程：\n\n```ts\nimport { readFile } from \"node:fs/promises\";\n\nawait thread.post({\n  raw: \"月报\",\n  files: [\n    {\n      data: await readFile(\"./report.pdf\"),\n      filename: \"report.pdf\",\n      mimeType: \"application/pdf\",\n    },\n  ],\n});\n```\n\n媒体附件支持 URL 或二进制 `data` / `fetchData`，支持 `image`、`video`、`audio` 和 C2C/群聊 `file`。QQ OpenAPI 每条消息只接受一个 `media` 对象，因此多个附件/文件会按输入顺序拆成多条消息。上传/登记媒体后会把返回的 `file_info`、`file_uuid` 和 `ttl` 透传到 `media`，并在当前进程内按 TTL 复用；`ttl=0` 视为长期有效，未返回 TTL 时不缓存。\n\nJSX/Card 里的 `Image({ url })` 和 `imageUrl` 会自动转成 QQ media，支持普通 URL 和 `data:image/...;base64,...`；`Text` / `CardText`、`CardLink`、`Fields`、`Table`（含 `caption`）、`Chart`、`Divider` 会渲染到 Markdown，`Button` / `LinkButton` 会渲染为 QQ Keyboard。\n\nQQ 专有能力挂在适配器实例上。ARK 消息可直接调用：\n\n```ts\nawait qq.postArk(\"qq:c2c/<openid>\", {\n  template_id: 23,\n  kv: [\n    {\n      key: \"#DESC#\",\n      value: \"机器人订阅消息\",\n    },\n  ],\n});\n```\n\n需要使用 QQ 平台专有字段时，可调用 `postQQMessage`。`isWakeup` 会发送 C2C 主动唤醒消息，并自动禁用缓存的被动回复上下文；`messageReference` 会原样映射为 QQ `message_reference`，具体场景权限仍由 QQ 服务端判定。\n\n```ts\nawait qq.postQQMessage(\"qq:c2c/<openid>\", \"主动提醒\", {\n  isWakeup: true,\n});\n\nawait qq.postQQMessage(\"qq:c2c/<openid>\", \"引用回复\", {\n  messageReference: {\n    message_id: \"<message_id>\",\n    ignore_get_message_error: true,\n  },\n});\n```\n\nC2C `stream()` 在存在入站 `msg_id` 被动上下文时使用 QQ 原生 `stream_messages`，并在整个流中固定使用同一个 `msg_seq`；主动场景或协议调用失败时会安全降级为普通消息。\n\nEmbed 在 QQ 官方 C2C/GROUP 场景下不支持，当前不适配。\n\n## 群消息、命令与提及\n\n适配器支持 `GROUP_AT_MESSAGE_CREATE` 和 `GROUP_MESSAGE_CREATE`。QQ 侧开启普通群消息事件后，不带 @ 的群消息也会进入 Chat SDK message 路由；是否响应由 `onNewMessage(pattern)` 或订阅状态决定。\n\n群内命令不要求 @，`/help` 和 `@机器人 /help` 都会进入 `onSlashCommand(\"/help\")`。`onSlashCommand` 没有标准 `message.isMention` 字段，如需判断这次命令是否由 @ 触发，可以使用 QQ 专有辅助函数：\n\n```ts\nimport { isQQMentioned } from \"@amatsuka/chat-adapter-qq\";\n\nbot.onSlashCommand(\"/help\", async (event) => {\n  if (isQQMentioned(event)) {\n    await event.channel.post(\"你是 @ 我触发的命令\");\n    return;\n  }\n  await event.channel.post(\"你是直接输入命令触发的\");\n});\n```\n\n## Raw Payload\n\nQQ 官方字段会保留在 `message.raw` / `event.payload` 中。适配器只把跨平台能力映射到 Chat SDK 标准字段，平台特有数据不强行塞进标准模型。\n\n例如引用消息会从 QQ 的 `message_scene` / `msg_elements` 中归一化到：\n\n```ts\nmessage.raw._chat_quoted_message;\n```\n\n原始字段也会继续保留：\n\n```ts\nmessage.raw.message_scene;\nmessage.raw.msg_elements;\n```\n\n## 线程 ID\n\n```txt\nqq:c2c/<openid>\nqq:group/<group_openid>\nqq:guild/<guild_id>/<channel_id>\n```\n\n频道场景的 ID 已预留，但当前主要支持 C2C 和群聊。\n\n## 能力边界\n\n当前未实现：\n\n- `editMessage`\n- `addReaction` / `removeReaction`\n- modal / options load\n- schedule message\n- QQ Embed 发送\n\n`fetchMessages` / `fetchMessage` 直接调用适配器时仍读取本进程缓存，不是 QQ 服务端历史消息查询。适配器同时声明了 `persistThreadHistory = true`，因此通过 Chat SDK 运行时接收/发送的线程历史会写入所配置的 state adapter，可跨进程恢复（持久性取决于所选 state adapter；`state-memory` 本身只在内存中保存）。\n\n## 代码风格\n\n这个包的实现风格偏直接和保守：\n\n- 类型先行，公开配置尽量用明确的联合类型表达约束\n- 不把 QQ 平台私有概念伪装成 Chat SDK 标准字段\n- 跨平台字段只映射确定语义，其他信息保留在 `raw`\n- 辅助函数按职责拆小，避免单个 utils 文件持续膨胀\n- 错误映射基于 HTTP 状态码和 QQ 错误码，不匹配错误文案\n- 默认安全配置贴近 QQ 官方要求，测试开关显式暴露\n\n## 开发\n\n```bash\npnpm run typecheck\npnpm run test\npnpm run build\n```\n\n## 本地测试 Bot\n\n仓库内置了一个最小测试 bot：\n\n- Bot 代码：`test/bot.ts`\n- 本地服务：`test/server.mjs`\n- Webhook 路由：`/webhooks/qq`\n- 健康检查：`/health`\n\n### Webhook\n\n创建 `.env.local`：\n\n```env\nQQ_APP_ID=\nQQ_CLIENT_SECRET=\n```\n\n启动：\n\n```bash\npnpm run test:bot\n```\n\n然后将 QQ 回调地址配置为：\n\n```txt\nhttps://<your-public-domain>/webhooks/qq\n```\n\n### Socket Mode\n\n创建 `.env.ws.local`：\n\n```env\nQQ_APP_ID=\nQQ_CLIENT_SECRET=\n```\n\n启动：\n\n```bash\npnpm run test:bot:ws\n```\n\n可选调试：\n\n```env\nQQ_DEBUG_PAYLOADS=true\n# 默认 true；不设置 shard 时按 /gateway/bot 推荐值自动分片\nQQ_SOCKET_MODE_AUTO_SHARDING=true\n# 未设置时默认包含 GROUP_AND_C2C_EVENT、INTERACTION、MESSAGE_AUDIT\nQQ_SOCKET_MODE_INTENTS=\nQQ_SOCKET_MODE_SHARD=0,1\nQQ_SOCKET_MODE_URL=\n```\n\n测试 bot 支持：\n\n- 私聊任意文本：回复 `echo: <文本>`\n- `/help`：显示测试命令列表\n- `/ping`、`/id`\n- `/md`\n- `/button`：测试回调按钮和带稳定 ID 的 LinkButton\n- `/image`：发送 `test/images/amatsuka.jpeg`\n- `/images`：一次传入两张 `test/images/amatsuka.jpeg`\n- `/file`：通过 Chat SDK `files` 发送文本文件，可同时验证群文件接口\n- `/chart`：发送带 caption 的 Table 和 Chart 降级文本\n- `/jsx-image`：发送包含 base64 data URL 图片的 Card 消息（走 media）\n- `/jsx-image-url`：发送包含外部 URL 图片的 Card 消息（走 Markdown，可交错排版）\n- `/ark`：发送 QQ Ark 消息\n- `/stream`：测试带固定 `msg_seq` 的 C2C 原生流式消息（群聊自动降级）\n- `/wakeup`：在 C2C 中测试 `is_wakeup` 主动唤醒，并在终端打印异步接受状态\n- `/reference [message_id]`：测试 QQ `message_reference`；不传 ID 时使用当前命令消息 ID\n- `/mention`：@发送者测试 mentionUser\n- `/mention-state`：测试 `/mention-state` 与 `@bot /mention-state` 的提及状态差异\n- `普通消息测试`：测试群普通消息进入 `onNewMessage`，并输出 `isMention` 与 raw 提及状态\n\n`MESSAGE_AUDIT_PASS` / `MESSAGE_AUDIT_REJECT` 会以 `[qq:audit]` 输出到终端。也可以绕过 Bot 路由直接测试 C2C 主动唤醒发送：\n\n```bash\npnpm run test:c2c-proactive -- <openid> \"测试消息\"\n```\n\n该脚本调用 `postQQMessage(..., { isWakeup: true })`，并打印 HTTP 状态、异步业务码与 delivery status。\n\n## 参考\n\n- https://bot.q.qq.com/wiki/develop/api-v2/\n- https://bot.q.qq.com/wiki/develop/api-v2/dev-prepare/interface-framework/api-use.html\n- https://bot.q.qq.com/wiki/develop/api-v2/dev-prepare/interface-framework/sign.html\n- https://bot.q.qq.com/wiki/develop/api-v2/dev-prepare/interface-framework/event-emit.html\n- https://bot.q.qq.com/wiki/develop/api-v2/server-inter/message/trans/msg-btn.html\n","readmeFilename":"README.md"}