nonebot_plugin_lagrange


Namenonebot_plugin_lagrange JSON
Version 1.0.7 PyPI version JSON
download
home_pagehttps://github.com/Lonely-Sails/nonebot-plugin-lagrange
Summary一款便于管理 Lagrange.Onebot 的插件。
upload_time2024-10-06 11:28:16
maintainerNone
docs_urlNone
authorLonely-Sails
requires_python<4.0,>=3.8
licenseGPL3
keywords nonebot nonebot2 lagrange.onebot lagrange onebot v11 onebot
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <div align="center">
  <a href="https://v2.nonebot.dev/store"><img src="https://github.com/A-kirami/nonebot-plugin-template/blob/resources/nbp_logo.png" width="180" height="180" alt="NoneBotPluginLogo"></a>
  <br>
  <p><img src="https://github.com/A-kirami/nonebot-plugin-template/blob/resources/NoneBotPlugin.svg" width="240" alt="NoneBotPluginText"></p>
</div>

<div align="center">

# nonebot-plugin-lagrange

_✨ 一款方便管理 Lagrange.OneBot 的插件。 ✨_

</div>

## 📖 介绍

本插件旨在使用户能够简单的使用 Lagrange.OneBot 来部署机器人。目前实现的功能有:

- 自动配置使其连接上 NoneBot
- 通过 WebUi 控制 Lagrange.
- 提醒用户遇到登录失败的解决方法。
- 根据系统自动安装合适的 Lagrange.OneBot.

<details>
<summary>WebUi</summary>

![1](https://raw.githubusercontent.com/Lonely-Sails/nonebot-plugin-lagrange/master/pictures/1.png)
![2](https://raw.githubusercontent.com/Lonely-Sails/nonebot-plugin-lagrange/master/pictures/2.png)
![3](https://raw.githubusercontent.com/Lonely-Sails/nonebot-plugin-lagrange/master/pictures/3.png)

</details>

## 💿 安装

你可以使用 `pip3 install nonebot-plugin-lagrange` 来安装此插件。

## ⚙️ 配置

在 NoneBot2 项目的`.env`文件中添加下表中的必填配置

|          配置项           | 必填 |   默认值    |            说明             |
|:----------------------:|:--:|:--------:|:-------------------------:|
|     lagrange_path      | 否  | Lagrange | Lagrange.OneBot 的安装和运行目录。 |
|  lagrange_auto_start   | 否  |   True   |  是否在检测到有安装 Lgr 的情况下自动启动。  |
| lagrange_auto_install  | 否  |   True   |    是否在未安装 Lgr 的情况自动安装     |
| lagrange_max_cache_log | 否  |   500    |         最大缓存多少行日志         |
|     lagrange_webui     | 否  |   True   |        是否启用 WebUi         |
|  lagrange_webui_token  | 否  |    空     |     登录 WebUi 的 token      |

## 🎉 使用

### WebUi

在启动机器人时,你应该会看到一行日志:

```log
08-19 10:50:54 [INFO] nonebot_plugin_lagrange | WebUi http://127.0.0.1:8080/lagrange?token=ijr...
```

其中 `WebUi` 字段后面的链接就是 WebUi 的地址。请注意,后面的 token 参数即为登录密码,请注意保管。你可以自己设置配置项 `Lagrange_webui_token` ,若检测到为空时将会自动生成一个 token 并储存在拉格兰目录下的 `token.bin` 文件中。

将这个链接复制到浏览器内并打开,如若出现界面则登录成功。

### 指令表

|   名称   |  权限  | 说明      |
|:------:|:----:|:--------|
| status | 超级用户 | 查看拉格兰状态 |

## 计划功能

- [ ] 监控拉格兰日志,分析机器人的消息。

## 🙏 鸣谢

> [Lagrange](https://lagrangedev.github.io/Lagrange.Doc/)

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Lonely-Sails/nonebot-plugin-lagrange",
    "name": "nonebot_plugin_lagrange",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.8",
    "maintainer_email": null,
    "keywords": "nonebot, nonebot2, lagrange.onebot, lagrange, onebot v11, onebot",
    "author": "Lonely-Sails",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/77/ce/1769f7f013a852f0b118d796f7354dc0b1e193831940f3ec920d25f5d966/nonebot_plugin_lagrange-1.0.7.tar.gz",
    "platform": null,
    "description": "<div align=\"center\">\n  <a href=\"https://v2.nonebot.dev/store\"><img src=\"https://github.com/A-kirami/nonebot-plugin-template/blob/resources/nbp_logo.png\" width=\"180\" height=\"180\" alt=\"NoneBotPluginLogo\"></a>\n  <br>\n  <p><img src=\"https://github.com/A-kirami/nonebot-plugin-template/blob/resources/NoneBotPlugin.svg\" width=\"240\" alt=\"NoneBotPluginText\"></p>\n</div>\n\n<div align=\"center\">\n\n# nonebot-plugin-lagrange\n\n_\u2728 \u4e00\u6b3e\u65b9\u4fbf\u7ba1\u7406 Lagrange.OneBot \u7684\u63d2\u4ef6\u3002 \u2728_\n\n</div>\n\n## \ud83d\udcd6 \u4ecb\u7ecd\n\n\u672c\u63d2\u4ef6\u65e8\u5728\u4f7f\u7528\u6237\u80fd\u591f\u7b80\u5355\u7684\u4f7f\u7528 Lagrange.OneBot \u6765\u90e8\u7f72\u673a\u5668\u4eba\u3002\u76ee\u524d\u5b9e\u73b0\u7684\u529f\u80fd\u6709\uff1a\n\n- \u81ea\u52a8\u914d\u7f6e\u4f7f\u5176\u8fde\u63a5\u4e0a NoneBot\n- \u901a\u8fc7 WebUi \u63a7\u5236 Lagrange.\n- \u63d0\u9192\u7528\u6237\u9047\u5230\u767b\u5f55\u5931\u8d25\u7684\u89e3\u51b3\u65b9\u6cd5\u3002\n- \u6839\u636e\u7cfb\u7edf\u81ea\u52a8\u5b89\u88c5\u5408\u9002\u7684 Lagrange.OneBot.\n\n<details>\n<summary>WebUi</summary>\n\n![1](https://raw.githubusercontent.com/Lonely-Sails/nonebot-plugin-lagrange/master/pictures/1.png)\n![2](https://raw.githubusercontent.com/Lonely-Sails/nonebot-plugin-lagrange/master/pictures/2.png)\n![3](https://raw.githubusercontent.com/Lonely-Sails/nonebot-plugin-lagrange/master/pictures/3.png)\n\n</details>\n\n## \ud83d\udcbf \u5b89\u88c5\n\n\u4f60\u53ef\u4ee5\u4f7f\u7528 `pip3 install nonebot-plugin-lagrange` \u6765\u5b89\u88c5\u6b64\u63d2\u4ef6\u3002\n\n## \u2699\ufe0f \u914d\u7f6e\n\n\u5728 NoneBot2 \u9879\u76ee\u7684`.env`\u6587\u4ef6\u4e2d\u6dfb\u52a0\u4e0b\u8868\u4e2d\u7684\u5fc5\u586b\u914d\u7f6e\n\n|          \u914d\u7f6e\u9879           | \u5fc5\u586b |   \u9ed8\u8ba4\u503c    |            \u8bf4\u660e             |\n|:----------------------:|:--:|:--------:|:-------------------------:|\n|     lagrange_path      | \u5426  | Lagrange | Lagrange.OneBot \u7684\u5b89\u88c5\u548c\u8fd0\u884c\u76ee\u5f55\u3002 |\n|  lagrange_auto_start   | \u5426  |   True   |  \u662f\u5426\u5728\u68c0\u6d4b\u5230\u6709\u5b89\u88c5 Lgr \u7684\u60c5\u51b5\u4e0b\u81ea\u52a8\u542f\u52a8\u3002  |\n| lagrange_auto_install  | \u5426  |   True   |    \u662f\u5426\u5728\u672a\u5b89\u88c5 Lgr \u7684\u60c5\u51b5\u81ea\u52a8\u5b89\u88c5     |\n| lagrange_max_cache_log | \u5426  |   500    |         \u6700\u5927\u7f13\u5b58\u591a\u5c11\u884c\u65e5\u5fd7         |\n|     lagrange_webui     | \u5426  |   True   |        \u662f\u5426\u542f\u7528 WebUi         |\n|  lagrange_webui_token  | \u5426  |    \u7a7a     |     \u767b\u5f55 WebUi \u7684 token      |\n\n## \ud83c\udf89 \u4f7f\u7528\n\n### WebUi\n\n\u5728\u542f\u52a8\u673a\u5668\u4eba\u65f6\uff0c\u4f60\u5e94\u8be5\u4f1a\u770b\u5230\u4e00\u884c\u65e5\u5fd7\uff1a\n\n```log\n08-19 10:50:54 [INFO] nonebot_plugin_lagrange | WebUi http://127.0.0.1:8080/lagrange?token=ijr...\n```\n\n\u5176\u4e2d `WebUi` \u5b57\u6bb5\u540e\u9762\u7684\u94fe\u63a5\u5c31\u662f WebUi \u7684\u5730\u5740\u3002\u8bf7\u6ce8\u610f\uff0c\u540e\u9762\u7684 token \u53c2\u6570\u5373\u4e3a\u767b\u5f55\u5bc6\u7801\uff0c\u8bf7\u6ce8\u610f\u4fdd\u7ba1\u3002\u4f60\u53ef\u4ee5\u81ea\u5df1\u8bbe\u7f6e\u914d\u7f6e\u9879 `Lagrange_webui_token` \uff0c\u82e5\u68c0\u6d4b\u5230\u4e3a\u7a7a\u65f6\u5c06\u4f1a\u81ea\u52a8\u751f\u6210\u4e00\u4e2a token \u5e76\u50a8\u5b58\u5728\u62c9\u683c\u5170\u76ee\u5f55\u4e0b\u7684 `token.bin` \u6587\u4ef6\u4e2d\u3002\n\n\u5c06\u8fd9\u4e2a\u94fe\u63a5\u590d\u5236\u5230\u6d4f\u89c8\u5668\u5185\u5e76\u6253\u5f00\uff0c\u5982\u82e5\u51fa\u73b0\u754c\u9762\u5219\u767b\u5f55\u6210\u529f\u3002\n\n### \u6307\u4ee4\u8868\n\n|   \u540d\u79f0   |  \u6743\u9650  | \u8bf4\u660e      |\n|:------:|:----:|:--------|\n| status | \u8d85\u7ea7\u7528\u6237 | \u67e5\u770b\u62c9\u683c\u5170\u72b6\u6001 |\n\n## \u8ba1\u5212\u529f\u80fd\n\n- [ ] \u76d1\u63a7\u62c9\u683c\u5170\u65e5\u5fd7\uff0c\u5206\u6790\u673a\u5668\u4eba\u7684\u6d88\u606f\u3002\n\n## \ud83d\ude4f \u9e23\u8c22\n\n> [Lagrange](https://lagrangedev.github.io/Lagrange.Doc/)\n",
    "bugtrack_url": null,
    "license": "GPL3",
    "summary": "\u4e00\u6b3e\u4fbf\u4e8e\u7ba1\u7406 Lagrange.Onebot \u7684\u63d2\u4ef6\u3002",
    "version": "1.0.7",
    "project_urls": {
        "Documentation": "https://github.com/Lonely-Sails/nonebot-plugin-lagrange#readme",
        "Homepage": "https://github.com/Lonely-Sails/nonebot-plugin-lagrange",
        "Repository": "https://github.com/Lonely-Sails/nonebot-plugin-lagrange"
    },
    "split_keywords": [
        "nonebot",
        " nonebot2",
        " lagrange.onebot",
        " lagrange",
        " onebot v11",
        " onebot"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "efb562c9d8644c561a0c8e987d7f2259c683ba32c5932502c40c078cf08393ec",
                "md5": "89957bdff831268161936ccab22010b5",
                "sha256": "e56147637348d5f38af51848978f83f0d12fe7a92ea812f72ea2f8649b8ceff5"
            },
            "downloads": -1,
            "filename": "nonebot_plugin_lagrange-1.0.7-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "89957bdff831268161936ccab22010b5",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.8",
            "size": 28491,
            "upload_time": "2024-10-06T11:28:14",
            "upload_time_iso_8601": "2024-10-06T11:28:14.851650Z",
            "url": "https://files.pythonhosted.org/packages/ef/b5/62c9d8644c561a0c8e987d7f2259c683ba32c5932502c40c078cf08393ec/nonebot_plugin_lagrange-1.0.7-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "77ce1769f7f013a852f0b118d796f7354dc0b1e193831940f3ec920d25f5d966",
                "md5": "f040513a252516f73c9aea59769dfde0",
                "sha256": "95f72c0e30af65b3951b7af2bd3e3991cef27f15f50eda983400dee491e02772"
            },
            "downloads": -1,
            "filename": "nonebot_plugin_lagrange-1.0.7.tar.gz",
            "has_sig": false,
            "md5_digest": "f040513a252516f73c9aea59769dfde0",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.8",
            "size": 26258,
            "upload_time": "2024-10-06T11:28:16",
            "upload_time_iso_8601": "2024-10-06T11:28:16.302963Z",
            "url": "https://files.pythonhosted.org/packages/77/ce/1769f7f013a852f0b118d796f7354dc0b1e193831940f3ec920d25f5d966/nonebot_plugin_lagrange-1.0.7.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-06 11:28:16",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Lonely-Sails",
    "github_project": "nonebot-plugin-lagrange",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "nonebot_plugin_lagrange"
}
        
Elapsed time: 0.33697s