koishi-plugin-noah 2.0.6 → 2.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.
@@ -1,10 +1,5 @@
1
- import { SDVXClearType, SDVXGrade } from '../../games/sdvx/types';
2
- /**
3
- * 根据分数获取SDVX游戏的等级评价
4
- * @param score - 游戏分数
5
- * @returns SDVX等级评价 (S, AAA+, AAA, AA+, AA, A+, A, B, C, D)
6
- */
7
- export declare function getSDVXGrade(score: number): SDVXGrade;
1
+ import { SDVXClearType } from '../../games/sdvx/types';
2
+ export { getGradeByScore as getSDVXGrade } from '../../games/sdvx/constants';
8
3
  /**
9
4
  * 根据通关类型编号获取SDVX通关类型名称
10
5
  * @param clearType - 通关类型编号
@@ -1,20 +1,15 @@
1
- import { Context } from 'koishi';
1
+ import type { DiscordBot } from '@koishijs/plugin-adapter-discord';
2
2
  export declare class DiscordAdapter {
3
- private readonly ctx;
3
+ private readonly internal;
4
4
  private readonly appId;
5
- private readonly token;
6
- private readonly baseURL;
7
- constructor(ctx: Context, appId: string, token: string);
8
- private headers;
9
- listGuild(guildId: string): Promise<import("koishi").HTTP.Response<any>>;
10
- listGlobal(): Promise<import("koishi").HTTP.Response<any>>;
11
- createGlobal(payload: any): Promise<import("koishi").HTTP.Response<any>>;
12
- updateGlobal(commandId: string, payload: any): Promise<import("koishi").HTTP.Response<any>>;
5
+ constructor(bot: DiscordBot);
6
+ listGuild(guildId: string): Promise<import("@satorijs/adapter-discord/lib/types").ApplicationCommand[]>;
7
+ listGlobal(): Promise<import("@satorijs/adapter-discord/lib/types").ApplicationCommand[]>;
8
+ createGlobal(payload: any): Promise<import("@satorijs/adapter-discord/lib/types").ApplicationCommand>;
9
+ updateGlobal(commandId: string, payload: any): Promise<import("@satorijs/adapter-discord/lib/types").ApplicationCommand>;
13
10
  deleteGlobal(commandId: string): Promise<any>;
14
- createGuild(guildId: string, payload: any): Promise<import("koishi").HTTP.Response<any>>;
15
- updateGuild(guildId: string, commandId: string, payload: any): Promise<import("koishi").HTTP.Response<any>>;
11
+ createGuild(guildId: string, payload: any): Promise<import("@satorijs/adapter-discord/lib/types").ApplicationCommand>;
12
+ updateGuild(guildId: string, commandId: string, payload: any): Promise<import("@satorijs/adapter-discord/lib/types").ApplicationCommand>;
16
13
  deleteGuild(guildId: string, commandId: string): Promise<any>;
17
- bulkOverwriteGuild(guildId: string, payloads: any[]): Promise<import("koishi").HTTP.Response<any>>;
18
- private request;
19
- private makeError;
14
+ bulkOverwriteGuild(guildId: string, payloads: any[]): Promise<any>;
20
15
  }
@@ -4,12 +4,18 @@ export declare class DiscordSlashService {
4
4
  private readonly ctx;
5
5
  private readonly config;
6
6
  private readonly logger;
7
- private readonly slashService;
7
+ private slashService;
8
+ private bot;
8
9
  private readonly stopRegistryListener;
9
10
  private readonly ready;
10
11
  constructor(ctx: Context, config: SlashConfig, logger: Logger);
12
+ private init;
13
+ private waitForDiscordBot;
11
14
  private seedDeclarations;
12
15
  private handleNewDeclaration;
16
+ private buildCommandEntries;
17
+ private patchBotCommands;
18
+ private setupInteractionHandler;
13
19
  private setupAutoSync;
14
20
  private registerCli;
15
21
  private resolveTargets;
@@ -43,6 +43,7 @@ export declare class PersistentDiscordSlashCommandService {
43
43
  private acquireLock;
44
44
  private releaseLock;
45
45
  releaseAllLocks(): Promise<void>;
46
+ clearAllLocks(): Promise<void>;
46
47
  private logSync;
47
48
  private retryWrapper;
48
49
  private parseRetryAfter;
@@ -10,10 +10,6 @@ export interface BaseConfig {
10
10
  * 包含 Slash 相关的配置项
11
11
  */
12
12
  export interface SlashConfig extends BaseConfig {
13
- /** Discord Token */
14
- discord_token: string;
15
- /** Discord Application ID */
16
- discord_application_id: string;
17
13
  /** Default guild ids to sync when commands run */
18
14
  test_guilds?: string[];
19
15
  /** Whether to automatically sync after the bot connects */
@@ -30,6 +26,8 @@ export interface CoreConfig extends BaseConfig {
30
26
  guildNameCards?: string[];
31
27
  /** 猫网服务器 URL */
32
28
  maoServerUrl?: string;
29
+ /** 猫网服务器 API Key */
30
+ maoApiKey?: string;
33
31
  /** Official Support URL */
34
32
  official_support_url?: string;
35
33
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "koishi-plugin-noah",
3
- "version": "2.0.6",
3
+ "version": "2.1.3",
4
4
  "contributors": [
5
5
  "Logthm <logthm@outlook.com>"
6
6
  ],