@nestim/koishi-plugin-qqgm-chat-style 1.0.1 → 1.0.3
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 +2 -1
- package/index.js +11 -3
- package/lib/registry.js +14 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -10,7 +10,8 @@ Koishi 聊天风格插件,配合 [`@nestim/koishi-plugin-qq-group-manager`](ht
|
|
|
10
10
|
| --- | --- |
|
|
11
11
|
| [`@nestim/koishi-plugin-qq-group-manager`](https://github.com/Miseat/koishi-plugin-qq-group-manager) | **主插件**:群管、自动管控、AI 回复、记忆库、识图、定时提醒 |
|
|
12
12
|
| **`@nestim/koishi-plugin-qqgm-chat-style`** | 本插件:聊天风格 |
|
|
13
|
-
| [`@nestim/koishi-plugin-qqgm-meme`](https://github.com/Miseat/koishi-plugin-qqgm-meme) | 表情包:按情绪标签抽图,按概率补发 |
|
|
13
|
+
| [`@nestim/koishi-plugin-qqgm-meme`](https://github.com/Miseat/koishi-plugin-qqgm-meme) | 表情包:按情绪标签抽图,按概率补发 |
|
|
14
|
+
| [`@nestim/koishi-plugin-qqgm-private`](https://github.com/Miseat/koishi-plugin-qqgm-private) | 私聊:AI 自动回复 + 定时主动私发 |
|
|
14
15
|
|
|
15
16
|
配套 skill(可直接放进 `data/chat-styles/`):
|
|
16
17
|
|
package/index.js
CHANGED
|
@@ -45,11 +45,11 @@ const DEFAULT_BANNED = [
|
|
|
45
45
|
/** 追加风格:一条一条往下加,字段名尽量短,配置页只剩“几个字 + 一个框”。 */
|
|
46
46
|
const ExtraStyle = Schema.object({
|
|
47
47
|
style: Schema.string().default('')
|
|
48
|
-
.description('技能名,填 data/chat-styles 下的目录名,例如 naruto-mobile-chat
|
|
48
|
+
.description('技能名,填 data/chat-styles 下的目录名,例如 naruto-mobile-chat。留空表示这条不生效。'),
|
|
49
49
|
probability: Schema.percent().default(0.3)
|
|
50
|
-
.description('每轮触发的概率(内部随机数)。0 等于永远不叠,1
|
|
50
|
+
.description('每轮触发的概率(内部随机数)。0 等于永远不叠,1 等于每次都叠。默认 0.3 = 三成概率。'),
|
|
51
51
|
enabled: Schema.boolean().default(true)
|
|
52
|
-
.description('
|
|
52
|
+
.description('启用这条追加风格。勾选 = 生效,取消勾选 = 暂时停用(配置保留,随时可再勾回来)。'),
|
|
53
53
|
maxChars: Schema.natural().min(10).max(500).default(60)
|
|
54
54
|
.description('叠加时的字数上限;留默认即可,通常沿用主风格。'),
|
|
55
55
|
maxLines: Schema.natural().min(1).max(10).default(3)
|
|
@@ -155,6 +155,14 @@ function apply(ctx, config) {
|
|
|
155
155
|
for (const extra of set.extras) {
|
|
156
156
|
lines.push(`- ${extra.id} · ${Math.round(extra.probability * 100)}%`);
|
|
157
157
|
}
|
|
158
|
+
} else {
|
|
159
|
+
lines.push('', '当前追加风格:(无)');
|
|
160
|
+
}
|
|
161
|
+
if (set.disabled && set.disabled.length) {
|
|
162
|
+
lines.push('', '已关闭的追加风格:');
|
|
163
|
+
for (const item of set.disabled) {
|
|
164
|
+
lines.push(`- ${item.style}(enabled=false,不会叠加)`);
|
|
165
|
+
}
|
|
158
166
|
}
|
|
159
167
|
return lines.join('\n');
|
|
160
168
|
});
|
package/lib/registry.js
CHANGED
|
@@ -102,13 +102,25 @@ function buildStyleSet(rootDir, config = {}) {
|
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
const extras = [];
|
|
105
|
+
const disabled = [];
|
|
105
106
|
const seen = new Set(primary ? [primary.id] : []);
|
|
106
107
|
const rawExtras = Array.isArray(config.extraStyles) ? config.extraStyles : [];
|
|
107
108
|
rawExtras.forEach((entry, index) => {
|
|
108
109
|
if (!entry || typeof entry !== 'object') return;
|
|
109
|
-
if (entry.enabled === false) return;
|
|
110
110
|
const wanted = String(entry.style || '').trim();
|
|
111
111
|
if (!wanted) return;
|
|
112
|
+
|
|
113
|
+
// enabled 未填(undefined / null)一律视为启用,只有显式 false 才算关闭。
|
|
114
|
+
// 以前这里直接 return 且不记日志,用户完全看不出为什么没生效。
|
|
115
|
+
const isOff = entry.enabled === false;
|
|
116
|
+
if (isOff) {
|
|
117
|
+
disabled.push({ index, style: wanted });
|
|
118
|
+
warnings.push(
|
|
119
|
+
`追加风格 #${index + 1}「${wanted}」已关闭(enabled=false),本次不会叠加;想启用请把该项勾上`,
|
|
120
|
+
);
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
|
|
112
124
|
const found = pickByName(available, wanted);
|
|
113
125
|
if (!found) {
|
|
114
126
|
warnings.push(`追加风格 #${index + 1}「${wanted}」不可用,已跳过`);
|
|
@@ -133,7 +145,7 @@ function buildStyleSet(rootDir, config = {}) {
|
|
|
133
145
|
});
|
|
134
146
|
});
|
|
135
147
|
|
|
136
|
-
return { primary, extras, warnings, available };
|
|
148
|
+
return { primary, extras, disabled, warnings, available };
|
|
137
149
|
}
|
|
138
150
|
|
|
139
151
|
/** 主风格段:与旧版行为一致,整段进入提示词。 */
|
package/package.json
CHANGED