koishi-plugin-cocoyyy-console 1.1.3-alpha.6 → 1.1.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.
Files changed (2) hide show
  1. package/lib/index.js +40 -25
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -333,70 +333,71 @@ __name(loadYamlConfig, "loadYamlConfig");
333
333
  var menuList = [
334
334
  {
335
335
  name: "tag",
336
- description: "标签功能,用于记录黑历史",
337
- command: "maketag [标签]"
336
+ description: "标签功能,用于记录黑历史"
338
337
  },
339
338
  {
340
339
  name: "repeat",
341
- description: "复读功能,用于复读",
342
- command: "无"
340
+ description: "复读功能,用于复读"
343
341
  },
344
342
  {
345
343
  name: "rbq",
346
- description: "*人功能,用于*人",
347
- command: "无"
344
+ description: "*人功能,用于*人"
348
345
  },
349
346
  {
350
347
  name: "son",
351
- description: "shit_or_not功能,用于鉴别史消息",
352
- command: "无"
348
+ description: "shit_or_not功能,用于鉴别史消息"
353
349
  },
354
350
  {
355
351
  name: "setu",
356
- description: "随机涩图功能,用于获取涩图",
357
- command: "无"
352
+ description: "随机涩图功能,用于获取涩图"
353
+ },
354
+ {
355
+ name: "wish",
356
+ description: "许愿功能,用于许愿"
358
357
  },
359
358
  {
360
359
  name: "game",
361
- description: "游戏功能,用于游玩游戏",
362
- command: "无"
360
+ description: "游戏功能,用于游玩游戏"
363
361
  },
364
362
  {
365
363
  name: "kuro",
366
- description: "库洛相关功能,用于鸣潮相关功能",
367
- command: "无"
364
+ description: "库洛相关功能,用于鸣潮相关功能"
368
365
  }
369
366
  ];
370
367
  function getMenuList(command = null, functionConfig) {
371
368
  switch (command) {
372
- case "tag":
369
+ case menuList[0].name:
373
370
  if (!functionConfig.tag_flag)
374
371
  return "标签功能已关闭";
375
372
  return getTagFuncMenu(command);
376
- case "repeat":
373
+ case menuList[1].name:
377
374
  if (!functionConfig.repeat_flag)
378
375
  return "复读功能已关闭";
379
376
  return `[所有命令都需要@bot]
380
377
  复读功能菜单:
381
378
  群内重复一定次数的消息会进行复读
382
379
  如果遇到问题请联系开发人员。`;
383
- case "rbq":
380
+ case menuList[2].name:
384
381
  if (!functionConfig.rbq_flag)
385
382
  return "*人功能已关闭";
386
383
  return getRbqFuncMenu(command);
387
- case "son":
384
+ case menuList[3].name:
388
385
  if (!functionConfig.son_flag)
389
386
  return "son功能已关闭";
390
387
  return getSonFuncMenu(command);
391
- case "setu":
388
+ case menuList[4].name:
392
389
  if (!functionConfig.setu_flag)
393
390
  return "son功能已关闭";
394
391
  return getSetuFuncMenu(command);
395
- case "game":
392
+ case menuList[5].name:
393
+ if (!functionConfig.wish_flag)
394
+ return "许愿功能已关闭";
395
+ return getWishFuncMenu(command);
396
+ case menuList[6].name:
396
397
  if (!functionConfig.game_flag)
397
398
  return "游戏功能已关闭";
398
399
  return getGameFuncMenu(command);
399
- case "kuro":
400
+ case menuList[7].name:
400
401
  if (!functionConfig.kuro_flag)
401
402
  return "库洛相关功能已关闭";
402
403
  return getKuroFuncMenu(command);
@@ -524,6 +525,20 @@ setu功能菜单:
524
525
  输入对应指令使用setu功能,如果遇到问题请联系开发人员。`;
525
526
  }
526
527
  __name(getSetuFuncMenu, "getSetuFuncMenu");
528
+ var wishFuncMenuList = [
529
+ {
530
+ name: "wish",
531
+ description: "许愿功能",
532
+ command: "wish [愿望消息(不要超过80字)]"
533
+ }
534
+ ];
535
+ function getWishFuncMenu(command = null) {
536
+ return `[所有命令都需要@bot]
537
+ 许愿功能菜单:
538
+ ${wishFuncMenuList.map((item) => item.command + ": " + item.description).join("\n ")}
539
+ 输入对应指令使用许愿功能,如果遇到问题请联系开发人员。`;
540
+ }
541
+ __name(getWishFuncMenu, "getWishFuncMenu");
527
542
  var gameFuncMenuList = [
528
543
  {
529
544
  name: "gamelist",
@@ -1749,13 +1764,14 @@ async function randomHImg(keywords, ...args) {
1749
1764
  const params = new URLSearchParams();
1750
1765
  params.append("excludeAI", "true");
1751
1766
  params.append("size", "regular");
1752
- const random = new import_koishi13.Random(() => Math.random());
1767
+ let r18_flag = 0;
1753
1768
  if (r18) {
1754
1769
  if (r18.toLowerCase() === "r18") {
1755
- params.append("r18", "1");
1770
+ r18_flag = 1;
1756
1771
  tags = keywords?.slice(1);
1757
1772
  }
1758
1773
  }
1774
+ params.append("r18", r18_flag.toString());
1759
1775
  if (args[0]) {
1760
1776
  params.append("num", args[0].toString());
1761
1777
  }
@@ -1974,7 +1990,6 @@ function registerWishCommands(ctx, ai_config, wish_config) {
1974
1990
  if (!dev_mode) {
1975
1991
  if (!is_at_bot(session)) return "请提供正确格式,如: @bot wish [愿望消息(不要超过80字)]";
1976
1992
  }
1977
- if (think_flag2) return "请等待上一位的祈祷结果";
1978
1993
  const wish_content = args?.[0];
1979
1994
  if (!wish_content) return "输入愿望消息,不要超过80字";
1980
1995
  await session.send("已收到,正在祈祷中...");
@@ -1984,7 +1999,7 @@ function registerWishCommands(ctx, ai_config, wish_config) {
1984
1999
  if (!exec) return "愿望不合规被拒绝,请重新许愿";
1985
2000
  let exec_generation = await gernerationSoluation(local_config2, wish_content, ai_config, wish_config);
1986
2001
  if (!exec_generation) return "愿望实现失败,请重新许愿";
1987
- return (0, import_koishi14.h)("at", { id: session.userId }) + "\n" + exec_generation;
2002
+ return (0, import_koishi14.h)("at", { id: session.userId }) + " 祈祷成功,愿梦想成真!\n" + exec_generation;
1988
2003
  } finally {
1989
2004
  think_flag2 = false;
1990
2005
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-cocoyyy-console",
3
3
  "description": "自用koishi插件,功能包含复读,记录黑历史,*人等",
4
- "version": "1.1.3-alpha.6",
4
+ "version": "1.1.3",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "contributors": [