koishi-plugin-game-mini 0.1.4 → 0.1.5
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.js +3 -17
- package/lib/locales/locales/zh-CN.yml +1 -6
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -42,12 +42,7 @@ function apply(ctx, config) {
|
|
|
42
42
|
botWin: '哈哈我猜中了!我猜的是 {0},正确数字就是 {0},我赢啦 🎉',
|
|
43
43
|
botGuessTooSmall: '我猜 {0},猜小啦!当前范围 [{1}-{2}]',
|
|
44
44
|
botGuessTooBig: '我猜 {0},猜大啦!当前范围 [{1}-{2}]',
|
|
45
|
-
commandDesc: '
|
|
46
|
-
helpTitle: '猜数字小游戏使用帮助:',
|
|
47
|
-
helpStart: '1. guess start - 启动猜数字游戏,初始范围为配置的最小值-最大值',
|
|
48
|
-
helpStop: '2. guess stop - 停止当前猜数字游戏,并公布正确数字',
|
|
49
|
-
helpInput: '3. 游戏运行时直接输入数字 - 参与猜数字,系统会提示猜大/猜小或猜对',
|
|
50
|
-
helpOptionDesc: '查看指令帮助'
|
|
45
|
+
commandDesc: '猜数字小游戏指令'
|
|
51
46
|
}
|
|
52
47
|
};
|
|
53
48
|
try {
|
|
@@ -124,19 +119,10 @@ function apply(ctx, config) {
|
|
|
124
119
|
}
|
|
125
120
|
await session.send(reply);
|
|
126
121
|
});
|
|
127
|
-
ctx.command('guess <action:string>', '
|
|
128
|
-
.
|
|
129
|
-
.action(async ({ session, options }, action) => {
|
|
122
|
+
ctx.command('guess <action:string>', '猜数字小游戏指令')
|
|
123
|
+
.action(async ({ session }, action) => {
|
|
130
124
|
if (!session)
|
|
131
125
|
return '';
|
|
132
|
-
if (options?.help) {
|
|
133
|
-
const helpText = `${session.text('guessNumber.helpTitle')}
|
|
134
|
-
${session.text('guessNumber.helpStart')}
|
|
135
|
-
${session.text('guessNumber.helpStop')}
|
|
136
|
-
${session.text('guessNumber.helpInput')}`;
|
|
137
|
-
await session.send(helpText);
|
|
138
|
-
return '';
|
|
139
|
-
}
|
|
140
126
|
const key = getSessionKey(session);
|
|
141
127
|
let state = guessNumberStates.get(key) || {
|
|
142
128
|
target: 0,
|
|
@@ -9,9 +9,4 @@ guessNumber:
|
|
|
9
9
|
botWin: 哈哈我猜中了!我猜的是 {0},正确数字就是 {0},我赢啦 🎉
|
|
10
10
|
botGuessTooSmall: 我猜 {0},猜小啦!当前范围 [{1}-{2}]
|
|
11
11
|
botGuessTooBig: 我猜 {0},猜大啦!当前范围 [{1}-{2}]
|
|
12
|
-
commandDesc:
|
|
13
|
-
helpTitle: 猜数字小游戏使用帮助:
|
|
14
|
-
helpStart: 1. guess start - 启动猜数字游戏,初始范围为配置的最小值-最大值
|
|
15
|
-
helpStop: 2. guess stop - 停止当前猜数字游戏,并公布正确数字
|
|
16
|
-
helpInput: 3. 游戏运行时直接输入数字 - 参与猜数字,系统会提示猜大/猜小或猜对
|
|
17
|
-
helpOptionDesc: 查看指令帮助
|
|
12
|
+
commandDesc: 猜数字小游戏指令
|