koishi-plugin-noah 2.4.1 → 2.4.2

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.
@@ -1,3 +1,6 @@
1
1
  import { Context } from 'koishi';
2
2
  import { CoreConfig } from '../../types/config';
3
- export declare function bind(ctx: Context, config: CoreConfig): void;
3
+ import { CardService } from '../services/card-service';
4
+ import { ServerService } from '../services/server-service';
5
+ import { UserService } from '../services/user-service';
6
+ export declare function bind(ctx: Context, config: CoreConfig, cardService: CardService, serverService: ServerService, userService: UserService): void;
@@ -1,3 +1,6 @@
1
1
  import { Context } from 'koishi';
2
2
  import { CoreConfig } from '../../types/config';
3
- export declare function card(ctx: Context, config: CoreConfig): void;
3
+ import { CardService } from '../services/card-service';
4
+ import { ServerService } from '../services/server-service';
5
+ import { UserService } from '../services/user-service';
6
+ export declare function card(ctx: Context, config: CoreConfig, cardService: CardService, serverService: ServerService, userService: UserService): void;
@@ -1,3 +1,5 @@
1
1
  import { Context } from 'koishi';
2
2
  import { CoreConfig } from '../../types/config';
3
- export declare function server(ctx: Context, config: CoreConfig): void;
3
+ import { ServerService } from '../services/server-service';
4
+ import { UserService } from '../services/user-service';
5
+ export declare function server(ctx: Context, config: CoreConfig, serverService: ServerService, userService: UserService): void;
@@ -20,7 +20,7 @@ export interface Card {
20
20
  id: number;
21
21
  code: string;
22
22
  name: string;
23
- defaultServerId?: number;
23
+ defaultServerId: number;
24
24
  }
25
25
  export interface Server {
26
26
  id: number;
@@ -1,15 +1 @@
1
- import { TServer, TGame } from '../../types';
2
- export interface Card {
3
- id: number;
4
- code: string;
5
- name: string;
6
- defaultServerId: number;
7
- }
8
- export interface Server {
9
- id: number;
10
- type: TServer;
11
- name: string;
12
- baseUrl: string;
13
- pcbid?: string;
14
- supportedGames: TGame[];
15
- }
1
+ export type { Card, Server } from '../database';
package/lib/index.cjs CHANGED
@@ -491,9 +491,6 @@ var CardService = class {
491
491
  * @returns 无返回值的Promise
492
492
  */
493
493
  async updateCard(id, partial) {
494
- if (partial.defaultServerId === void 0) {
495
- partial.defaultServerId = 0;
496
- }
497
494
  await this.ctx.database.set(this.tableName, id, partial);
498
495
  }
499
496
  /**
@@ -1423,11 +1420,8 @@ __export(command_exports, {
1423
1420
  });
1424
1421
 
1425
1422
  // src/core/commands/bind.ts
1426
- function bind(ctx, config) {
1427
- ctx.command("bind [cardCode:text]", { slash: true }).alias("绑卡").userFields(["defaultCardId", "id"]).action(async ({ session }, cardCode) => {
1428
- const cardService = new CardService(ctx);
1429
- const serverService = new ServerService(ctx);
1430
- const userService = new UserService(ctx);
1423
+ function bind(ctx, config, cardService, serverService, userService) {
1424
+ ctx.command("bind [cardCode:text]", { slash: true }).alias("绑卡").userFields(["id"]).action(async ({ session }, cardCode) => {
1431
1425
  if (!cardCode) {
1432
1426
  await session.send(session.text(".prompt"));
1433
1427
  cardCode = await session.prompt();
@@ -1482,9 +1476,8 @@ __name(bind, "bind");
1482
1476
 
1483
1477
  // src/core/commands/card.ts
1484
1478
  var import_koishi2 = require("koishi");
1485
- function card(ctx, config) {
1479
+ function card(ctx, config, cardService, serverService, userService) {
1486
1480
  ctx.command("card", { slash: true }).alias("卡片管理").userFields(["id"]).channelFields(["id"]).option("detail", "-d <cardCode:text>").action(async ({ session, options }) => {
1487
- const cardService = new CardService(ctx);
1488
1481
  const atGuild = session.guildId != null;
1489
1482
  if (options.detail) {
1490
1483
  const cardCode = processInputCardCode(options.detail);
@@ -1501,8 +1494,6 @@ function card(ctx, config) {
1501
1494
  return session.text(".lookup-error-unknown");
1502
1495
  }
1503
1496
  }
1504
- const serverService = new ServerService(ctx);
1505
- const userService = new UserService(ctx);
1506
1497
  const defaultCard = await cardService.getDefaultCardByUid(session.user.id);
1507
1498
  const defaultCardId = defaultCard ? defaultCard.id : 0;
1508
1499
  const userDefaultServer = await serverService.getDefaultServerByUid(session.user.id);
@@ -1712,14 +1703,6 @@ async function showCardMenu(ctx, session, card2, cardService, serverService, use
1712
1703
  }
1713
1704
  if (selectNum === 3) {
1714
1705
  await cardService.removeCard(card2.id);
1715
- if (userDefaultCardId === card2.id) {
1716
- const res = await cardService.getCardsByUid(uid);
1717
- if (res.length === 0) {
1718
- await userService.updateUserDefaultCard(uid, 0);
1719
- } else {
1720
- await userService.updateUserDefaultCard(uid, res[0].id);
1721
- }
1722
- }
1723
1706
  return session.text(".menu-3-success");
1724
1707
  }
1725
1708
  if (selectNum === 4) {
@@ -1728,10 +1711,7 @@ async function showCardMenu(ctx, session, card2, cardService, serverService, use
1728
1711
  if (!cardName) return session.text("commands.timeout");
1729
1712
  if (cardName === "q") return session.text(".quit");
1730
1713
  if (cardName.includes(" ")) return session.text(".menu-4-error-invalid-name");
1731
- await cardService.updateCard(card2.id, {
1732
- name: cardName,
1733
- defaultServerId: card2.defaultServerId
1734
- });
1714
+ await cardService.updateCard(card2.id, { name: cardName });
1735
1715
  return session.text(".menu-4-success");
1736
1716
  }
1737
1717
  if (selectNum === 5) {
@@ -2048,10 +2028,8 @@ async function promptServerSelect(session, servers, defaultId, prefix) {
2048
2028
  return selectNum;
2049
2029
  }
2050
2030
  __name(promptServerSelect, "promptServerSelect");
2051
- function server(ctx, config) {
2031
+ function server(ctx, config, serverService, userService) {
2052
2032
  ctx.command("server", { slash: true }).alias("服务器管理").option("channel", "-c").userFields(["id"]).channelFields(["id"]).action(async ({ session, options }) => {
2053
- const serverService = new ServerService(ctx);
2054
- const userService = new UserService(ctx);
2055
2033
  const atGuild = session.guildId != null;
2056
2034
  if (options.channel) {
2057
2035
  if (!atGuild) return session.text(".no-channel");
@@ -2258,25 +2236,6 @@ async function showServerMenu(ctx, session, serverService, userService, server2,
2258
2236
  }
2259
2237
  if (selectNum === 3) {
2260
2238
  await serverService.removeServer(server2.id);
2261
- if (from === "user") {
2262
- if (userDefaultServerId === server2.id) {
2263
- const res = await serverService.getServersByUid(uid);
2264
- if (res.length === 0) {
2265
- await userService.updateUserDefaultServer(uid, 0);
2266
- } else {
2267
- await userService.updateUserDefaultServer(uid, res[0].id);
2268
- }
2269
- }
2270
- } else {
2271
- if (channelDefaultServerId === server2.id) {
2272
- const res = await serverService.getServersByCid(cid);
2273
- if (res.length === 0) {
2274
- await userService.updateChannelDefaultServer(session.platform, cid, 0);
2275
- } else {
2276
- await userService.updateChannelDefaultServer(session.platform, cid, res[0].id);
2277
- }
2278
- }
2279
- }
2280
2239
  return session.text(".menu-3-success");
2281
2240
  }
2282
2241
  if (selectNum === 4) {
@@ -2413,10 +2372,13 @@ __name(settings, "settings");
2413
2372
  // src/core/command.ts
2414
2373
  var name2 = "command";
2415
2374
  function apply2(ctx, config) {
2375
+ const cardService = new CardService(ctx);
2376
+ const serverService = new ServerService(ctx);
2377
+ const userService = new UserService(ctx);
2416
2378
  help(ctx, config);
2417
- bind(ctx, config);
2418
- card(ctx, config);
2419
- server(ctx, config);
2379
+ bind(ctx, config, cardService, serverService, userService);
2380
+ card(ctx, config, cardService, serverService, userService);
2381
+ server(ctx, config, serverService, userService);
2420
2382
  locale(ctx, config);
2421
2383
  link(ctx, config);
2422
2384
  maintain(ctx, config);
@@ -2597,7 +2559,7 @@ function guildNameCard(ctx, config) {
2597
2559
  bot.selfId,
2598
2560
  nextNameCard
2599
2561
  );
2600
- ctx.logger("guild-namecard").info(
2562
+ ctx.logger("guild-namecard").debug(
2601
2563
  `更新 ${bot.selfId} 在 ${guild.name} 的群名片: ${currentNameCard} -> ${nextNameCard}`
2602
2564
  );
2603
2565
  try {
@@ -6618,17 +6580,18 @@ var ScoreService = class _ScoreService {
6618
6580
  calcSongRadarContribution(score, category) {
6619
6581
  const { difficulty_data } = score;
6620
6582
  if (!difficulty_data?.radar || !difficulty_data.max_exscore) return 0;
6621
- const L = Math.floor(difficulty_data.difnum);
6583
+ const L = Math.max(1, Math.min(20, Math.floor(difficulty_data.difnum)));
6622
6584
  const R = difficulty_data.radar[category];
6623
6585
  const S = score.music.score;
6624
6586
  const E = score.music.exscore;
6625
6587
  const Emax = difficulty_data.max_exscore;
6626
- const P = Math.min(2 * (L + 31), 100);
6588
+ const P = Math.min(100, Math.max(0, 60 + 2 * L));
6627
6589
  const B = Math.floor(3 * S * R / (4 * 1e7));
6628
- const H = Math.floor((20 - L) / 2);
6629
- const G = Math.max(1e3 + 2 * 2 ** H * (E - Emax), 0);
6590
+ const H = Math.floor(Math.max(1, 21 - L) / 2);
6591
+ const G = Emax > 0 && E <= Emax ? Math.max(0, 1e3 + 2 * (E - Emax) * (1 << H)) : 0;
6630
6592
  const X = Math.floor(R * G / 4e3);
6631
- return P * (B + X);
6593
+ const completedAxis = Math.min(R, B + X);
6594
+ return P * completedAxis;
6632
6595
  }
6633
6596
  /**
6634
6597
  * 计算玩家六维雷达(显示值,如 200.00)
@@ -6658,7 +6621,7 @@ var ScoreService = class _ScoreService {
6658
6621
 
6659
6622
  // src/games/sdvx/commands/radar.ts
6660
6623
  function radar(ctx, config, logger6) {
6661
- ctx.command("sdvx.radar").userFields(["defaultCardId", "defaultServerId", "id"]).channelFields(["defaultServerId", "id"]).option("card", "-c").option("server", "-s").action(async ({ session, options }) => {
6624
+ ctx.command("sdvx.radar").userFields(["id"]).channelFields(["id"]).option("card", "-c").option("server", "-s").action(async ({ session, options }) => {
6662
6625
  const atGuild = session.guildId != null;
6663
6626
  const cardService = new CardService(ctx);
6664
6627
  const serverService = new ServerService(ctx);
@@ -6724,7 +6687,7 @@ function radar(ctx, config, logger6) {
6724
6687
  });
6725
6688
  } catch (error) {
6726
6689
  logger6.warn(error);
6727
- return session.text(".error");
6690
+ return session.text(".error", { card: card2.name, server: server2.name });
6728
6691
  }
6729
6692
  });
6730
6693
  }
@@ -6733,7 +6696,7 @@ __name(radar, "radar");
6733
6696
  // src/games/sdvx/commands/recent.ts
6734
6697
  var import_koishi19 = require("koishi");
6735
6698
  function recent(ctx, config, logger6) {
6736
- ctx.command("sdvx.recent [count:number]").alias("sdvx.r").userFields(["defaultCardId", "defaultServerId", "id"]).channelFields(["defaultServerId", "id"]).option("lossless", "-l").option("card", "-c").option("server", "-s").action(async ({ session, options }, count) => {
6699
+ ctx.command("sdvx.recent [count:number]").alias("sdvx.r").userFields(["id"]).channelFields(["id"]).option("lossless", "-l").option("card", "-c").option("server", "-s").action(async ({ session, options }, count) => {
6737
6700
  const atGuild = session.guildId != null;
6738
6701
  if (!count) count = 1;
6739
6702
  const cardService = new CardService(ctx);
@@ -6807,7 +6770,7 @@ function recent(ctx, config, logger6) {
6807
6770
  return import_koishi19.h.image(imageBuffer, "image/jpg");
6808
6771
  } catch (error) {
6809
6772
  logger6.warn(error);
6810
- return session.text(".error");
6773
+ return session.text(".error", { card: card2.name, server: server2.name });
6811
6774
  }
6812
6775
  });
6813
6776
  }
@@ -6969,7 +6932,10 @@ function sync(ctx, config, logger6) {
6969
6932
  );
6970
6933
  } catch (error) {
6971
6934
  logger6.warn(error);
6972
- return session.text(".fetch-error");
6935
+ return session.text(".fetch-error", {
6936
+ card: sourceCard.name,
6937
+ server: sourceServer.name
6938
+ });
6973
6939
  }
6974
6940
  if (!scoreList || scoreList.length === 0) {
6975
6941
  return session.text(".no-scores");
@@ -6995,7 +6961,10 @@ function sync(ctx, config, logger6) {
6995
6961
  }
6996
6962
  } catch (error) {
6997
6963
  logger6.warn(error);
6998
- return session.text(".sync-error");
6964
+ return session.text(".sync-error", {
6965
+ card: targetCard.name,
6966
+ server: maoServer.name
6967
+ });
6999
6968
  }
7000
6969
  return session.text(".selected-summary", {
7001
6970
  source_server_name: sourceServer.name,
@@ -7064,7 +7033,7 @@ __name(parseFilterQuery, "parseFilterQuery");
7064
7033
 
7065
7034
  // src/games/sdvx/commands/vf.ts
7066
7035
  function vf(ctx, config, logger6) {
7067
- ctx.command("vf").userFields(["defaultCardId", "defaultServerId", "id"]).channelFields(["defaultServerId", "id"]).option("lossless", "-l").option("card", "-c").option("server", "-s").option("filter", "-f <query:text>").action(async ({ session, options }) => {
7036
+ ctx.command("vf").userFields(["id"]).channelFields(["id"]).option("lossless", "-l").option("card", "-c").option("server", "-s").option("filter", "-f <query:text>").action(async ({ session, options }) => {
7068
7037
  const atGuild = session.guildId != null;
7069
7038
  const cardService = new CardService(ctx);
7070
7039
  const serverService = new ServerService(ctx);
@@ -7181,7 +7150,7 @@ function vf(ctx, config, logger6) {
7181
7150
  }
7182
7151
  } catch (error) {
7183
7152
  logger6.warn(error);
7184
- return session.text(".error");
7153
+ return session.text(".error", { card: card2.name, server: server2.name });
7185
7154
  }
7186
7155
  return;
7187
7156
  });
@@ -7237,10 +7206,10 @@ function apply12(ctx) {
7237
7206
  __name(apply12, "apply");
7238
7207
 
7239
7208
  // src/games/sdvx/locales/en-US.yml
7240
- var en_US_default4 = { _config: { $desc: "SDVX Module Settings", sdvx_data_url: "<p>The URL of the SDVX data service</p>", sdvx_search_url: "<p>The URL of the SDVX search service</p>", official_support_url: "<p>The URL of the SDVX official support service</p>" }, commands: { vf: { description: "Show Noah help information", messages: { "card-not-found": "<p>You haven't bound a card yet, go bind a card first~</p>", "server-not-found": "<p>No available servers, add one yourself~</p>", "no-scores-found": "<p>No scores found, please check your data.</p>", error: "<p>An error occurred(っ °Д °;)っ</p>", drawing: "<p>Noah is drawing {name} [{difstr}], please wait patiently~</p>", "menu-select": "<p>Please select the card you want to use:</p>\n{card_list}\n<p>q. Exit</p>", "server-menu-select": "<p>Please select the server you want to use:</p>\n{server_list}\n<p>q. Exit</p>", "invalid-select": "<p>No such option!</p>", quit: "<p>Exited~</p>" } }, sdvx: { recent: { description: "Show recent scores", messages: { "menu-select": "<p>Please select the card you want to use:</p>\n{card_list}\n<p>q. Exit</p>", "server-menu-select": "<p>Please select the server you want to use:</p>\n{server_list}\n<p>q. Exit</p>", "invalid-select": "<p>No such option!</p>", "card-not-found": "<p>You haven't bound a card yet, go bind a card first~</p>", "server-not-found": "<p>No available servers, add one yourself~</p>", "no-scores-found": "<p>No scores found, please check your data.</p>", error: "<p>An error occurred(っ °Д °;)っ</p>", drawing: "<p>Noah is drawing, please wait patiently~</p>", quit: "<p>Exited~</p>" } }, chart: { description: "Show SDVX chart", messages: { prompt: "<p>Which song's chart would you like to view?</p>", error: "<p>An error occurred(っ °Д °;)っ</p>", drawing: "<p>Noah is drawing, please wait patiently~</p>", "no-result": "<p>Aww, Noah couldn’t find that song~ try another keyword, okay?</p>" } }, calculate: { description: "Calculate volforce value or score", messages: { "invalid-query": "<p>Invalid query parameters, please check your input~</p>", "no-results": "<p>No results found~</p>", "too-many-results": "<p>Too many results! Found {0} results, please narrow down your query (current limit: 500 results)</p>", drawing: "<p>Noah is drawing, please wait patiently~</p>", error: "<p>An error occurred(っ °Д °;)っ</p>" } }, radar: { description: "Show player radar stats", messages: { "card-not-found": "<p>You haven't bound a card yet, go bind a card first~</p>", "server-not-found": "<p>No available servers, add one yourself~</p>", "no-scores-found": "<p>No scores found, please check your data.</p>", error: "<p>An error occurred(っ °Д °;)っ</p>", "menu-select": "<p>Please select the card you want to use:</p>\n{card_list}\n<p>q. Exit</p>", "server-menu-select": "<p>Please select the server you want to use:</p>\n{server_list}\n<p>q. Exit</p>", "invalid-select": "<p>No such option!</p>", quit: "<p>Exited~</p>", result: "<p>{name}'s Radar</p>\n<p>NOTES: {notes}</p>\n<p>PEAK: {peak}</p>\n<p>TSUMAMI: {tsumami}</p>\n<p>TRICKY: {tricky}</p>\n<p>HAND-TRIP: {hand_trip}</p>\n<p>ONE-HAND: {one_hand}</p>" } }, sync: { description: "Sync scores to Mao", messages: { "mao-not-found": "<p>Mao server not found. Please add a Mao server first, then try syncing again.</p>", "source-server-not-found": "<p>No available source servers. Please add a server first.</p>", "source-server-select": "<p>Please choose the source server:</p>\n{server_list}\n<p>q. Exit</p>", "card-not-found": "<p>You haven't bound any card yet. Please bind a card first.</p>", "source-card-select": "<p>Please choose the source card:</p>\n{card_list}\n<p>q. Exit</p>", "target-card-select": "<p>Please choose the target card (sync to Mao):</p>\n{card_list}\n<p>q. Exit</p>", "invalid-select": "<p>No such option!</p>", quit: "<p>Sync cancelled.</p>", "same-card-error": "<p>When the source server is Mao, the source card and target card cannot be the same. Please choose again.</p>", "dm-only": "<p>For security, please use this command in a private chat.</p>", "pin-prompt": "<p>Please enter the Mao PIN (4 digits):</p>\n<p>q. Exit</p>", "pin-invalid": "<p>Invalid PIN format. Please enter 4 digits.</p>", "pin-verify-failed": "<p>PIN verification failed: {message}</p>", "pin-verify-error": "<p>PIN verification error. Please try again later.</p>", "pin-too-many": "<p>Too many PIN attempts. Please try again later.</p>", "fetch-error": "<p>Failed to fetch scores from the source server. Please try again later.</p>", "no-scores": "<p>No scores available for sync.</p>", "confirm-sync": "<p>Found {score_count} scores. Start sync?</p>\n<p>Type y to confirm, any other key to cancel.</p>", "sync-error": "<p>Error occurred during sync(っ °Д °;)っ</p>", "sync-failed": "<p>Sync failed(っ °Д °;)っ</p>", "selected-summary": "<p>Sync completedヾ(≧▽≦*)o</p>\n<p>Source server: {source_server_name} ({source_server_type})</p>\n<p>Source card: {source_card_name}</p>\n<p>Target card: {target_card_name}</p>\n<p>Tracks synced: {score_count}</p>" } } } } };
7209
+ var en_US_default4 = { _config: { $desc: "SDVX Module Settings", sdvx_data_url: "<p>The URL of the SDVX data service</p>", sdvx_search_url: "<p>The URL of the SDVX search service</p>", official_support_url: "<p>The URL of the SDVX official support service</p>" }, commands: { vf: { description: "Show Noah help information", messages: { "card-not-found": "<p>You haven't bound a card yet, go bind a card first~</p>", "server-not-found": "<p>No available servers, add one yourself~</p>", "no-scores-found": "<p>No scores found, please check your data.</p>", error: "<p>An error occurred while using card: {card}, server: {server} (っ °Д °;)っ</p>", drawing: "<p>Noah is drawing {name} [{difstr}], please wait patiently~</p>", "menu-select": "<p>Please select the card you want to use:</p>\n{card_list}\n<p>q. Exit</p>", "server-menu-select": "<p>Please select the server you want to use:</p>\n{server_list}\n<p>q. Exit</p>", "invalid-select": "<p>No such option!</p>", quit: "<p>Exited~</p>" } }, sdvx: { recent: { description: "Show recent scores", messages: { "menu-select": "<p>Please select the card you want to use:</p>\n{card_list}\n<p>q. Exit</p>", "server-menu-select": "<p>Please select the server you want to use:</p>\n{server_list}\n<p>q. Exit</p>", "invalid-select": "<p>No such option!</p>", "card-not-found": "<p>You haven't bound a card yet, go bind a card first~</p>", "server-not-found": "<p>No available servers, add one yourself~</p>", "no-scores-found": "<p>No scores found, please check your data.</p>", error: "<p>An error occurred while using card: {card}, server: {server} (っ °Д °;)っ</p>", drawing: "<p>Noah is drawing, please wait patiently~</p>", quit: "<p>Exited~</p>" } }, chart: { description: "Show SDVX chart", messages: { prompt: "<p>Which song's chart would you like to view?</p>", error: "<p>An error occurred(っ °Д °;)っ</p>", drawing: "<p>Noah is drawing, please wait patiently~</p>", "no-result": "<p>Aww, Noah couldn’t find that song~ try another keyword, okay?</p>" } }, calculate: { description: "Calculate volforce value or score", messages: { "invalid-query": "<p>Invalid query parameters, please check your input~</p>", "no-results": "<p>No results found~</p>", "too-many-results": "<p>Too many results! Found {0} results, please narrow down your query (current limit: 500 results)</p>", drawing: "<p>Noah is drawing, please wait patiently~</p>", error: "<p>An error occurred(っ °Д °;)っ</p>" } }, radar: { description: "Show player radar stats", messages: { "card-not-found": "<p>You haven't bound a card yet, go bind a card first~</p>", "server-not-found": "<p>No available servers, add one yourself~</p>", "no-scores-found": "<p>No scores found, please check your data.</p>", error: "<p>An error occurred while using card: {card}, server: {server} (っ °Д °;)っ</p>", "menu-select": "<p>Please select the card you want to use:</p>\n{card_list}\n<p>q. Exit</p>", "server-menu-select": "<p>Please select the server you want to use:</p>\n{server_list}\n<p>q. Exit</p>", "invalid-select": "<p>No such option!</p>", quit: "<p>Exited~</p>", result: "<p>{name}'s Radar</p>\n<p>NOTES: {notes}</p>\n<p>PEAK: {peak}</p>\n<p>TSUMAMI: {tsumami}</p>\n<p>TRICKY: {tricky}</p>\n<p>HAND-TRIP: {hand_trip}</p>\n<p>ONE-HAND: {one_hand}</p>" } }, sync: { description: "Sync scores to Mao", messages: { "mao-not-found": "<p>Mao server not found. Please add a Mao server first, then try syncing again.</p>", "source-server-not-found": "<p>No available source servers. Please add a server first.</p>", "source-server-select": "<p>Please choose the source server:</p>\n{server_list}\n<p>q. Exit</p>", "card-not-found": "<p>You haven't bound any card yet. Please bind a card first.</p>", "source-card-select": "<p>Please choose the source card:</p>\n{card_list}\n<p>q. Exit</p>", "target-card-select": "<p>Please choose the target card (sync to Mao):</p>\n{card_list}\n<p>q. Exit</p>", "invalid-select": "<p>No such option!</p>", quit: "<p>Sync cancelled.</p>", "same-card-error": "<p>When the source server is Mao, the source card and target card cannot be the same. Please choose again.</p>", "dm-only": "<p>For security, please use this command in a private chat.</p>", "pin-prompt": "<p>Please enter the Mao PIN (4 digits):</p>\n<p>q. Exit</p>", "pin-invalid": "<p>Invalid PIN format. Please enter 4 digits.</p>", "pin-verify-failed": "<p>PIN verification failed: {message}</p>", "pin-verify-error": "<p>PIN verification error. Please try again later.</p>", "pin-too-many": "<p>Too many PIN attempts. Please try again later.</p>", "fetch-error": "<p>An error occurred while using card: {card}, server: {server} (っ °Д °;)っ</p>", "no-scores": "<p>No scores available for sync.</p>", "confirm-sync": "<p>Found {score_count} scores. Start sync?</p>\n<p>Type y to confirm, any other key to cancel.</p>", "sync-error": "<p>An error occurred while using card: {card}, server: {server} (っ °Д °;)っ</p>", "sync-failed": "<p>Sync failed(っ °Д °;)っ</p>", "selected-summary": "<p>Sync completedヾ(≧▽≦*)o</p>\n<p>Source server: {source_server_name} ({source_server_type})</p>\n<p>Source card: {source_card_name}</p>\n<p>Target card: {target_card_name}</p>\n<p>Tracks synced: {score_count}</p>" } } } } };
7241
7210
 
7242
7211
  // src/games/sdvx/locales/zh-CN.yml
7243
- var zh_CN_default4 = { _config: { $desc: "SDVX 模块设置", sdvx_data_url: "<p>SDVX 数据服务的 URL</p>", sdvx_search_url: "<p>SDVX 搜索服务的 URL</p>", official_support_url: "<p>SDVX 官方支持服务的 URL</p>" }, commands: { vf: { description: "查询 SDVX VOLFORCE", messages: { "card-not-found": "<p>你还没绑卡,去绑个卡再来吧~</p>", "server-not-found": "<p>没有可用的服务器哦,自己添加一个吧~</p>", "no-scores-found": "<p>没有找到你的分数数据哦~</p>", error: "<p>Noah 遇到了错误(っ °Д °;)っ</p>", drawing: "<p>Noah 正在画啦,请耐心等待~</p>", "menu-select": "<p>请选择你要使用的卡片:</p>\n{card_list}\n<p>q. 退出</p>", "server-menu-select": "<p>请选择你要使用的服务器:</p>\n{server_list}\n<p>q. 退出</p>", "invalid-select": "<p>没有该选项!</p>", quit: "<p>已退出~</p>" } }, sdvx: { recent: { description: "查询最近分数", messages: { "menu-select": "<p>请选择你要使用的卡片:</p>\n{card_list}\n<p>q. 退出</p>", "server-menu-select": "<p>请选择你要使用的服务器:</p>\n{server_list}\n<p>q. 退出</p>", "invalid-select": "<p>没有该选项!</p>", "card-not-found": "<p>你还没绑卡,去绑个卡再来吧~</p>", "server-not-found": "<p>没有可用的服务器哦,自己添加一个吧~</p>", "no-scores-found": "<p>没有找到你的分数数据哦~</p>", error: "<p>Noah 遇到了错误(っ °Д °;)っ</p>", drawing: "<p>Noah 正在画啦,请耐心等待~</p>", quit: "<p>已退出~</p>" } }, chart: { description: "查询 SDVX 谱面", messages: { prompt: "<p>要查哪首歌的铺面呢?</p>", error: "<p>Noah 遇到了错误(っ °Д °;)っ</p>", drawing: "<p>Noah 正在绘制 {name} [{difstr}],请耐心等待~</p>", "no-result": "<p>Noah 没有找到这首歌,换个关键词试试吧~</p>" } }, calculate: { description: "计算 volforce 值或分数", messages: { "invalid-query": "<p>查询参数无效,请检查你的输入~</p>", "no-results": "<p>没有找到符合条件的结果~</p>", "too-many-results": "<p>结果太多啦!共找到 {0} 条结果,请缩小查询范围(当前限制:500 条)</p>", drawing: "<p>Noah 正在画啦,请耐心等待~</p>", error: "<p>Noah 遇到了错误(っ °Д °;)っ</p>" } }, radar: { description: "查询玩家六维雷达", messages: { "card-not-found": "<p>你还没绑卡,去绑个卡再来吧~</p>", "server-not-found": "<p>没有可用的服务器哦,自己添加一个吧~</p>", "no-scores-found": "<p>没有找到你的分数数据哦~</p>", error: "<p>Noah 遇到了错误(っ °Д °;)っ</p>", "menu-select": "<p>请选择你要使用的卡片:</p>\n{card_list}\n<p>q. 退出</p>", "server-menu-select": "<p>请选择你要使用的服务器:</p>\n{server_list}\n<p>q. 退出</p>", "invalid-select": "<p>没有该选项!</p>", quit: "<p>已退出~</p>", result: "<p>{name} 的雷达</p>\n<p>NOTES: {notes}</p>\n<p>PEAK: {peak}</p>\n<p>TSUMAMI: {tsumami}</p>\n<p>TRICKY: {tricky}</p>\n<p>HAND-TRIP: {hand_trip}</p>\n<p>ONE-HAND: {one_hand}</p>" } }, sync: { description: "同步成绩到猫网", messages: { "mao-not-found": "<p>没有找到猫网服务器,请先添加猫网服务器后再尝试同步。</p>", "source-server-not-found": "<p>没有可作为来源的服务器,请先添加服务器。</p>", "source-server-select": "<p>请选择来源服务器:</p>\n{server_list}\n<p>q. 退出</p>", "card-not-found": "<p>你还没有绑定任何卡片哦~</p>", "source-card-select": "<p>请选择来源卡片:</p>\n{card_list}\n<p>q. 退出</p>", "target-card-select": "<p>请选择目标卡片(同步到猫网):</p>\n{card_list}\n<p>q. 退出</p>", "invalid-select": "<p>没有该选项!</p>", quit: "<p>已退出同步。</p>", "same-card-error": "<p>来源服务器为猫网时,来源卡片和目标卡片不能相同,请重新选择。</p>", "dm-only": "<p>出于安全考虑,请在私聊中使用该指令。</p>", "pin-prompt": "<p>请输入猫网 PIN 码(4 位数字):</p>\n<p>q. 退出</p>", "pin-invalid": "<p>PIN 码格式不正确,请输入 4 位数字。</p>", "pin-verify-failed": "<p>PIN 验证失败:{message}</p>", "pin-verify-error": "<p>PIN 验证时出现错误,请稍后重试。</p>", "pin-too-many": "<p>PIN 验证次数过多,请稍后再试。</p>", "fetch-error": "<p>获取来源服务器成绩失败,请稍后再试。</p>", "no-scores": "<p>没有可同步的成绩。</p>", "confirm-sync": "<p>共找到 {score_count} 条成绩,是否开始同步?</p>\n<p>输入 y 确认,其他任意键取消。</p>", "sync-error": "<p>同步过程中出现了错误(っ °Д °;)っ</p>", "sync-failed": "<p>同步失败(っ °Д °;)っ</p>", "selected-summary": "<p>同步完成ヾ(≧▽≦*)o</p>\n<p>来源服务器:{source_server_name} ({source_server_type})</p>\n<p>来源卡片:{source_card_name}</p>\n<p>目标卡片:{target_card_name}</p>\n<p>同步曲目数量:{score_count}</p>" } } } } };
7212
+ var zh_CN_default4 = { _config: { $desc: "SDVX 模块设置", sdvx_data_url: "<p>SDVX 数据服务的 URL</p>", sdvx_search_url: "<p>SDVX 搜索服务的 URL</p>", official_support_url: "<p>SDVX 官方支持服务的 URL</p>" }, commands: { vf: { description: "查询 SDVX VOLFORCE", messages: { "card-not-found": "<p>你还没绑卡,去绑个卡再来吧~</p>", "server-not-found": "<p>没有可用的服务器哦,自己添加一个吧~</p>", "no-scores-found": "<p>没有找到你的分数数据哦~</p>", error: "<p>Noah 在使用卡片:{card},服务器:{server} 时遇到了错误(っ °Д °;)っ</p>", drawing: "<p>Noah 正在画啦,请耐心等待~</p>", "menu-select": "<p>请选择你要使用的卡片:</p>\n{card_list}\n<p>q. 退出</p>", "server-menu-select": "<p>请选择你要使用的服务器:</p>\n{server_list}\n<p>q. 退出</p>", "invalid-select": "<p>没有该选项!</p>", quit: "<p>已退出~</p>" } }, sdvx: { recent: { description: "查询最近分数", messages: { "menu-select": "<p>请选择你要使用的卡片:</p>\n{card_list}\n<p>q. 退出</p>", "server-menu-select": "<p>请选择你要使用的服务器:</p>\n{server_list}\n<p>q. 退出</p>", "invalid-select": "<p>没有该选项!</p>", "card-not-found": "<p>你还没绑卡,去绑个卡再来吧~</p>", "server-not-found": "<p>没有可用的服务器哦,自己添加一个吧~</p>", "no-scores-found": "<p>没有找到你的分数数据哦~</p>", error: "<p>Noah 在使用卡片:{card},服务器:{server} 时遇到了错误(っ °Д °;)っ</p>", drawing: "<p>Noah 正在画啦,请耐心等待~</p>", quit: "<p>已退出~</p>" } }, chart: { description: "查询 SDVX 谱面", messages: { prompt: "<p>要查哪首歌的铺面呢?</p>", error: "<p>Noah 遇到了错误(っ °Д °;)っ</p>", drawing: "<p>Noah 正在绘制 {name} [{difstr}],请耐心等待~</p>", "no-result": "<p>Noah 没有找到这首歌,换个关键词试试吧~</p>" } }, calculate: { description: "计算 volforce 值或分数", messages: { "invalid-query": "<p>查询参数无效,请检查你的输入~</p>", "no-results": "<p>没有找到符合条件的结果~</p>", "too-many-results": "<p>结果太多啦!共找到 {0} 条结果,请缩小查询范围(当前限制:500 条)</p>", drawing: "<p>Noah 正在画啦,请耐心等待~</p>", error: "<p>Noah 遇到了错误(っ °Д °;)っ</p>" } }, radar: { description: "查询玩家六维雷达", messages: { "card-not-found": "<p>你还没绑卡,去绑个卡再来吧~</p>", "server-not-found": "<p>没有可用的服务器哦,自己添加一个吧~</p>", "no-scores-found": "<p>没有找到你的分数数据哦~</p>", error: "<p>Noah 在使用卡片:{card},服务器:{server} 时遇到了错误(っ °Д °;)っ</p>", "menu-select": "<p>请选择你要使用的卡片:</p>\n{card_list}\n<p>q. 退出</p>", "server-menu-select": "<p>请选择你要使用的服务器:</p>\n{server_list}\n<p>q. 退出</p>", "invalid-select": "<p>没有该选项!</p>", quit: "<p>已退出~</p>", result: "<p>{name} 的雷达</p>\n<p>NOTES: {notes}</p>\n<p>PEAK: {peak}</p>\n<p>TSUMAMI: {tsumami}</p>\n<p>TRICKY: {tricky}</p>\n<p>HAND-TRIP: {hand_trip}</p>\n<p>ONE-HAND: {one_hand}</p>" } }, sync: { description: "同步成绩到猫网", messages: { "mao-not-found": "<p>没有找到猫网服务器,请先添加猫网服务器后再尝试同步。</p>", "source-server-not-found": "<p>没有可作为来源的服务器,请先添加服务器。</p>", "source-server-select": "<p>请选择来源服务器:</p>\n{server_list}\n<p>q. 退出</p>", "card-not-found": "<p>你还没有绑定任何卡片哦~</p>", "source-card-select": "<p>请选择来源卡片:</p>\n{card_list}\n<p>q. 退出</p>", "target-card-select": "<p>请选择目标卡片(同步到猫网):</p>\n{card_list}\n<p>q. 退出</p>", "invalid-select": "<p>没有该选项!</p>", quit: "<p>已退出同步。</p>", "same-card-error": "<p>来源服务器为猫网时,来源卡片和目标卡片不能相同,请重新选择。</p>", "dm-only": "<p>出于安全考虑,请在私聊中使用该指令。</p>", "pin-prompt": "<p>请输入猫网 PIN 码(4 位数字):</p>\n<p>q. 退出</p>", "pin-invalid": "<p>PIN 码格式不正确,请输入 4 位数字。</p>", "pin-verify-failed": "<p>PIN 验证失败:{message}</p>", "pin-verify-error": "<p>PIN 验证时出现错误,请稍后重试。</p>", "pin-too-many": "<p>PIN 验证次数过多,请稍后再试。</p>", "fetch-error": "<p>Noah 在使用卡片:{card},服务器:{server} 时遇到了错误(っ °Д °;)っ</p>", "no-scores": "<p>没有可同步的成绩。</p>", "confirm-sync": "<p>共找到 {score_count} 条成绩,是否开始同步?</p>\n<p>输入 y 确认,其他任意键取消。</p>", "sync-error": "<p>Noah 在使用卡片:{card},服务器:{server} 时遇到了错误(っ °Д °;)っ</p>", "sync-failed": "<p>同步失败(っ °Д °;)っ</p>", "selected-summary": "<p>同步完成ヾ(≧▽≦*)o</p>\n<p>来源服务器:{source_server_name} ({source_server_type})</p>\n<p>来源卡片:{source_card_name}</p>\n<p>目标卡片:{target_card_name}</p>\n<p>同步曲目数量:{score_count}</p>" } } } } };
7244
7213
 
7245
7214
  // src/games/sdvx/index.ts
7246
7215
  var name13 = "Noah-SDVX";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "koishi-plugin-noah",
3
- "version": "2.4.1",
3
+ "version": "2.4.2",
4
4
  "contributors": [
5
5
  "Logthm <logthm@outlook.com>"
6
6
  ],
@@ -24,9 +24,9 @@
24
24
  "dependencies": {
25
25
  "@koishijs/plugin-server": "^3.2.9",
26
26
  "adm-zip": "^0.5.17",
27
- "bwip-js": "^4.10.1",
27
+ "bwip-js": "^4.11.1",
28
28
  "javascript-barcode-reader": "^0.6.9",
29
- "koishi-plugin-adapter-onebot": "^6.9.3",
29
+ "koishi-plugin-adapter-onebot": "^6.9.4",
30
30
  "sharp": "^0.33.5",
31
31
  "xml2js": "^0.6.2"
32
32
  },
@@ -56,11 +56,11 @@
56
56
  "eslint": "^9.39.4",
57
57
  "eslint-config-prettier": "^10.1.8",
58
58
  "eslint-import-resolver-typescript": "^3.10.1",
59
- "eslint-plugin-prettier": "^5.5.5",
59
+ "eslint-plugin-prettier": "^5.5.6",
60
60
  "husky": "^9.1.7",
61
61
  "koishi": "^4.18.11",
62
62
  "lint-staged": "^16.4.0",
63
- "prettier": "^3.8.3",
63
+ "prettier": "^3.9.4",
64
64
  "yml-register": "^1.2.5"
65
65
  },
66
66
  "scripts": {