koishi-plugin-game-mini 0.2.6 → 0.2.8
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/index.d.ts +53 -6
- package/lib/index.js +647 -379
- package/package.json +1 -1
- package/readme.md +112 -79
package/lib/index.d.ts
CHANGED
|
@@ -1,14 +1,50 @@
|
|
|
1
1
|
import { Context, Schema } from 'koishi';
|
|
2
2
|
export declare const name = "game-mini";
|
|
3
|
-
export declare const using: readonly ["i18n"];
|
|
3
|
+
export declare const using: readonly ["i18n", "database"];
|
|
4
4
|
export declare const inject: readonly ["console"];
|
|
5
|
+
declare module 'koishi' {
|
|
6
|
+
interface Tables {
|
|
7
|
+
game_mini_player: GamePlayerData;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
interface GamePlayerData {
|
|
11
|
+
id: number;
|
|
12
|
+
guildId: string;
|
|
13
|
+
platform: string;
|
|
14
|
+
userId: string;
|
|
15
|
+
name: string;
|
|
16
|
+
score: number;
|
|
17
|
+
correctCount: number;
|
|
18
|
+
playCount: number;
|
|
19
|
+
lastGameTime: number;
|
|
20
|
+
}
|
|
5
21
|
export interface Config {
|
|
6
22
|
enableNumberGuess: boolean;
|
|
7
23
|
enableWzHero: boolean;
|
|
8
24
|
enableChengyuImage: boolean;
|
|
9
25
|
enableChengyuJielong: boolean;
|
|
10
26
|
enableCalc24: boolean;
|
|
11
|
-
|
|
27
|
+
privateGame: {
|
|
28
|
+
enableNumberGuess: boolean;
|
|
29
|
+
enableWzHero: boolean;
|
|
30
|
+
enableChengyuImage: boolean;
|
|
31
|
+
enableChengyuJielong: boolean;
|
|
32
|
+
enableCalc24: boolean;
|
|
33
|
+
};
|
|
34
|
+
rank: {
|
|
35
|
+
enableCommand: boolean;
|
|
36
|
+
maxDisplay: number;
|
|
37
|
+
clearDataPermission: number;
|
|
38
|
+
messages: {
|
|
39
|
+
title: string;
|
|
40
|
+
empty: string;
|
|
41
|
+
playerInfo: string;
|
|
42
|
+
totalStats: string;
|
|
43
|
+
noPermission: string;
|
|
44
|
+
clearSuccess: string;
|
|
45
|
+
showTotalStats: boolean;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
12
48
|
guessNumber: {
|
|
13
49
|
min: number;
|
|
14
50
|
max: number;
|
|
@@ -18,6 +54,9 @@ export interface Config {
|
|
|
18
54
|
autoPlayDelay: number;
|
|
19
55
|
autoPlayMaxCount: number;
|
|
20
56
|
autoStopInactiveTime: number;
|
|
57
|
+
enablePenalty: boolean;
|
|
58
|
+
penaltyScore: number;
|
|
59
|
+
rewardScore: number;
|
|
21
60
|
messages: {
|
|
22
61
|
usage: string;
|
|
23
62
|
start: string;
|
|
@@ -39,7 +78,9 @@ export interface Config {
|
|
|
39
78
|
showRank: boolean;
|
|
40
79
|
defaultDifficulty: '简单' | '中等' | '困难';
|
|
41
80
|
autoStopInactiveTime: number;
|
|
81
|
+
rewardScore: number;
|
|
42
82
|
messages: {
|
|
83
|
+
usage: string;
|
|
43
84
|
start: string;
|
|
44
85
|
startUsage: string;
|
|
45
86
|
stop: string;
|
|
@@ -61,7 +102,9 @@ export interface Config {
|
|
|
61
102
|
showRank: boolean;
|
|
62
103
|
defaultHintLevel: 1 | 2 | 3 | 4 | 5;
|
|
63
104
|
autoStopInactiveTime: number;
|
|
105
|
+
rewardScore: number;
|
|
64
106
|
messages: {
|
|
107
|
+
usage: string;
|
|
65
108
|
start: string;
|
|
66
109
|
stop: string;
|
|
67
110
|
submitUsage: string;
|
|
@@ -81,13 +124,16 @@ export interface Config {
|
|
|
81
124
|
};
|
|
82
125
|
};
|
|
83
126
|
chengyuJielong: {
|
|
84
|
-
botParticipateInGroup: boolean;
|
|
85
127
|
totalRounds: number;
|
|
86
128
|
showRank: boolean;
|
|
87
129
|
autoPlayDelay: number;
|
|
88
130
|
autoPlayMaxCount: number;
|
|
89
131
|
autoStopInactiveTime: number;
|
|
132
|
+
maxRounds: number;
|
|
133
|
+
botParticipate: boolean;
|
|
134
|
+
rewardScore: number;
|
|
90
135
|
messages: {
|
|
136
|
+
usage: string;
|
|
91
137
|
start: string;
|
|
92
138
|
stop: string;
|
|
93
139
|
notStarted: string;
|
|
@@ -96,7 +142,6 @@ export interface Config {
|
|
|
96
142
|
botTurn: string;
|
|
97
143
|
botWin: string;
|
|
98
144
|
autoPlayTooMany: string;
|
|
99
|
-
gameInactiveStop: string;
|
|
100
145
|
notIdiom: string;
|
|
101
146
|
correct: string;
|
|
102
147
|
wrong: string;
|
|
@@ -127,14 +172,15 @@ export interface Config {
|
|
|
127
172
|
};
|
|
128
173
|
};
|
|
129
174
|
autoStopInactiveTime: number;
|
|
175
|
+
rewardScore: number;
|
|
130
176
|
messages: {
|
|
177
|
+
usage: string;
|
|
131
178
|
start: string;
|
|
132
179
|
stop: string;
|
|
133
180
|
notStarted: string;
|
|
134
181
|
generate: string;
|
|
135
182
|
correct: string;
|
|
136
183
|
wrong: string;
|
|
137
|
-
impossible: string;
|
|
138
184
|
solved: string;
|
|
139
185
|
roundEnd: string;
|
|
140
186
|
gameEnd: string;
|
|
@@ -154,4 +200,5 @@ export interface Config {
|
|
|
154
200
|
};
|
|
155
201
|
}
|
|
156
202
|
export declare const Config: Schema<Config>;
|
|
157
|
-
export declare function apply(ctx: Context, cfg: Config): void
|
|
203
|
+
export declare function apply(ctx: Context, cfg: Config): Promise<void>;
|
|
204
|
+
export {};
|