koishi-plugin-hhs-huatu 0.2.0 → 0.2.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/lib/config.d.ts +1 -1
- package/lib/index.js +5 -2
- package/package.json +1 -1
- package/readme.md +14 -8
package/lib/config.d.ts
CHANGED
|
@@ -249,5 +249,5 @@ interface Forbidden {
|
|
|
249
249
|
strict: boolean;
|
|
250
250
|
}
|
|
251
251
|
export declare function parseForbidden(input: string): Forbidden[];
|
|
252
|
-
export declare function parseInput(session: Session, input: string, config: Config, override: boolean): string[];
|
|
252
|
+
export declare function parseInput(session: Session, input: string, config: Config, override: boolean, undesired?: string): string[];
|
|
253
253
|
export {};
|
package/lib/index.js
CHANGED
|
@@ -1152,7 +1152,7 @@ function parseForbidden(input) {
|
|
|
1152
1152
|
}
|
|
1153
1153
|
__name(parseForbidden, "parseForbidden");
|
|
1154
1154
|
var backslash = /@@__BACKSLASH__@@/g;
|
|
1155
|
-
function parseInput(session, input, config, override) {
|
|
1155
|
+
function parseInput(session, input, config, override, undesired) {
|
|
1156
1156
|
if (!input) {
|
|
1157
1157
|
return [
|
|
1158
1158
|
null,
|
|
@@ -1186,6 +1186,9 @@ function parseInput(session, input, config, override) {
|
|
|
1186
1186
|
input = input.slice(0, capture.index).trim();
|
|
1187
1187
|
appendToList(negative, capture[3]);
|
|
1188
1188
|
}
|
|
1189
|
+
if (undesired) {
|
|
1190
|
+
appendToList(negative, undesired);
|
|
1191
|
+
}
|
|
1189
1192
|
const forbidden = parseForbidden(session.resolve(config.forbidden));
|
|
1190
1193
|
const positive = input.split(/,\s*/g).filter((word) => {
|
|
1191
1194
|
word = word.toLowerCase().replace(/[\x00-\x7f]/g, (s) => s.replace(/[^0-9a-zA-Z]/, " ")).replace(/\s+/, " ").trim();
|
|
@@ -2064,7 +2067,7 @@ function apply(ctx, config) {
|
|
|
2064
2067
|
ctx.logger.warn(err);
|
|
2065
2068
|
}
|
|
2066
2069
|
}
|
|
2067
|
-
const [errPath, prompt, uc] = parseInput(session, input, config, options2.override);
|
|
2070
|
+
const [errPath, prompt, uc] = parseInput(session, input, config, options2.override, options2.undesired);
|
|
2068
2071
|
if (errPath) return session.text(errPath);
|
|
2069
2072
|
let token;
|
|
2070
2073
|
try {
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -32,17 +32,23 @@ nai4-5 场景 -K "1girl, smile@B3 --uc:frown;1boy, tall@D3 --uc:short"
|
|
|
32
32
|
nai4c 场景 -K "角色1@A1;角色2@E5"
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
(
|
|
35
|
+
**位置坐标表(5×5网格):**
|
|
36
|
+
```
|
|
37
|
+
A B C D E
|
|
38
|
+
1 A1 B1 C1 D1 E1 (顶部)
|
|
39
|
+
2 A2 B2 C2 D2 E2
|
|
40
|
+
3 A3 B3 C3 D3 E3 (中心)
|
|
41
|
+
4 A4 B4 C4 D4 E4
|
|
42
|
+
5 A5 B5 C5 D5 E5 (底部)
|
|
43
|
+
(左) (右)
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
**语法说明:**
|
|
43
47
|
- 格式:`A-E`(横向) + `1-5`(纵向),如 `A1`(左上) 到 `E5`(右下)
|
|
44
48
|
- 默认位置:`C3`(中心)
|
|
45
49
|
- 分隔符:`;` 或 `;`(支持中英文分号)
|
|
50
|
+
- 位置:`@位置` (如 @B3),可选
|
|
51
|
+
- 负向提示:`--uc:xxx`,可选
|
|
46
52
|
|
|
47
53
|
详细文档请查看插件目录下的 `CHARACTERS_USAGE.md`。
|
|
48
54
|
|