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

⚠使用警告

①本插件仅适用于Windows用户!(原理上使用了WinAPIWin命令

②使用本插件时,你的NTQQ进程需要全程由本插件保管!

③本插件只适用于NTQQ登录过期的情况(此情况仍旧可以重启后正常登录),
对于其他情况(包括但不限于账号冻结版本过低),无法提供有效的解决方案 !

🎉来点甜点

本插件V2.0已经实现独立进程NTQQ存活, 不会再有所有NTQQ进程误杀的情况!

📖 介绍

此插件主要用于帮助llonebot用户长时间运行机器人的情况下, 遇到的NTQQ登录过期导致Bot下线的情况。

Bot断连时,本插件会自动重启NTQQ并窗口最小化。(账号登录靠NTQQ自带的自动登录

💿 安装

使用 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 True 启用此插件
Disable_Restart_When_Debug False 日志等级为Debug时禁用此插件
Restart_Time 10 在Bot断连的{int}秒后重启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.2.2.tar.gz (9.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nonebot_plugin_ntqq_restart-0.2.2-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

Details for the file nonebot_plugin_ntqq_restart-0.2.2.tar.gz.

File metadata

File hashes

Hashes for nonebot_plugin_ntqq_restart-0.2.2.tar.gz
Algorithm Hash digest
SHA256 b2be0c75d40e02f8d14b01a4ee81022d883ff23cbcbef0d4169efbbfeda609f1
MD5 f9fcb8cba49b43222c0f51b9ac9ee18f
BLAKE2b-256 c07e44809a68f2bd0f37d39c38bc49a3759f97103512f3f242ef5b53d326c797

See more details on using hashes here.

File details

Details for the file nonebot_plugin_ntqq_restart-0.2.2-py3-none-any.whl.

File metadata

File hashes

Hashes for nonebot_plugin_ntqq_restart-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 191b0132fc48c91df485f387db821d5eac23b32132ff817930314c9a62588b5b
MD5 a25329d747990c6846d186f461728a76
BLAKE2b-256 a43192111d91c87570f92cc7a962c13326af4ead1aacfc9a1550e2f58f0c776e

See more details on using hashes here.

Supported by

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