<h1 align="center">
DG-Lab-Play
</h1>
<p align="center">
nonebot2 机器人插件 - ⚡ 在群里和大家一起玩郊狼吧!⚡
</p>
<p align="center">
<a href="https://dg-lab-play.readthedocs.io">📖 完整文档</a>
</p>
<p align="center">
<a href="https://www.codefactor.io/repository/github/ljzd-pro/nonebot-plugin-dg-lab-play">
<img src="https://www.codefactor.io/repository/github/ljzd-pro/nonebot-plugin-dg-lab-play/badge" alt="CodeFactor" />
</a>
<a href='https://dg-lab-play.readthedocs.io/'>
<img src='https://readthedocs.org/projects/dg-lab-play/badge/?version=latest' alt='Documentation Status' />
</a>
<a href="https://github.com/Ljzd-PRO/nonebot-plugin-dg-lab-play/activity">
<img src="https://img.shields.io/github/last-commit/Ljzd-PRO/nonebot-plugin-dg-lab-play/master" alt="Last Commit"/>
</a>
<a href="./LICENSE">
<img src="https://img.shields.io/github/license/Ljzd-PRO/nonebot-plugin-dg-lab-play" alt="BSD 3-Clause"/>
</a>
<a href="https://pypi.org/project/nonebot-plugin-dg-lab-play" target="_blank">
<img src="https://img.shields.io/github/v/release/Ljzd-PRO/nonebot-plugin-dg-lab-play?logo=python" alt="Version">
</a>
</p>
## 💡 特性
- 兼容大部分 nonebot 适配器
- OneBot v11, OneBot v12, Kaiheila, Telegram, Feishu, Red, DoDo
- 支持多个郊狼玩家同时连接
- DG-Lab App Socket 服务端可选择本地搭建或连接远程服务器
- 命令和回复文本均可自定义
- 支持以下功能:
- 📲连接 DG-Lab App
- 🕹️查看当前玩家
- 🔺增加玩家通道强度
- 🔻减小玩家通道强度
- 🎲随机通道强度
- ⤴️添加波形到循环
- 🔄️重设为某波形
- 🎲重设为随机波形
- ...
## 🔨 安装
### 🔨 安装
> 关于 nonebot 的安装和使用:[快速上手](https://nonebot.dev/docs/2.3.0/quick-start)
在您已经完成 nonebot 项目的创建和 nb-cli 脚手架的安装的前提下,\
在机器人项目下执行:
```bash
nb plugin install nonebot-plugin-dg-lab-play
```
### ⬆️ 更新
```bash
nb plugin update nonebot-plugin-dg-lab-play
```
## ⚙️ 配置
> [!Warning]
> 首次使用,必须更改 WebSocket 服务端配置,否则用户将可能无法连接
> [!Note]
> 更多配置内容参考 [插件配置](https://dg-lab-play.readthedocs.io/zh-cn/latest/config/guide/)
> nonebot 文档介绍:[dotenv 配置文件](https://nonebot.dev/docs/2.3.0/appendices/config#dotenv-%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6)
有两种配置 DG-Lab WebSocket 服务端的方法,分别为本地搭建和连接远程服务器,默认为本地搭建
### 📌(默认)采用本地搭建 WebSocket 服务端的方法
修改 nonebot 目录下的 `.env` 文件,参考如下:
#### 🔗(可选)设置本地服务端监听主机号和端口
```dotenv
# 本地搭建的服务端 host,默认为 0.0.0.0
DG_LAB_PLAY__WS_SERVER__LOCAL_SERVER_HOST=0.0.0.0
# 本地搭建的服务端监听端口,默认为 4567
DG_LAB_PLAY__WS_SERVER__LOCAL_SERVER_PORT=4567
```
#### ❗(必需)设置供 DG-Lab App 连接的本地 WebSocket 服务端 URI
```dotenv
# 生成二维码时,使用的本地服务端 URI(需要郊狼用户能够连接,即本机的公网地址)
# 首次使用,该配置必须更改,默认为本地环回地址,用户的 App 无法连接
# 普通连接为 ws://,SSL 加密连接为 wss://
DG_LAB_PLAY__WS_SERVER__LOCAL_SERVER_PUBLISH_URI="ws://my-server.net:4567"
```
#### 🔐(可选)设置 SSL 连接
```dotenv
# 是否启用 SSL 连接
DG_LAB_PLAY__WS_SERVER__LOCAL_SERVER_SECURE=True
# SSL 证书文件路径
# 若使用相对路径,起始位置为机器人项目目录
DG_LAB_PLAY__WS_SERVER__LOCAL_SERVER_SSL_CERT="/path/to/证书文件"
# SSL 私钥路径
# 若使用相对路径,起始位置为机器人项目目录
DG_LAB_PLAY__WS_SERVER__LOCAL_SERVER_SSL_KEY="/path/to/私钥文件"
# SSL 私钥密码
DG_LAB_PLAY__WS_SERVER__LOCAL_SERVER_SSL_PASSWORD=123456
```
📡 最后,记得完成对公网的端口转发等配置,确保用户能够连接本地搭建的 WebSocket 服务端。
### 📌(备选)采用连接远程 WebSocket 服务端的方法
修改 nonebot 目录下的 `.env` 文件,参考如下:
```dotenv
# 是否连接到远程 WebSocket 服务端
DG_LAB_PLAY__WS_SERVER__REMOTE_SERVER=True
# 远程服务端 URI
DG_LAB_PLAY__WS_SERVER__REMOTE_SERVER_URI="ws://my-server.net:8080"
```
## 🎉 开始使用
默认情况下,向机器人发送 `/郊狼玩法` 以查看完整帮助信息
命令和回复文本均可自定义,具体可参考
[`CommandTextConfig`](https://dg-lab-play.readthedocs.io/zh-cn/latest/config/command-text/#nonebot_plugin_dg_lab_play.config.CommandTextConfig),
[`ReplyTextConfig`](https://dg-lab-play.readthedocs.io/zh-cn/latest/config/reply-text/#nonebot_plugin_dg_lab_play.config.ReplyTextConfig)
## 💡 更多
### 是如何实现的郊狼控制?
本插件使用 [PyDGLab-WS](https://github.com/Ljzd-PRO/PyDGLab-WS) 创建服务端和终端以实现对 DG-Lab App 的控制
### 更多郊狼玩法?
- 专门适配郊狼的 buttplug 协议分支:[buttplug-dg-lab](https://github.com/Ljzd-PRO/buttplug-dg-lab)
- 恐怖游戏 DeppartPrototype Mod:[HentaiPlayMode](https://github.com/Ljzd-PRO/DeppartPrototypeHentaiPlayMod)
- 可搭配上面专门适配的分支软件使用
Raw data
{
"_id": null,
"home_page": "https://dg-lab-play.readthedocs.io",
"name": "nonebot-plugin-dg-lab-play",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.9",
"maintainer_email": null,
"keywords": "nonebot, nonebot2, dg-lab, dg-lab-v3, chatbot, dodo, feishu, kaiheila, onebot, onebot11, onebot12, red, telegram",
"author": "Ljzd-PRO",
"author_email": "ljzd@office.ljzd-pro.asia",
"download_url": "https://files.pythonhosted.org/packages/e2/9d/5c90fda90ef991033d2930948f6d8c14dc4a67bb308d871a5c40eb7e0e15/nonebot_plugin_dg_lab_play-1.0.0.tar.gz",
"platform": null,
"description": "<h1 align=\"center\">\n DG-Lab-Play\n</h1>\n\n<p align=\"center\">\n nonebot2 \u673a\u5668\u4eba\u63d2\u4ef6 - \u26a1 \u5728\u7fa4\u91cc\u548c\u5927\u5bb6\u4e00\u8d77\u73a9\u90ca\u72fc\u5427\uff01\u26a1\n</p>\n\n<p align=\"center\">\n <a href=\"https://dg-lab-play.readthedocs.io\">\ud83d\udcd6 \u5b8c\u6574\u6587\u6863</a>\n</p>\n\n<p align=\"center\">\n <a href=\"https://www.codefactor.io/repository/github/ljzd-pro/nonebot-plugin-dg-lab-play\">\n <img src=\"https://www.codefactor.io/repository/github/ljzd-pro/nonebot-plugin-dg-lab-play/badge\" alt=\"CodeFactor\" />\n </a>\n\n <a href='https://dg-lab-play.readthedocs.io/'>\n <img src='https://readthedocs.org/projects/dg-lab-play/badge/?version=latest' alt='Documentation Status' />\n </a>\n\n <a href=\"https://github.com/Ljzd-PRO/nonebot-plugin-dg-lab-play/activity\">\n <img src=\"https://img.shields.io/github/last-commit/Ljzd-PRO/nonebot-plugin-dg-lab-play/master\" alt=\"Last Commit\"/>\n </a>\n\n <a href=\"./LICENSE\">\n <img src=\"https://img.shields.io/github/license/Ljzd-PRO/nonebot-plugin-dg-lab-play\" alt=\"BSD 3-Clause\"/>\n </a>\n\n <a href=\"https://pypi.org/project/nonebot-plugin-dg-lab-play\" target=\"_blank\">\n <img src=\"https://img.shields.io/github/v/release/Ljzd-PRO/nonebot-plugin-dg-lab-play?logo=python\" alt=\"Version\">\n </a>\n</p>\n\n## \ud83d\udca1 \u7279\u6027\n\n- \u517c\u5bb9\u5927\u90e8\u5206 nonebot \u9002\u914d\u5668\n - OneBot v11, OneBot v12, Kaiheila, Telegram, Feishu, Red, DoDo\n- \u652f\u6301\u591a\u4e2a\u90ca\u72fc\u73a9\u5bb6\u540c\u65f6\u8fde\u63a5\n- DG-Lab App Socket \u670d\u52a1\u7aef\u53ef\u9009\u62e9\u672c\u5730\u642d\u5efa\u6216\u8fde\u63a5\u8fdc\u7a0b\u670d\u52a1\u5668\n- \u547d\u4ee4\u548c\u56de\u590d\u6587\u672c\u5747\u53ef\u81ea\u5b9a\u4e49\n- \u652f\u6301\u4ee5\u4e0b\u529f\u80fd\uff1a\n - \ud83d\udcf2\u8fde\u63a5 DG-Lab App\n - \ud83d\udd79\ufe0f\u67e5\u770b\u5f53\u524d\u73a9\u5bb6\n - \ud83d\udd3a\u589e\u52a0\u73a9\u5bb6\u901a\u9053\u5f3a\u5ea6\n - \ud83d\udd3b\u51cf\u5c0f\u73a9\u5bb6\u901a\u9053\u5f3a\u5ea6\n - \ud83c\udfb2\u968f\u673a\u901a\u9053\u5f3a\u5ea6\n - \u2934\ufe0f\u6dfb\u52a0\u6ce2\u5f62\u5230\u5faa\u73af\n - \ud83d\udd04\ufe0f\u91cd\u8bbe\u4e3a\u67d0\u6ce2\u5f62\n - \ud83c\udfb2\u91cd\u8bbe\u4e3a\u968f\u673a\u6ce2\u5f62\n - ...\n\n## \ud83d\udd28 \u5b89\u88c5\n\n### \ud83d\udd28 \u5b89\u88c5\n\n> \u5173\u4e8e nonebot \u7684\u5b89\u88c5\u548c\u4f7f\u7528\uff1a[\u5feb\u901f\u4e0a\u624b](https://nonebot.dev/docs/2.3.0/quick-start)\n\n\u5728\u60a8\u5df2\u7ecf\u5b8c\u6210 nonebot \u9879\u76ee\u7684\u521b\u5efa\u548c nb-cli \u811a\u624b\u67b6\u7684\u5b89\u88c5\u7684\u524d\u63d0\u4e0b\uff0c\\\n\u5728\u673a\u5668\u4eba\u9879\u76ee\u4e0b\u6267\u884c\uff1a\n\n```bash\nnb plugin install nonebot-plugin-dg-lab-play\n```\n\n### \u2b06\ufe0f \u66f4\u65b0\n\n```bash\nnb plugin update nonebot-plugin-dg-lab-play\n```\n\n## \u2699\ufe0f \u914d\u7f6e\n\n> [!Warning]\n> \u9996\u6b21\u4f7f\u7528\uff0c\u5fc5\u987b\u66f4\u6539 WebSocket \u670d\u52a1\u7aef\u914d\u7f6e\uff0c\u5426\u5219\u7528\u6237\u5c06\u53ef\u80fd\u65e0\u6cd5\u8fde\u63a5\n\n> [!Note]\n> \u66f4\u591a\u914d\u7f6e\u5185\u5bb9\u53c2\u8003 [\u63d2\u4ef6\u914d\u7f6e](https://dg-lab-play.readthedocs.io/zh-cn/latest/config/guide/)\n\n> nonebot \u6587\u6863\u4ecb\u7ecd\uff1a[dotenv \u914d\u7f6e\u6587\u4ef6](https://nonebot.dev/docs/2.3.0/appendices/config#dotenv-%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6)\n\n\u6709\u4e24\u79cd\u914d\u7f6e DG-Lab WebSocket \u670d\u52a1\u7aef\u7684\u65b9\u6cd5\uff0c\u5206\u522b\u4e3a\u672c\u5730\u642d\u5efa\u548c\u8fde\u63a5\u8fdc\u7a0b\u670d\u52a1\u5668\uff0c\u9ed8\u8ba4\u4e3a\u672c\u5730\u642d\u5efa\n\n### \ud83d\udccc\uff08\u9ed8\u8ba4\uff09\u91c7\u7528\u672c\u5730\u642d\u5efa WebSocket \u670d\u52a1\u7aef\u7684\u65b9\u6cd5\n\n\u4fee\u6539 nonebot \u76ee\u5f55\u4e0b\u7684 `.env` \u6587\u4ef6\uff0c\u53c2\u8003\u5982\u4e0b\uff1a\n\n#### \ud83d\udd17\uff08\u53ef\u9009\uff09\u8bbe\u7f6e\u672c\u5730\u670d\u52a1\u7aef\u76d1\u542c\u4e3b\u673a\u53f7\u548c\u7aef\u53e3\n```dotenv\n# \u672c\u5730\u642d\u5efa\u7684\u670d\u52a1\u7aef host\uff0c\u9ed8\u8ba4\u4e3a 0.0.0.0\nDG_LAB_PLAY__WS_SERVER__LOCAL_SERVER_HOST=0.0.0.0\n# \u672c\u5730\u642d\u5efa\u7684\u670d\u52a1\u7aef\u76d1\u542c\u7aef\u53e3\uff0c\u9ed8\u8ba4\u4e3a 4567\nDG_LAB_PLAY__WS_SERVER__LOCAL_SERVER_PORT=4567\n```\n\n#### \u2757\uff08\u5fc5\u9700\uff09\u8bbe\u7f6e\u4f9b DG-Lab App \u8fde\u63a5\u7684\u672c\u5730 WebSocket \u670d\u52a1\u7aef URI\n\n```dotenv\n# \u751f\u6210\u4e8c\u7ef4\u7801\u65f6\uff0c\u4f7f\u7528\u7684\u672c\u5730\u670d\u52a1\u7aef URI\uff08\u9700\u8981\u90ca\u72fc\u7528\u6237\u80fd\u591f\u8fde\u63a5\uff0c\u5373\u672c\u673a\u7684\u516c\u7f51\u5730\u5740\uff09\n# \u9996\u6b21\u4f7f\u7528\uff0c\u8be5\u914d\u7f6e\u5fc5\u987b\u66f4\u6539\uff0c\u9ed8\u8ba4\u4e3a\u672c\u5730\u73af\u56de\u5730\u5740\uff0c\u7528\u6237\u7684 App \u65e0\u6cd5\u8fde\u63a5\n# \u666e\u901a\u8fde\u63a5\u4e3a ws://\uff0cSSL \u52a0\u5bc6\u8fde\u63a5\u4e3a wss://\nDG_LAB_PLAY__WS_SERVER__LOCAL_SERVER_PUBLISH_URI=\"ws://my-server.net:4567\"\n```\n\n#### \ud83d\udd10\uff08\u53ef\u9009\uff09\u8bbe\u7f6e SSL \u8fde\u63a5\n\n```dotenv\n# \u662f\u5426\u542f\u7528 SSL \u8fde\u63a5\nDG_LAB_PLAY__WS_SERVER__LOCAL_SERVER_SECURE=True\n# SSL \u8bc1\u4e66\u6587\u4ef6\u8def\u5f84\n# \u82e5\u4f7f\u7528\u76f8\u5bf9\u8def\u5f84\uff0c\u8d77\u59cb\u4f4d\u7f6e\u4e3a\u673a\u5668\u4eba\u9879\u76ee\u76ee\u5f55\nDG_LAB_PLAY__WS_SERVER__LOCAL_SERVER_SSL_CERT=\"/path/to/\u8bc1\u4e66\u6587\u4ef6\"\n# SSL \u79c1\u94a5\u8def\u5f84\n# \u82e5\u4f7f\u7528\u76f8\u5bf9\u8def\u5f84\uff0c\u8d77\u59cb\u4f4d\u7f6e\u4e3a\u673a\u5668\u4eba\u9879\u76ee\u76ee\u5f55\nDG_LAB_PLAY__WS_SERVER__LOCAL_SERVER_SSL_KEY=\"/path/to/\u79c1\u94a5\u6587\u4ef6\"\n# SSL \u79c1\u94a5\u5bc6\u7801\nDG_LAB_PLAY__WS_SERVER__LOCAL_SERVER_SSL_PASSWORD=123456\n```\n\n\ud83d\udce1 \u6700\u540e\uff0c\u8bb0\u5f97\u5b8c\u6210\u5bf9\u516c\u7f51\u7684\u7aef\u53e3\u8f6c\u53d1\u7b49\u914d\u7f6e\uff0c\u786e\u4fdd\u7528\u6237\u80fd\u591f\u8fde\u63a5\u672c\u5730\u642d\u5efa\u7684 WebSocket \u670d\u52a1\u7aef\u3002\n\n### \ud83d\udccc\uff08\u5907\u9009\uff09\u91c7\u7528\u8fde\u63a5\u8fdc\u7a0b WebSocket \u670d\u52a1\u7aef\u7684\u65b9\u6cd5\n\n\u4fee\u6539 nonebot \u76ee\u5f55\u4e0b\u7684 `.env` \u6587\u4ef6\uff0c\u53c2\u8003\u5982\u4e0b\uff1a\n\n```dotenv\n# \u662f\u5426\u8fde\u63a5\u5230\u8fdc\u7a0b WebSocket \u670d\u52a1\u7aef\nDG_LAB_PLAY__WS_SERVER__REMOTE_SERVER=True\n# \u8fdc\u7a0b\u670d\u52a1\u7aef URI\nDG_LAB_PLAY__WS_SERVER__REMOTE_SERVER_URI=\"ws://my-server.net:8080\"\n```\n\n## \ud83c\udf89 \u5f00\u59cb\u4f7f\u7528\n\n\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u5411\u673a\u5668\u4eba\u53d1\u9001 `/\u90ca\u72fc\u73a9\u6cd5` \u4ee5\u67e5\u770b\u5b8c\u6574\u5e2e\u52a9\u4fe1\u606f\n\n\u547d\u4ee4\u548c\u56de\u590d\u6587\u672c\u5747\u53ef\u81ea\u5b9a\u4e49\uff0c\u5177\u4f53\u53ef\u53c2\u8003\n[`CommandTextConfig`](https://dg-lab-play.readthedocs.io/zh-cn/latest/config/command-text/#nonebot_plugin_dg_lab_play.config.CommandTextConfig), \n[`ReplyTextConfig`](https://dg-lab-play.readthedocs.io/zh-cn/latest/config/reply-text/#nonebot_plugin_dg_lab_play.config.ReplyTextConfig)\n\n## \ud83d\udca1 \u66f4\u591a\n\n### \u662f\u5982\u4f55\u5b9e\u73b0\u7684\u90ca\u72fc\u63a7\u5236\uff1f\n\n\u672c\u63d2\u4ef6\u4f7f\u7528 [PyDGLab-WS](https://github.com/Ljzd-PRO/PyDGLab-WS) \u521b\u5efa\u670d\u52a1\u7aef\u548c\u7ec8\u7aef\u4ee5\u5b9e\u73b0\u5bf9 DG-Lab App \u7684\u63a7\u5236\n\n### \u66f4\u591a\u90ca\u72fc\u73a9\u6cd5\uff1f\n\n- \u4e13\u95e8\u9002\u914d\u90ca\u72fc\u7684 buttplug \u534f\u8bae\u5206\u652f\uff1a[buttplug-dg-lab](https://github.com/Ljzd-PRO/buttplug-dg-lab)\n- \u6050\u6016\u6e38\u620f DeppartPrototype Mod\uff1a[HentaiPlayMode](https://github.com/Ljzd-PRO/DeppartPrototypeHentaiPlayMod)\n - \u53ef\u642d\u914d\u4e0a\u9762\u4e13\u95e8\u9002\u914d\u7684\u5206\u652f\u8f6f\u4ef6\u4f7f\u7528\n",
"bugtrack_url": null,
"license": null,
"summary": "nonebot2 \u673a\u5668\u4eba\u63d2\u4ef6 - \u5728\u7fa4\u91cc\u548c\u5927\u5bb6\u4e00\u8d77\u73a9\u90ca\u72fc\u5427\uff01",
"version": "1.0.0",
"project_urls": {
"Documentation": "https://dg-lab-play.readthedocs.io",
"Homepage": "https://dg-lab-play.readthedocs.io",
"Repository": "https://github.com/Ljzd-PRO/nonebot-plugin-dg-lab-play"
},
"split_keywords": [
"nonebot",
" nonebot2",
" dg-lab",
" dg-lab-v3",
" chatbot",
" dodo",
" feishu",
" kaiheila",
" onebot",
" onebot11",
" onebot12",
" red",
" telegram"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "e55ef8ded368d2c58308cfee6b44eb3d085626456224db23509b1953e2ac6947",
"md5": "d5e04f3bbd7025ec079f735c485a90d6",
"sha256": "2d6750a4b155f68a3070c272855562e461726fe26390f6feb0cbd22bb3c45533"
},
"downloads": -1,
"filename": "nonebot_plugin_dg_lab_play-1.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "d5e04f3bbd7025ec079f735c485a90d6",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.9",
"size": 20291,
"upload_time": "2024-05-21T19:39:09",
"upload_time_iso_8601": "2024-05-21T19:39:09.121002Z",
"url": "https://files.pythonhosted.org/packages/e5/5e/f8ded368d2c58308cfee6b44eb3d085626456224db23509b1953e2ac6947/nonebot_plugin_dg_lab_play-1.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "e29d5c90fda90ef991033d2930948f6d8c14dc4a67bb308d871a5c40eb7e0e15",
"md5": "e3f2e9de7271a2bfdd0b239c7330a624",
"sha256": "597575a9dc97bcd0d10466147b3a4d237e8fee813f28f082e4a909d8689be2f6"
},
"downloads": -1,
"filename": "nonebot_plugin_dg_lab_play-1.0.0.tar.gz",
"has_sig": false,
"md5_digest": "e3f2e9de7271a2bfdd0b239c7330a624",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.9",
"size": 16951,
"upload_time": "2024-05-21T19:39:11",
"upload_time_iso_8601": "2024-05-21T19:39:11.067470Z",
"url": "https://files.pythonhosted.org/packages/e2/9d/5c90fda90ef991033d2930948f6d8c14dc4a67bb308d871a5c40eb7e0e15/nonebot_plugin_dg_lab_play-1.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-05-21 19:39:11",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Ljzd-PRO",
"github_project": "nonebot-plugin-dg-lab-play",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "nonebot-plugin-dg-lab-play"
}