koishi-plugin-game-mini 0.1.0 → 0.1.2

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.
Files changed (3) hide show
  1. package/lib/index.js +14 -4
  2. package/package.json +2 -2
  3. package/readme.md +25 -27
package/lib/index.js CHANGED
@@ -14,11 +14,21 @@ exports.using = ['i18n'];
14
14
  exports.inject = ['console'];
15
15
  exports.Config = koishi_1.Schema.object({
16
16
  guessNumber: koishi_1.Schema.object({
17
- min: koishi_1.Schema.number().min(0).default(0),
18
- max: koishi_1.Schema.number().min(1).default(100),
19
- botParticipateInGroup: koishi_1.Schema.boolean().default(true)
17
+ min: koishi_1.Schema.number().min(0).default(0).description('猜数字最小值(最低为0)'),
18
+ max: koishi_1.Schema.number().min(1).default(100).description('猜数字最大值'),
19
+ botParticipateInGroup: koishi_1.Schema.boolean().default(true).description('群聊中Bot是否参与(私聊强制参与)')
20
20
  }).description('猜数字游戏配置')
21
- }).i18n({ 'zh-CN': {} });
21
+ }).i18n({
22
+ 'zh-CN': {
23
+ 'guessNumber.min': '猜数字最小值',
24
+ 'guessNumber.min.description': '设置猜数字游戏的最小值,最低限制为0',
25
+ 'guessNumber.max': '猜数字最大值',
26
+ 'guessNumber.max.description': '设置猜数字游戏的最大值,需大于0',
27
+ 'guessNumber.botParticipateInGroup': '群聊Bot参与开关',
28
+ 'guessNumber.botParticipateInGroup.description': '控制Bot是否在群聊中参与猜数字,私聊场景下Bot强制参与',
29
+ 'guessNumber': '猜数字游戏配置'
30
+ }
31
+ });
22
32
  function apply(ctx, config) {
23
33
  const defaultI18n = {
24
34
  guessNumber: {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-game-mini",
3
- "version": "0.1.0",
4
- "description": "一款简单的猜数字小游戏,支持自定义范围、降低Bot猜中概率、Bot参与开关",
3
+ "version": "0.1.2",
4
+ "description": "一款简单的猜数字小游戏,支持Bot参与",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [
package/readme.md CHANGED
@@ -3,66 +3,64 @@
3
3
  ## 项目介绍 (Project Introduction)
4
4
 
5
5
  ### 中文
6
- 这是一个为 Koishi 聊天机器人框架开发的猜数字小游戏插件。该插件具有以下特点:
7
- - 支持自定义猜数字的数值范围- 区分群聊/私聊模式:私聊时 Bot 强制参与,群聊可配置 Bot 是否参与
8
- - 提供可视化控制台配置页面
9
- - Bot 参与时会智能猜数,且不会重复猜测同一数字
6
+ 这是一款为 Koishi 聊天机器人框架开发的轻量级猜数字小游戏插件,核心玩法贴合经典“终极密码”规则,兼具易用性与可配置性:
7
+ - 支持自定义猜数字的数值范围(默认 0-100)
8
+ - 区分群聊/私聊模式:私聊时 Bot 强制参与,群聊可通过配置开关控制 Bot 是否参与
10
9
 
11
10
  ### English
12
- This is a number guessing game plugin developed for the Koishi chatbot framework. This plugin has the following features:
13
- - Supports customizable number range for guessing - Differentiates between group chat and private chat modes: Bots are forced to participate in private chats, while bot participation in group chats can be configured.
14
- - Provides a visual console configuration page
15
- - When a bot participates, it will intelligently guess numbers and will not repeatedly guess the same number.
11
+ This is a lightweight number guessing game plugin developed for the Koishi chatbot framework, with core gameplay adhering to the classic "Ultimate Password" rules and both ease of use and configurability:
12
+ - Supports customizable number range for guessing (default 0-100)
13
+ - Differentiates between group chat and private chat modes: Bots are forced to participate in private chats, while bot participation in group chats can be controlled via configuration switch
16
14
 
17
15
  ## 使用说明 (Usage)
18
16
 
19
17
  ### 中文
20
18
  | 命令 (Command) | 功能说明 (Description) |
21
19
  | --- | --- |
22
- | guess-number start | 启动猜数字游戏,Bot(配置参与时)会先猜一个数字 |
23
- | guess-number <数字> | 输入数字进行猜测,系统会提示猜大/猜小或猜对 |
24
- | guess-number stop | 停止当前猜数字游戏,并公布正确答案 |
20
+ | `guess start` | 启动猜数字游戏,初始范围为配置的最小值-最大值;若 Bot 配置参与,会先随机猜一个数字 |
21
+ | 直接输入数字 | 游戏运行时输入纯数字即可猜测,系统会实时提示“猜大了/猜小了”并缩小范围,或提示“猜对了”并结束游戏 |
22
+ | `guess stop` | 停止当前猜数字游戏,并公布正确数字 |
25
23
 
26
24
  ### English
27
25
  | Command | Description |
28
26
  | --- | --- |
29
- | guess-number start | Start the number guessing game, and the Bot (if configured to participate) will guess a number first |
30
- | guess-number <number> | Enter a number to guess, and the system will prompt if it's too big/too small or correct |
31
- | guess-number stop | Stop the current number guessing game and announce the correct answer |
27
+ | `guess start` | Start the number guessing game with the initial range of configured min-max values; if the Bot is configured to participate, it will randomly guess a number first |
28
+ | Enter number directly | Enter a pure number during the game to guess; the system will prompt "too big/too small" in real time and narrow the range, or prompt "correct" and end the game |
29
+ | `guess stop` | Stop the current number guessing game and announce the correct number |
32
30
 
33
31
  ## 配置说明 (Configuration)
34
32
 
35
33
  ### 中文
36
34
  | 配置项 (Config Item) | 说明 (Description) | 默认值 (Default) |
37
35
  | --- | --- | --- |
38
- | guessNumber.min | 猜数字最小值(最低为0) | 0 |
39
- | guessNumber.max | 猜数字最大值 | 100 |
40
- | guessNumber.botParticipateInGroup | 群聊中 Bot 是否参与猜数字(私聊强制参与) | true |
36
+ | `guessNumber.min` | 猜数字最小值 | 0 |
37
+ | `guessNumber.max` | 猜数字最大值 | 100 |
38
+ | `guessNumber.botParticipateInGroup` | 群聊中 Bot 是否参与猜数字(私聊场景下 Bot 强制参与) | true |
41
39
 
42
40
  ### English
43
41
  | Config Item | Description | Default |
44
42
  | --- | --- | --- |
45
- | guessNumber.min | Minimum value for number guessing (minimum 0) | 0 |
46
- | guessNumber.max | Maximum value for number guessing | 100 |
47
- | guessNumber.botParticipateInGroup | Whether the Bot participates in number guessing in group chats (compulsory in private chats) | true |
43
+ | `guessNumber.min` | Minimum value for number guessing| 0 |
44
+ | `guessNumber.max` | Maximum value for number guessing | 100 |
45
+ | `guessNumber.botParticipateInGroup` | Whether the Bot participates in number guessing in group chats (Bot is forced to participate in private chat scenarios) | true |
48
46
 
49
47
  ## 项目贡献者 (Contributors)
50
48
  | 贡献者 (Contributor) | 贡献内容 (Contribution) |
51
49
  | --- | --- |
52
- | Minecraft-1314 | 插件完整开发 (Complete plugin development) |
50
+ | Minecraft-1314 | 插件完整开发、功能迭代与问题修复 (Complete plugin development, function iteration and bug fixing) |
53
51
  | (欢迎提交 PR 加入贡献者列表) | (Welcome to submit PR to join the contributor list) |
54
52
 
55
53
  ## 许可协议 (License)
56
- 本项目采用 MIT 许可证,详情参见 LICENSE 文件。
54
+ 本项目采用 MIT 开源许可证,您可自由使用、修改和分发,详情参见项目根目录的 LICENSE 文件。
57
55
 
58
- This project is licensed under the MIT License, see the LICENSE file for details.
56
+ This project is licensed under the MIT Open Source License. You are free to use, modify and distribute it. For details, see the LICENSE file in the project root directory.
59
57
 
60
58
  ## 支持我们 (Support Us)
61
- 如果这个项目对您有帮助,欢迎点亮右上角的 Star ⭐ 支持我们,这将是对所有贡献者最大的鼓励!
59
+ 如果这个项目对您有帮助,欢迎点亮仓库右上角的 Star ⭐ 支持我们,这将是对所有贡献者最大的鼓励!
62
60
 
63
- If this project is helpful to you, please feel free to star it in the upper right corner ⭐ to support us, which will be the greatest encouragement to all contributors!
61
+ If this project is helpful to you, please feel free to star the repository in the upper right corner ⭐ to support us, which will be the greatest encouragement to all contributors!
64
62
 
65
63
  ## 问题反馈 (Feedback)
66
- 如有问题或建议,可通过 Issues 提交反馈。
64
+ 如有使用问题、功能建议或 Bug 反馈,可通过 GitHub Issues 提交,我们会尽快响应。
67
65
 
68
- If you have any questions or suggestions, please submit feedback via Issues.
66
+ If you have any questions or suggestions, please submit them via GitHub Issues, and we will respond as soon as possible.