@cloud411716/fancy-webnovel 1.0.31 → 1.0.33
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/commands/scan/index.js +24 -14
- package/package.json +1 -1
package/commands/scan/index.js
CHANGED
|
@@ -134,15 +134,20 @@ export function apply(ctx) {
|
|
|
134
134
|
}
|
|
135
135
|
|
|
136
136
|
// ---------- platform selection ----------
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
137
|
+
let platformResult;
|
|
138
|
+
try {
|
|
139
|
+
platformResult = await ctx.userQuestions.ask({
|
|
140
|
+
questions: [{
|
|
141
|
+
id: 'platform',
|
|
142
|
+
...scan.askPlatform(),
|
|
143
|
+
question: `${scan.platformList()}\n\n请选择要扫的平台(输入编号 1-4):`,
|
|
144
|
+
}],
|
|
145
|
+
agent: invocation.agent,
|
|
146
|
+
signal,
|
|
147
|
+
});
|
|
148
|
+
} catch {
|
|
149
|
+
return notify(session, 'error', scan.notify({ type: 'cancelled' }));
|
|
150
|
+
}
|
|
146
151
|
const answer = platformResult.answers[0]?.custom?.trim();
|
|
147
152
|
if (!answer) {
|
|
148
153
|
return notify(session, 'error', scan.notify({ type: 'cancelled' }));
|
|
@@ -155,11 +160,16 @@ export function apply(ctx) {
|
|
|
155
160
|
const platform = row[1];
|
|
156
161
|
|
|
157
162
|
// ---------- rank selection (multi-select) ----------
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
+
let rankResult;
|
|
164
|
+
try {
|
|
165
|
+
rankResult = await ctx.userQuestions.ask({
|
|
166
|
+
questions: [scan.askRankList(platform)],
|
|
167
|
+
agent: invocation.agent,
|
|
168
|
+
signal,
|
|
169
|
+
});
|
|
170
|
+
} catch {
|
|
171
|
+
return notify(session, 'error', scan.notify({ type: 'cancelled' }));
|
|
172
|
+
}
|
|
163
173
|
const selected = rankResult.answers[0]?.selected ?? [];
|
|
164
174
|
const custom = rankResult.answers[0]?.custom?.trim();
|
|
165
175
|
|