nonebot_plugin_chess


Namenonebot_plugin_chess JSON
Version 0.5.0 PyPI version JSON
download
home_pagehttps://github.com/noneplugin/nonebot-plugin-chess
SummaryNonebot2 国际象棋插件
upload_time2024-03-02 06:32:34
maintainer
docs_urlNone
authormeetwq
requires_python>=3.8,<4.0
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ## nonebot-plugin-chess

适用于 [Nonebot2](https://github.com/nonebot/nonebot2) 的国际象棋插件。


### 安装

- 使用 nb-cli

```
nb plugin install nonebot_plugin_chess
```

- 使用 pip

```
pip install nonebot_plugin_chess
```


人机功能 需要使用遵循 [UCI协议](https://www.xqbase.com/protocol/uci.htm) 的引擎

需要在 `.env` 文件中添加 引擎的可执行文件的路径

```
chess_engine_path=/path/to/your/engine
```

推荐的引擎:

 - [Stockfish](https://stockfishchess.org/)


### 使用

**以下命令需要加[命令前缀](https://nonebot.dev/docs/appendices/config#command-start-和-command-separator) (默认为`/`),可自行设置为空**

@我 + “国际象棋人机”或“国际象棋对战”开始一局游戏;

可使用“lv1~8”指定AI等级,如“国际象棋人机lv5”,默认为“lv4”;

发送 起始坐标格式,如“e2e4”下棋;

在坐标后加棋子字母表示升变,如“e7e8q”表示升变为后;

对应的字母:K:王,Q:后,B:象,N:马,R:车,P:兵

发送“结束下棋”结束当前棋局;

发送“显示棋盘”显示当前棋局;

发送“悔棋”可进行悔棋(人机模式可无限悔棋;对战模式只能撤销自己上一手下的棋);


或者使用 `chess` 指令:

可用选项:

 - `--battle`: 对战模式,默认为人机模式
 - `--black`: 执黑,即后手
 - `-l <LEVEL>`, `--level <LEVEL>`: 人机等级,可选 1~8,默认为 4


### 示例

<div align="left">
    <img src="https://s2.loli.net/2022/05/02/1gqSQUfnLuvkpAm.png" width="500" />
</div>


### 特别感谢

- [niklasf/python-chess](https://github.com/niklasf/python-chess) A chess library for Python
- [official-stockfish/Stockfish](https://github.com/official-stockfish/Stockfish) UCI chess engine

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/noneplugin/nonebot-plugin-chess",
    "name": "nonebot_plugin_chess",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8,<4.0",
    "maintainer_email": "",
    "keywords": "",
    "author": "meetwq",
    "author_email": "meetwq@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/9e/6f/36c499b8ff288250a361bdbb12a27859537f37548bc700029ac4bcee453f/nonebot_plugin_chess-0.5.0.tar.gz",
    "platform": null,
    "description": "## nonebot-plugin-chess\n\n\u9002\u7528\u4e8e [Nonebot2](https://github.com/nonebot/nonebot2) \u7684\u56fd\u9645\u8c61\u68cb\u63d2\u4ef6\u3002\n\n\n### \u5b89\u88c5\n\n- \u4f7f\u7528 nb-cli\n\n```\nnb plugin install nonebot_plugin_chess\n```\n\n- \u4f7f\u7528 pip\n\n```\npip install nonebot_plugin_chess\n```\n\n\n\u4eba\u673a\u529f\u80fd \u9700\u8981\u4f7f\u7528\u9075\u5faa [UCI\u534f\u8bae](https://www.xqbase.com/protocol/uci.htm) \u7684\u5f15\u64ce\n\n\u9700\u8981\u5728 `.env` \u6587\u4ef6\u4e2d\u6dfb\u52a0 \u5f15\u64ce\u7684\u53ef\u6267\u884c\u6587\u4ef6\u7684\u8def\u5f84\n\n```\nchess_engine_path=/path/to/your/engine\n```\n\n\u63a8\u8350\u7684\u5f15\u64ce\uff1a\n\n - [Stockfish](https://stockfishchess.org/)\n\n\n### \u4f7f\u7528\n\n**\u4ee5\u4e0b\u547d\u4ee4\u9700\u8981\u52a0[\u547d\u4ee4\u524d\u7f00](https://nonebot.dev/docs/appendices/config#command-start-\u548c-command-separator) (\u9ed8\u8ba4\u4e3a`/`)\uff0c\u53ef\u81ea\u884c\u8bbe\u7f6e\u4e3a\u7a7a**\n\n@\u6211 + \u201c\u56fd\u9645\u8c61\u68cb\u4eba\u673a\u201d\u6216\u201c\u56fd\u9645\u8c61\u68cb\u5bf9\u6218\u201d\u5f00\u59cb\u4e00\u5c40\u6e38\u620f\uff1b\n\n\u53ef\u4f7f\u7528\u201clv1~8\u201d\u6307\u5b9aAI\u7b49\u7ea7\uff0c\u5982\u201c\u56fd\u9645\u8c61\u68cb\u4eba\u673alv5\u201d\uff0c\u9ed8\u8ba4\u4e3a\u201clv4\u201d\uff1b\n\n\u53d1\u9001 \u8d77\u59cb\u5750\u6807\u683c\u5f0f\uff0c\u5982\u201ce2e4\u201d\u4e0b\u68cb\uff1b\n\n\u5728\u5750\u6807\u540e\u52a0\u68cb\u5b50\u5b57\u6bcd\u8868\u793a\u5347\u53d8\uff0c\u5982\u201ce7e8q\u201d\u8868\u793a\u5347\u53d8\u4e3a\u540e\uff1b\n\n\u5bf9\u5e94\u7684\u5b57\u6bcd\uff1aK\uff1a\u738b\uff0cQ\uff1a\u540e\uff0cB\uff1a\u8c61\uff0cN\uff1a\u9a6c\uff0cR\uff1a\u8f66\uff0cP\uff1a\u5175\n\n\u53d1\u9001\u201c\u7ed3\u675f\u4e0b\u68cb\u201d\u7ed3\u675f\u5f53\u524d\u68cb\u5c40\uff1b\n\n\u53d1\u9001\u201c\u663e\u793a\u68cb\u76d8\u201d\u663e\u793a\u5f53\u524d\u68cb\u5c40\uff1b\n\n\u53d1\u9001\u201c\u6094\u68cb\u201d\u53ef\u8fdb\u884c\u6094\u68cb\uff08\u4eba\u673a\u6a21\u5f0f\u53ef\u65e0\u9650\u6094\u68cb\uff1b\u5bf9\u6218\u6a21\u5f0f\u53ea\u80fd\u64a4\u9500\u81ea\u5df1\u4e0a\u4e00\u624b\u4e0b\u7684\u68cb\uff09\uff1b\n\n\n\u6216\u8005\u4f7f\u7528 `chess` \u6307\u4ee4\uff1a\n\n\u53ef\u7528\u9009\u9879\uff1a\n\n - `--battle`: \u5bf9\u6218\u6a21\u5f0f\uff0c\u9ed8\u8ba4\u4e3a\u4eba\u673a\u6a21\u5f0f\n - `--black`: \u6267\u9ed1\uff0c\u5373\u540e\u624b\n - `-l <LEVEL>`, `--level <LEVEL>`: \u4eba\u673a\u7b49\u7ea7\uff0c\u53ef\u9009 1~8\uff0c\u9ed8\u8ba4\u4e3a 4\n\n\n### \u793a\u4f8b\n\n<div align=\"left\">\n    <img src=\"https://s2.loli.net/2022/05/02/1gqSQUfnLuvkpAm.png\" width=\"500\" />\n</div>\n\n\n### \u7279\u522b\u611f\u8c22\n\n- [niklasf/python-chess](https://github.com/niklasf/python-chess) A chess library for Python\n- [official-stockfish/Stockfish](https://github.com/official-stockfish/Stockfish) UCI chess engine\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Nonebot2 \u56fd\u9645\u8c61\u68cb\u63d2\u4ef6",
    "version": "0.5.0",
    "project_urls": {
        "Homepage": "https://github.com/noneplugin/nonebot-plugin-chess",
        "Repository": "https://github.com/noneplugin/nonebot-plugin-chess"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2ad1e3d5a5f8e73c389094e9193abd3733fa88f291462797bbdc8ef60a5f11e5",
                "md5": "4681ad24484849ceecce498e9636e6af",
                "sha256": "1fae943724ba4236db0aabd3cea9025d0e71c76791127733ce6d10669f1b3d94"
            },
            "downloads": -1,
            "filename": "nonebot_plugin_chess-0.5.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "4681ad24484849ceecce498e9636e6af",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8,<4.0",
            "size": 10609,
            "upload_time": "2024-03-02T06:32:33",
            "upload_time_iso_8601": "2024-03-02T06:32:33.038543Z",
            "url": "https://files.pythonhosted.org/packages/2a/d1/e3d5a5f8e73c389094e9193abd3733fa88f291462797bbdc8ef60a5f11e5/nonebot_plugin_chess-0.5.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9e6f36c499b8ff288250a361bdbb12a27859537f37548bc700029ac4bcee453f",
                "md5": "a1ef67d63e405d93caf206d998632e6c",
                "sha256": "c470b84fab09f6c4129780c2204f70bcbbb11cf3ab68dd5a28fddaf87f6a99a7"
            },
            "downloads": -1,
            "filename": "nonebot_plugin_chess-0.5.0.tar.gz",
            "has_sig": false,
            "md5_digest": "a1ef67d63e405d93caf206d998632e6c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8,<4.0",
            "size": 9662,
            "upload_time": "2024-03-02T06:32:34",
            "upload_time_iso_8601": "2024-03-02T06:32:34.701363Z",
            "url": "https://files.pythonhosted.org/packages/9e/6f/36c499b8ff288250a361bdbb12a27859537f37548bc700029ac4bcee453f/nonebot_plugin_chess-0.5.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-02 06:32:34",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "noneplugin",
    "github_project": "nonebot-plugin-chess",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "nonebot_plugin_chess"
}
        
Elapsed time: 0.20982s