{"id":20390281,"url":"https://github.com/nonebot/plugin-status","last_synced_at":"2025-04-12T11:21:13.412Z","repository":{"id":225761743,"uuid":"766765749","full_name":"nonebot/plugin-status","owner":"nonebot","description":null,"archived":false,"fork":false,"pushed_at":"2024-03-04T06:56:14.000Z","size":85,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-04-14T09:04:13.462Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nonebot.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null},"funding":{"open_collective":"nonebot","custom":["https://afdian.net/@nonebot"]}},"created_at":"2024-03-04T04:43:57.000Z","updated_at":"2024-04-15T15:38:13.833Z","dependencies_parsed_at":"2024-03-04T06:50:25.677Z","dependency_job_id":"133f49b4-b10c-45f4-9c36-2fc82f7d4f80","html_url":"https://github.com/nonebot/plugin-status","commit_stats":{"total_commits":46,"total_committers":4,"mean_commits":11.5,"dds":"0.30434782608695654","last_synced_commit":"24ce25e1163814750419db49e69aece0faa164dd"},"previous_names":["nonebot/plugin-status"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nonebot%2Fplugin-status","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nonebot%2Fplugin-status/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nonebot%2Fplugin-status/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nonebot%2Fplugin-status/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nonebot","download_url":"https://codeload.github.com/nonebot/plugin-status/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248558129,"owners_count":21124223,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-15T03:23:57.937Z","updated_at":"2025-04-12T11:21:13.393Z","avatar_url":"https://github.com/nonebot.png","language":"Python","funding_links":["https://opencollective.com/nonebot","https://afdian.net/@nonebot"],"categories":[],"sub_categories":[],"readme":"\u003c!--\n * @Author         : yanyongyu\n * @Date           : 2020-11-15 14:40:25\n * @LastEditors    : yanyongyu\n * @LastEditTime   : 2023-10-02 17:14:11\n * @Description    : None\n * @GitHub         : https://github.com/yanyongyu\n--\u003e\n\n\u003c!-- markdownlint-disable MD033 MD036 MD041 --\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://nonebot.dev/\"\u003e\u003cimg src=\"https://nonebot.dev/logo.png\" width=\"200\" height=\"200\" alt=\"nonebot\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n# nonebot-plugin-status\n\n_✨ NoneBot 服务器状态（CPU, Memory, Disk Usage）查看插件 ✨_\n\n\u003c/div\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://raw.githubusercontent.com/cscs181/QQ-Github-Bot/master/LICENSE\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/license/cscs181/QQ-Github-Bot.svg\" alt=\"license\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://pypi.python.org/pypi/nonebot-plugin-status\"\u003e\n    \u003cimg src=\"https://img.shields.io/pypi/v/nonebot-plugin-status.svg\" alt=\"pypi\"\u003e\n  \u003c/a\u003e\n  \u003cimg src=\"https://img.shields.io/badge/python-3.8+-blue.svg\" alt=\"python\"\u003e\n\u003c/p\u003e\n\n## 使用方式\n\n通用:\n\n- 发送 Command `状态` 或者 `status`\n\nOneBot:\n\n- 向机器人发送戳一戳表情\n- 双击机器人头像戳一戳\n\n## 配置项\n\n\u003e [!WARNING]\n\u003e GitHub 仓库中的文档为最新 DEV 版本，配置方式请参考 [PyPI](https://pypi.org/project/nonebot-plugin-status/) 上的文档。\n\n配置方式：直接在 NoneBot 全局配置文件中添加以下配置项即可。\n\n### server_status_enabled\n\n- 类型：`bool`\n- 默认值：`True`\n- 说明：是否启用服务器状态查看功能\n\n### server_status_truncate\n\n- 类型：`bool`\n- 默认值：`True`\n- 说明：是否启用模板变量按需注入功能（节约时间）\n\n### server_status_only_superusers\n\n- 类型: `bool`\n- 默认: `True`\n- 说明: 是否仅允许超级用户使用\n\n\u003e 超级用户需在配置文件中如下配置:\n\u003e\n\u003e ```dotenv\n\u003e SUPERUSERS=[\"your qq id\"]\n\u003e ```\n\n### server_status_template\n\n- 类型: `str`\n- 默认: 请参考示例\n- 说明：发送的消息模板，支持的方法、变量以及类型如下：\n  - relative_time (`Callable[[datetime], timedelta]`): 获取相对时间\n  - humanize_date (`Callable[[datetime], str]`): [人性化时间](https://python-humanize.readthedocs.io/en/latest/time/#humanize.time.naturaldate)\n  - humanize_delta (`Callable[[timedelta], str]`): [人性化时间差](https://python-humanize.readthedocs.io/en/latest/time/#humanize.time.precisiondelta)\n  - cpu_usage (`float`): CPU 使用率\n  - per_cpu_usage (`List[float]`): 每个 CPU 核心的使用率\n  - memory_usage (`svmem`): 内存使用情况，包含 total, available, percent, used, free(, active, inactive, buffers, cached, shared) 属性\n  - swap_usage (`sswap`): 内存使用情况，包含 total, used, free, percent, sin, sout 属性\n  - disk_usage (`Dict[str, psutil._common.sdiskusage]`): 磁盘使用率，包含 total, used, free, percent 属性\n  - uptime (`datetime`): 服务器运行时间\n  - runtime (`datetime`): NoneBot 运行时间\n  - bot_connect_time (`Dict[str, datetime]`): 机器人连接时间\n\n配置文件示例（默认模板）\n\n```dotenv\nSERVER_STATUS_TEMPLATE='\nCPU: {{ \"%02d\" % cpu_usage }}%\nMemory: {{ \"%02d\" % memory_usage.percent }}%\nRuntime: {{ runtime | relative_time | humanize_delta }}\n{% if swap_usage.total %}Swap: {{ \"%02d\" % swap_usage.percent }}%{% endif %}\nDisk:\n{% for name, usage in disk_usage.items() %}\n  {{ name }}: {{ \"%02d\" % usage.percent }}%\n{% endfor %}\n'\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnonebot%2Fplugin-status","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnonebot%2Fplugin-status","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnonebot%2Fplugin-status/lists"}