koishi-plugin-noah 2.3.1 → 2.3.4
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.
|
@@ -11,6 +11,7 @@ export declare class MaoSDVXService implements ISDVXService {
|
|
|
11
11
|
getUserName(ctx: Context, url: string, cardId: string): Promise<string>;
|
|
12
12
|
verifyPin(ctx: Context, url: string, cardId: string, pin: string): Promise<boolean>;
|
|
13
13
|
private clearTypeToNum;
|
|
14
|
+
private gradeToNum;
|
|
14
15
|
private diffNameToMusicType;
|
|
15
16
|
uploadScore(ctx: Context, url: string, cardId: string, scores: SDVXScore[]): Promise<boolean>;
|
|
16
17
|
getAllScore(ctx: Context, url: string, cardId: string, config: SDVXConfig): Promise<SDVXScore[]>;
|
|
@@ -14,7 +14,7 @@ export declare function getDiffName(diffStr: string, infVer: string | number): s
|
|
|
14
14
|
export declare function getDiffFullName(diffStr: string, infVer: string | number): string;
|
|
15
15
|
/**
|
|
16
16
|
* 根据难度缩写名称获取难度字符串和 infVer
|
|
17
|
-
* @param diffAbbr - 难度缩写名称 (例如: "NOV", "ADV", "EXH", "INF", "GRV", "HVN", "VVD", "XCD", "MXM")
|
|
17
|
+
* @param diffAbbr - 难度缩写名称 (例如: "NOV", "ADV", "EXH", "INF", "GRV", "HVN", "VVD", "XCD", "NBL", "MXM")
|
|
18
18
|
* @returns 包含难度字符串和 infVer 的对象,如果是非 infinite 难度则 infVer 为 null
|
|
19
19
|
*/
|
|
20
20
|
export declare function getDiffStringFromAbbr(diffAbbr: string): {
|
package/lib/index.cjs
CHANGED
|
@@ -2927,7 +2927,7 @@ var SDVXDrawer = class extends BaseDrawer {
|
|
|
2927
2927
|
const { loadImage } = this.ctx.skia;
|
|
2928
2928
|
const grades = ["D", "C", "B", "A", "A+", "AA", "AA+", "AAA", "AAA+", "S"];
|
|
2929
2929
|
const circles = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
|
|
2930
|
-
const diffs = ["NOV", "ADV", "EXH", "INF", "MXM", "GRV", "HVN", "VVD", "XCD", "ULT"];
|
|
2930
|
+
const diffs = ["NOV", "ADV", "EXH", "INF", "MXM", "GRV", "HVN", "VVD", "XCD", "NBL", "ULT"];
|
|
2931
2931
|
const clears = ["PUC", "SPUC", "UC", "MC", "HC", "NC", "PLAYED", "NOPLAY"];
|
|
2932
2932
|
const [gradeImages, circleImages, difficultyBadges, clearTypeBadges] = await Promise.all([
|
|
2933
2933
|
this.loadImageMap(loadImage, grades, (g) => `sdvx/vf/grade/${g}.png`),
|
|
@@ -4772,6 +4772,32 @@ var MaoSDVXService = class _MaoSDVXService {
|
|
|
4772
4772
|
return 0;
|
|
4773
4773
|
}
|
|
4774
4774
|
}
|
|
4775
|
+
gradeToNum(grade) {
|
|
4776
|
+
switch (grade) {
|
|
4777
|
+
case "S":
|
|
4778
|
+
return 10;
|
|
4779
|
+
case "AAA+":
|
|
4780
|
+
return 9;
|
|
4781
|
+
case "AAA":
|
|
4782
|
+
return 8;
|
|
4783
|
+
case "AA+":
|
|
4784
|
+
return 7;
|
|
4785
|
+
case "AA":
|
|
4786
|
+
return 6;
|
|
4787
|
+
case "A+":
|
|
4788
|
+
return 5;
|
|
4789
|
+
case "A":
|
|
4790
|
+
return 4;
|
|
4791
|
+
case "B":
|
|
4792
|
+
return 3;
|
|
4793
|
+
case "C":
|
|
4794
|
+
return 2;
|
|
4795
|
+
case "D":
|
|
4796
|
+
return 1;
|
|
4797
|
+
default:
|
|
4798
|
+
return 0;
|
|
4799
|
+
}
|
|
4800
|
+
}
|
|
4775
4801
|
diffNameToMusicType(diffName) {
|
|
4776
4802
|
switch (diffName.toUpperCase()) {
|
|
4777
4803
|
case "NOV":
|
|
@@ -4785,6 +4811,7 @@ var MaoSDVXService = class _MaoSDVXService {
|
|
|
4785
4811
|
case "HVN":
|
|
4786
4812
|
case "VVD":
|
|
4787
4813
|
case "XCD":
|
|
4814
|
+
case "NBL":
|
|
4788
4815
|
return 3;
|
|
4789
4816
|
case "MXM":
|
|
4790
4817
|
return 4;
|
|
@@ -4808,7 +4835,8 @@ var MaoSDVXService = class _MaoSDVXService {
|
|
|
4808
4835
|
music_type: this.diffNameToMusicType(s.music.music_diff_name),
|
|
4809
4836
|
score: s.music.score,
|
|
4810
4837
|
exscore: s.music.exscore,
|
|
4811
|
-
clear_type: this.clearTypeToNum(s.music.clear_type)
|
|
4838
|
+
clear_type: this.clearTypeToNum(s.music.clear_type),
|
|
4839
|
+
score_grade: this.gradeToNum(s.music.score_grade)
|
|
4812
4840
|
}));
|
|
4813
4841
|
if (payload.length === 0) return false;
|
|
4814
4842
|
const resp = await ctx.http.post(
|
|
@@ -5517,6 +5545,8 @@ function parseDiffAndTitle(rawTokens) {
|
|
|
5517
5545
|
vvd: "infinite",
|
|
5518
5546
|
exceed: "infinite",
|
|
5519
5547
|
xcd: "infinite",
|
|
5548
|
+
nabla: "infinite",
|
|
5549
|
+
nbl: "infinite",
|
|
5520
5550
|
maximum: "maximum",
|
|
5521
5551
|
mxm: "maximum"
|
|
5522
5552
|
};
|
package/package.json
CHANGED
|
@@ -1,82 +1,82 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
2
|
+
"name": "koishi-plugin-noah",
|
|
3
|
+
"version": "2.3.4",
|
|
4
|
+
"contributors": [
|
|
5
|
+
"Logthm <logthm@outlook.com>"
|
|
6
|
+
],
|
|
7
|
+
"homepage": "https://docs.logthm.cn/noah",
|
|
8
|
+
"type": "module",
|
|
9
|
+
"main": "lib/index.cjs",
|
|
10
|
+
"typings": "lib/index.d.ts",
|
|
11
|
+
"files": [
|
|
12
|
+
"lib",
|
|
13
|
+
"dist"
|
|
14
|
+
],
|
|
15
|
+
"license": "MIT",
|
|
16
|
+
"keywords": [
|
|
17
|
+
"chatbot",
|
|
18
|
+
"koishi",
|
|
19
|
+
"plugin"
|
|
20
|
+
],
|
|
21
|
+
"peerDependencies": {
|
|
22
|
+
"koishi": "^4.18.11"
|
|
23
|
+
},
|
|
24
|
+
"dependencies": {
|
|
25
|
+
"adm-zip": "^0.5.17",
|
|
26
|
+
"bwip-js": "^4.10.1",
|
|
27
|
+
"javascript-barcode-reader": "^0.6.9",
|
|
28
|
+
"koishi-plugin-adapter-onebot": "^6.9.3",
|
|
29
|
+
"sharp": "^0.33.5",
|
|
30
|
+
"xml2js": "^0.6.2"
|
|
31
|
+
},
|
|
32
|
+
"koishi": {
|
|
33
|
+
"description": {
|
|
34
|
+
"en": "A tool bot for arcade music games",
|
|
35
|
+
"zh": "街机音游工具机器人"
|
|
31
36
|
},
|
|
32
|
-
"
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
"service": {
|
|
38
|
-
"required": [
|
|
39
|
-
"database",
|
|
40
|
-
"skia"
|
|
41
|
-
]
|
|
42
|
-
},
|
|
43
|
-
"locales": [
|
|
44
|
-
"en",
|
|
45
|
-
"zh"
|
|
46
|
-
]
|
|
37
|
+
"service": {
|
|
38
|
+
"required": [
|
|
39
|
+
"database",
|
|
40
|
+
"skia"
|
|
41
|
+
]
|
|
47
42
|
},
|
|
48
|
-
"
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
"
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
"prettier --write"
|
|
77
|
-
],
|
|
78
|
-
"*.{css,md,json}": [
|
|
79
|
-
"prettier --write"
|
|
80
|
-
]
|
|
43
|
+
"locales": [
|
|
44
|
+
"en",
|
|
45
|
+
"zh"
|
|
46
|
+
]
|
|
47
|
+
},
|
|
48
|
+
"devDependencies": {
|
|
49
|
+
"@haixee/eslint-config": "^2.3.2",
|
|
50
|
+
"@koishijs/plugin-adapter-discord": "^4.6.0",
|
|
51
|
+
"@ltxhhz/koishi-plugin-skia-canvas": "^0.0.8",
|
|
52
|
+
"@types/adm-zip": "^0",
|
|
53
|
+
"@types/xml2js": "^0",
|
|
54
|
+
"eslint": "^9.39.4",
|
|
55
|
+
"eslint-config-prettier": "^10.1.8",
|
|
56
|
+
"eslint-import-resolver-typescript": "^3.10.1",
|
|
57
|
+
"eslint-plugin-prettier": "^5.5.5",
|
|
58
|
+
"husky": "^9.1.7",
|
|
59
|
+
"koishi": "^4.18.11",
|
|
60
|
+
"lint-staged": "^16.4.0",
|
|
61
|
+
"prettier": "^3.8.3",
|
|
62
|
+
"yml-register": "^1.2.5"
|
|
63
|
+
},
|
|
64
|
+
"scripts": {
|
|
65
|
+
"lint": "eslint --ext .js,.ts,.tsx src/",
|
|
66
|
+
"format": "prettier --write \"src/**/*.{js,ts,tsx,json,css,md}\""
|
|
67
|
+
},
|
|
68
|
+
"husky": {
|
|
69
|
+
"hooks": {
|
|
70
|
+
"pre-commit": "lint-staged"
|
|
81
71
|
}
|
|
72
|
+
},
|
|
73
|
+
"lint-staged": {
|
|
74
|
+
"*.{js,ts,tsx}": [
|
|
75
|
+
"eslint --fix",
|
|
76
|
+
"prettier --write"
|
|
77
|
+
],
|
|
78
|
+
"*.{css,md,json}": [
|
|
79
|
+
"prettier --write"
|
|
80
|
+
]
|
|
81
|
+
}
|
|
82
82
|
}
|