Skip to main content
logo

等会先

✨ 一个 NoneBot2 插件,让你可以在关机前执行一些操作 ✨

Python PyPI - Version uv Ruff


简体中文 | English

🤔 这是什么

这个插件为 NoneBot2 实现了优雅关机(Graceful Shutdown)(查看 nonebot/nonebot2#2479)
即等待事件处理完毕后再关机
同时它还允许你在关机前运行一些函数,类似于on_shutdown
但是优先级更高,可以保证在bot断连之前执行

💿 安装

🚀 使用 uv

uv add nonebot-plugin-wait-a-minute

🚀 使用 PDM

pdm add nonebot-plugin-wait-a-minute

🚀 使用 poetry

poetry add nonebot-plugin-wait-a-minute

♿️ 如何使用

from nonebot import require, on_command
from nonebot.matcher import Matcher

require('nonebot_plugin_wait_a_minute') # require plugin

from nonebot_plugin_wait_a_minute import graceful, on_shutdown_before

# 优雅关机
@on_command('foo').handle()
@graceful()  # 👈 添加 graceful 装饰器到 handle 装饰器下面
# 或者,你可以使用 @graceful(block=True) 来阻止进入关机等待时运行新的 handle
async def _(matcher: Matcher):
    matcher.send('foo')

# 关机前 hook
@on_shutdown_before
def _():
    # 整点啥()
    ...

# 或者使用 async
@on_shutdown_before
async def _():
    # await 整点啥()
    ...

📄 LICENSE

本项目使用 MIT 许可证开源

Metadata

Release files for nonebot-plugin-wait-a-minute 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nonebot-plugin-wait-a-minute 0.5.0
File Size Uploaded Provenance Actions
nonebot_plugin_wait_a_minute-0.5.0.tar.gz 4.6 kB Without provenance Details for nonebot_plugin_wait_a_minute-0.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for nonebot-plugin-wait-a-minute 0.5.0
File Interpreter ABI Platform Actions
nonebot_plugin_wait_a_minute-0.5.0-py3-none-any.whl Python 3 none any Details for nonebot_plugin_wait_a_minute-0.5.0-py3-none-any.whl

Total release size: 9.5 kB

Release files / nonebot_plugin_wait_a_minute-0.5.0.tar.gz

Download URL nonebot_plugin_wait_a_minute-0.5.0.tar.gz
Size 4.6 kB
Tags Source
SHA-256 checksum
How to use checksums
cb4cd59d84104c42dc584a7e06632aa6f8030125bc80125eb6aef241a48cd61b
BLAKE2b-256 checksum
How to use checksums
96411ba835a5f8d965400df77c3f9364509a436aac649f740a53354fdafca517
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / nonebot_plugin_wait_a_minute-0.5.0-py3-none-any.whl

Download URL nonebot_plugin_wait_a_minute-0.5.0-py3-none-any.whl
Size 4.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
28d930615390411e94f3e6f9b96d29968bc3ad96e777cf8ff5ec8fcb6e89b045
BLAKE2b-256 checksum
How to use checksums
f6b3c7cc8f7c74a76f7e6f55ffe61aa692738d23f98dae1243d6f9ec585e3be4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for nonebot-plugin-wait-a-minute 0.5.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page