koishi-plugin-cocoyyy-console 1.1.0-beta.7 → 1.1.0-beta.8
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/index.js +13 -5
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -2179,8 +2179,7 @@ var gameList = [
|
|
|
2179
2179
|
var commandList = [
|
|
2180
2180
|
"endgame",
|
|
2181
2181
|
"gamelist",
|
|
2182
|
-
"startgame"
|
|
2183
|
-
"reroll"
|
|
2182
|
+
"startgame"
|
|
2184
2183
|
];
|
|
2185
2184
|
function registerGameCommands(ctx, game_config, ai_config) {
|
|
2186
2185
|
if (game_config?.config_path) {
|
|
@@ -2211,7 +2210,7 @@ function registerGameCommands(ctx, game_config, ai_config) {
|
|
|
2211
2210
|
is_thinking = true;
|
|
2212
2211
|
switch (game) {
|
|
2213
2212
|
case gameList[0].command:
|
|
2214
|
-
await session.send("正在开始游戏...后续问答请参照格式:@bot [问题]");
|
|
2213
|
+
await session.send("正在开始游戏...后续问答请参照格式:@bot [问题]\n需要刷新谜题时发送:@bot reroll");
|
|
2215
2214
|
const resp = await startSituationPuzzle(ai_config);
|
|
2216
2215
|
return checkResp(resp);
|
|
2217
2216
|
default:
|
|
@@ -2261,8 +2260,17 @@ function registerGameMiddleware(ctx, ai_config) {
|
|
|
2261
2260
|
commandList.forEach((element) => {
|
|
2262
2261
|
if (text.includes(element)) return next();
|
|
2263
2262
|
});
|
|
2264
|
-
|
|
2265
|
-
|
|
2263
|
+
try {
|
|
2264
|
+
is_thinking = true;
|
|
2265
|
+
if (text.includes("reroll")) {
|
|
2266
|
+
const resp2 = await rerollSituationPuzzle(ai_config);
|
|
2267
|
+
return checkResp(resp2);
|
|
2268
|
+
}
|
|
2269
|
+
const resp = await questSituationPuzzle(text, ai_config);
|
|
2270
|
+
return (0, import_koishi12.h)("at", { id: userId }) + " " + checkResp(resp);
|
|
2271
|
+
} finally {
|
|
2272
|
+
is_thinking = false;
|
|
2273
|
+
}
|
|
2266
2274
|
});
|
|
2267
2275
|
}
|
|
2268
2276
|
__name(registerGameMiddleware, "registerGameMiddleware");
|