koishi-plugin-noah 2.0.6 → 2.2.0
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/core/commands/link.d.ts +3 -0
- package/lib/drawer/sdvx/index.d.ts +8 -0
- package/lib/games/sdvx/commands/radar.d.ts +3 -0
- package/lib/games/sdvx/constants.d.ts +15 -0
- package/lib/games/sdvx/services/score-service.d.ts +17 -1
- package/lib/games/sdvx/utils/calculator.d.ts +3 -15
- package/lib/global/config.d.ts +16 -0
- package/lib/index.cjs +1110 -1854
- package/lib/servers/index.d.ts +1 -0
- package/lib/servers/utils/grade.d.ts +2 -7
- package/lib/slash/discord/adapter.d.ts +10 -15
- package/lib/slash/discord/index.d.ts +7 -1
- package/lib/slash/service.d.ts +1 -0
- package/lib/types/config.d.ts +14 -10
- package/package.json +1 -1
package/lib/servers/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { Context } from 'koishi';
|
|
|
2
2
|
import { TServer, TGame } from '../types';
|
|
3
3
|
import type { AppConfig } from '../types/config';
|
|
4
4
|
export declare const name = "Noah-Server";
|
|
5
|
+
export declare const inject: string[];
|
|
5
6
|
export declare class ServerManager {
|
|
6
7
|
private static instance;
|
|
7
8
|
private factory;
|
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
import { SDVXClearType
|
|
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 {
|
|
1
|
+
import type { DiscordBot } from '@koishijs/plugin-adapter-discord';
|
|
2
2
|
export declare class DiscordAdapter {
|
|
3
|
-
private readonly
|
|
3
|
+
private readonly internal;
|
|
4
4
|
private readonly appId;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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("
|
|
15
|
-
updateGuild(guildId: string, commandId: string, payload: any): Promise<import("
|
|
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<
|
|
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
|
|
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;
|
package/lib/slash/service.d.ts
CHANGED
package/lib/types/config.d.ts
CHANGED
|
@@ -5,15 +5,23 @@ import { MessageReply } from '../fun/poke/types';
|
|
|
5
5
|
*/
|
|
6
6
|
export interface BaseConfig {
|
|
7
7
|
}
|
|
8
|
+
/**
|
|
9
|
+
* 全局配置接口
|
|
10
|
+
* 包含所有模块共享的配置项
|
|
11
|
+
*/
|
|
12
|
+
export interface GlobalConfig extends BaseConfig {
|
|
13
|
+
/** Official Support URL */
|
|
14
|
+
official_support_url?: string;
|
|
15
|
+
/** 猫网服务器 URL */
|
|
16
|
+
maoServerUrl?: string;
|
|
17
|
+
/** 猫网服务器 API Key */
|
|
18
|
+
maoApiKey?: string;
|
|
19
|
+
}
|
|
8
20
|
/**
|
|
9
21
|
* Slash 配置接口
|
|
10
22
|
* 包含 Slash 相关的配置项
|
|
11
23
|
*/
|
|
12
24
|
export interface SlashConfig extends BaseConfig {
|
|
13
|
-
/** Discord Token */
|
|
14
|
-
discord_token: string;
|
|
15
|
-
/** Discord Application ID */
|
|
16
|
-
discord_application_id: string;
|
|
17
25
|
/** Default guild ids to sync when commands run */
|
|
18
26
|
test_guilds?: string[];
|
|
19
27
|
/** Whether to automatically sync after the bot connects */
|
|
@@ -28,10 +36,6 @@ export interface CoreConfig extends BaseConfig {
|
|
|
28
36
|
adminUsers?: string[];
|
|
29
37
|
/** 群名片列表 */
|
|
30
38
|
guildNameCards?: string[];
|
|
31
|
-
/** 猫网服务器 URL */
|
|
32
|
-
maoServerUrl?: string;
|
|
33
|
-
/** Official Support URL */
|
|
34
|
-
official_support_url?: string;
|
|
35
39
|
}
|
|
36
40
|
/**
|
|
37
41
|
* SDVX 游戏配置接口
|
|
@@ -44,8 +48,6 @@ export interface SDVXConfig extends BaseConfig {
|
|
|
44
48
|
sdvx_data_url: string;
|
|
45
49
|
/** SDVX 搜索 URL */
|
|
46
50
|
sdvx_search_url: string;
|
|
47
|
-
/** Official Support URL */
|
|
48
|
-
official_support_url: string;
|
|
49
51
|
}
|
|
50
52
|
/**
|
|
51
53
|
* 戳一戳功能配置接口
|
|
@@ -82,6 +84,8 @@ export interface AssetConfig extends BaseConfig {
|
|
|
82
84
|
* 包含所有模块的配置项
|
|
83
85
|
*/
|
|
84
86
|
export interface AppConfig {
|
|
87
|
+
/** 全局配置 */
|
|
88
|
+
global: GlobalConfig;
|
|
85
89
|
/** 核心配置 */
|
|
86
90
|
core: CoreConfig;
|
|
87
91
|
/** SDVX 游戏配置 */
|