Skip to main content

A plugin for restarting NTQQ when bot disconnection

Project description

NoneBotPluginLogo

NoneBotPluginText

nonebot-plugin-ntqq-restart

✨ 一个简易的Bot断连重启NTQQ的插件 ✨

license pypi python

📖 介绍

⚠注意:本插件基于Autoitcmd命令实现NTQQ重启,如果你不是Windows用户,此插件可能无效

此插件主要用于帮助llonebot用户防止NTQQ过期导致的Bot断连的情况

💿 安装

使用 nb-cli 安装 在 nonebot2 项目的根目录下打开命令行, 输入以下指令即可安装
nb plugin install nonebot-plugin-ntqq-restart
使用包管理器安装 在 nonebot2 项目的插件目录下, 打开命令行, 根据你使用的包管理器, 输入相应的安装命令
pip
pip install nonebot-plugin-ntqq-restart
pdm
pdm add nonebot-plugin-ntqq-restart
poetry
poetry add nonebot-plugin-ntqq-restart
conda
conda install nonebot-plugin-ntqq-restart

打开 nonebot2 项目根目录下的 pyproject.toml 文件, 在 [tool.nonebot] 部分追加写入

plugins = ["nonebot-plugin-ntqq-restart"]

⚙️ 配置

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

配置项 必填 默认值 说明
NTQQ_Path NTQQ的.exe文件的完整路径
enable_restart_when_disc True 允许Bot断连后重启NTQQ
enable_login_when_nbrun False 允许nb加载时运行NTQQ
enable_close_qq_when_shutdown False 允许nb关闭时关闭NTQQ
restart_after_disc_time 10 在Bot断连的{int}秒后重启NTQQ
retry_max_time 5 重试NTQQ窗口最小化的最大时间(秒)

🎉 使用

①插件配置

你可以参照配置文件示例文档-配置以配置插件参数

②NTQQ端设置(此两个选项保持打开状态)

NTQQ端设置

③配置后直接运行nonebot即可

nb run

效果图

插件运行效果

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nonebot_plugin_ntqq_restart-0.1.0.tar.gz (5.6 kB view hashes)

Uploaded Source

Built Distribution

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page