@karinjs/adapter-qqbot 3.2.0 → 3.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -2
- package/dist/apps/cleanup.js +1 -1
- package/dist/apps/login.js +1 -1
- package/dist/apps/qqbot-file-to-url.js +1 -1
- package/dist/{common-OHGAoohl.js → common-DwVsAvIo.js} +6 -1
- package/dist/{config-D1_LqrcJ.js → config-BgCU6apn.js} +2 -6
- package/dist/index.d.ts +315 -28
- package/dist/index.js +457 -252
- package/dist/{message-CVJVFAGR.js → message-CydR-wrX.js} +1 -1
- package/dist/utils-u17tvC2U.js +5 -0
- package/dist/web.config.d.ts +0 -1
- package/dist/web.config.js +4 -12
- package/package.json +8 -6
- package/dist/utils-C0oZi6PR.js +0 -5
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as pluginDirName, n as config } from "./config-
|
|
1
|
+
import { c as pluginDirName, n as config } from "./config-BgCU6apn.js";
|
|
2
2
|
import { t as log } from "./logger-sza6kuy3.js";
|
|
3
3
|
import { karinPathBase, karinPathTemp } from "node-karin";
|
|
4
4
|
import { createWriteStream } from "node:fs";
|
package/dist/web.config.d.ts
CHANGED
package/dist/web.config.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as readConfigFile, n as config, o as writeConfig, s as pkg } from "./config-
|
|
2
|
-
import "./utils-
|
|
1
|
+
import { a as readConfigFile, n as config, o as writeConfig, s as pkg } from "./config-BgCU6apn.js";
|
|
2
|
+
import "./utils-u17tvC2U.js";
|
|
3
3
|
import karin, { components, defineConfig } from "node-karin";
|
|
4
4
|
|
|
5
5
|
//#region src/web.config.ts
|
|
@@ -71,7 +71,6 @@ var web_config_default = defineConfig({
|
|
|
71
71
|
guildEnable: item.guildEnable,
|
|
72
72
|
guildMode: item.guildMode === 1,
|
|
73
73
|
regex: item.regex.map((r) => `${r.reg} ${r.rep}`),
|
|
74
|
-
"markdown:enable": item.markdown?.enable !== false,
|
|
75
74
|
"messageCache:enable": item.messageCache?.enable === true,
|
|
76
75
|
"messageCache:self": item.messageCache?.self === true,
|
|
77
76
|
"messageCache:level": item.messageCache?.level || "standard",
|
|
@@ -84,7 +83,7 @@ var web_config_default = defineConfig({
|
|
|
84
83
|
descPosition: 5
|
|
85
84
|
}), components.accordionPro.create("qqbot", data, {
|
|
86
85
|
label: "QQ 官方机器人列表",
|
|
87
|
-
description: "每一项对应一个 QQ 官方机器人账号。新增机器人时先填 AppID 和 Secret
|
|
86
|
+
description: "每一项对应一个 QQ 官方机器人账号。新增机器人时先填 AppID 和 Secret,再按需调整接收方式、场景能力和消息处理。",
|
|
88
87
|
children: {
|
|
89
88
|
key: "qqbotConfig",
|
|
90
89
|
children: [
|
|
@@ -144,7 +143,7 @@ var web_config_default = defineConfig({
|
|
|
144
143
|
defaultSelected: false
|
|
145
144
|
}),
|
|
146
145
|
components.divider.horizontal("bot-message-section", {
|
|
147
|
-
description: "
|
|
146
|
+
description: "消息处理",
|
|
148
147
|
descPosition: 5
|
|
149
148
|
}),
|
|
150
149
|
components.input.group("regex", {
|
|
@@ -156,11 +155,6 @@ var web_config_default = defineConfig({
|
|
|
156
155
|
placeholder: "^/ #"
|
|
157
156
|
})
|
|
158
157
|
}),
|
|
159
|
-
components.switch.create("markdown:enable", {
|
|
160
|
-
label: "启用 Markdown 发送通道",
|
|
161
|
-
description: "开启后普通文本和图片优先合并为 QQ Markdown 消息,Markdown 里的图片会以内嵌图片形式发送;关闭后普通图片会按官方富媒体单独上传发送。插件显式传入的 segment.markdown 不受此开关影响。",
|
|
162
|
-
defaultSelected: true
|
|
163
|
-
}),
|
|
164
158
|
components.divider.horizontal("bot-cache-section", {
|
|
165
159
|
description: "消息缓存",
|
|
166
160
|
descPosition: 5
|
|
@@ -223,7 +217,6 @@ var web_config_default = defineConfig({
|
|
|
223
217
|
const guildEnable = toBool(item.guildEnable, previous?.guildEnable ?? true);
|
|
224
218
|
const guildMode = toBool(item.guildMode, previous?.guildMode === 1) ? 1 : 0;
|
|
225
219
|
const eventType = Number(toStringValue(item["event:type"], String(previous?.event?.type ?? 0)));
|
|
226
|
-
const markdownEnable = toBool(item["markdown:enable"], previous?.markdown?.enable ?? true);
|
|
227
220
|
const messageCacheEnable = toBool(item["messageCache:enable"], previous?.messageCache?.enable ?? false);
|
|
228
221
|
const messageCacheSelf = toBool(item["messageCache:self"], previous?.messageCache?.self ?? false);
|
|
229
222
|
/** 枚举与数值范围由 writeConfig 内的 formatConfig 统一校验回落。 */
|
|
@@ -247,7 +240,6 @@ var web_config_default = defineConfig({
|
|
|
247
240
|
guildEnable,
|
|
248
241
|
guildMode,
|
|
249
242
|
regex,
|
|
250
|
-
markdown: { enable: markdownEnable },
|
|
251
243
|
messageCache: {
|
|
252
244
|
enable: messageCacheEnable,
|
|
253
245
|
self: messageCacheSelf,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@karinjs/adapter-qqbot",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.3.1",
|
|
4
4
|
"description": "karin adapter for QQ Official Bot (2.0)",
|
|
5
5
|
"homepage": "https://github.com/KarinJS/karin-plugin-adapter-qqbot",
|
|
6
6
|
"bugs": {
|
|
@@ -21,12 +21,13 @@
|
|
|
21
21
|
"build": "tsc && tsdown",
|
|
22
22
|
"dev": "tsx watch --include \"src/**/*.ts\" src/app.ts",
|
|
23
23
|
"karin": "karin",
|
|
24
|
-
"lint": "eslint src",
|
|
25
|
-
"lint:fix": "eslint src --fix",
|
|
24
|
+
"lint": "eslint src tests",
|
|
25
|
+
"lint:fix": "eslint src tests --fix",
|
|
26
26
|
"pub": "npm publish --access public",
|
|
27
27
|
"sort": "npx sort-package-json",
|
|
28
|
-
"test": "
|
|
29
|
-
"
|
|
28
|
+
"test": "vitest run",
|
|
29
|
+
"test:watch": "vitest",
|
|
30
|
+
"typecheck": "npx tsc --noEmit && npx tsc --noEmit -p tests/tsconfig.json"
|
|
30
31
|
},
|
|
31
32
|
"dependencies": {
|
|
32
33
|
"@karinjs/geturls": "^1.0.2",
|
|
@@ -46,7 +47,8 @@
|
|
|
46
47
|
"node-karin": "1.16.3",
|
|
47
48
|
"tsdown": "^0.22.13",
|
|
48
49
|
"tsx": "^4.23.1",
|
|
49
|
-
"typescript": "^6.0.3"
|
|
50
|
+
"typescript": "^6.0.3",
|
|
51
|
+
"vitest": "^4.1.11"
|
|
50
52
|
},
|
|
51
53
|
"publishConfig": {
|
|
52
54
|
"access": "public",
|