使用方式
通用:
- 发送 Command
状态或者status
OneBot:
- 向机器人发送戳一戳表情
- 双击机器人头像戳一戳
配置项
配置方式:直接在 NoneBot 全局配置文件中添加以下配置项即可。
server_status_enabled
- 类型:
bool - 默认值:
True - 说明:是否启用服务器状态查看功能
server_status_truncate
- 类型:
bool - 默认值:
True - 说明:是否启用模板变量按需注入功能(节约时间)
server_status_only_superusers
- 类型:
bool - 默认:
True - 说明: 是否仅允许超级用户使用
超级用户需在配置文件中如下配置:
SUPERUSERS=["your qq id"]
server_status_template
- 类型:
str - 默认: 请参考示例
- 说明:发送的消息模板,支持的方法、变量以及类型如下:
- relative_time (
Callable[[datetime], timedelta]): 获取相对时间 - humanize_date (
Callable[[datetime], str]): 人性化时间 - humanize_delta (
Callable[[timedelta], str]): 人性化时间差 - cpu_usage (
float): CPU 使用率 - per_cpu_usage (
List[float]): 每个 CPU 核心的使用率 - memory_usage (
svmem): 内存使用情况,包含 total, available, percent, used, free(, active, inactive, buffers, cached, shared) 属性 - swap_usage (
sswap): 内存使用情况,包含 total, used, free, percent, sin, sout 属性 - disk_usage (
Dict[str, psutil._common.sdiskusage]): 磁盘使用率,包含 total, used, free, percent 属性 - uptime (
datetime): 服务器运行时间 - runtime (
datetime): NoneBot 运行时间 - bot_connect_time (
Dict[str, datetime]): 机器人连接时间
- relative_time (
配置文件示例(默认模板)
SERVER_STATUS_TEMPLATE='
CPU: {{ "%02d" % cpu_usage }}%
Memory: {{ "%02d" % memory_usage.percent }}%
Runtime: {{ runtime | relative_time | humanize_delta }}
{% if swap_usage.total %}Swap: {{ "%02d" % swap_usage.percent }}%{% endif %}
Disk:
{% for name, usage in disk_usage.items() %}
{{ name }}: {{ "%02d" % usage.percent }}%
{% endfor %}
'
Metadata
Release files for nonebot-plugin-status 0.9.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| nonebot_plugin_status-0.9.0.tar.gz | 7.0 kB | Without provenance | Details for nonebot_plugin_status-0.9.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| nonebot_plugin_status-0.9.0-py3-none-any.whl | Python 3 | none | any | Details for nonebot_plugin_status-0.9.0-py3-none-any.whl |
Total release size: 16.0 kB
Release files / nonebot_plugin_status-0.9.0.tar.gz
| Download URL | nonebot_plugin_status-0.9.0.tar.gz |
|---|---|
| Size | 7.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
59dc4c709400409fcdefa5a1f3e2b3ace406509436055dfde39855e74f70a7e3
|
|
BLAKE2b-256 checksum How to use checksums |
6fd9f28453bdcbfc8c95c92dc4e452c7fb53ddfcad6cbf69e2d4959c70bbb79b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.1.1 CPython/3.12.5
|
Release files / nonebot_plugin_status-0.9.0-py3-none-any.whl
| Download URL | nonebot_plugin_status-0.9.0-py3-none-any.whl |
|---|---|
| Size | 9.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7322cc8f360aedfcaffee565f5615f26f05c9314e71f6c503517ed3b7cec23b0
|
|
BLAKE2b-256 checksum How to use checksums |
807c484d1ec641eda18d8c5cc07a51c476061123a115ee37307614d40ee32ff8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.1.1 CPython/3.12.5
|
Security for nonebot-plugin-status 0.9.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.