Skip to main content

nonebot-plugin-group-heat

群热度统计插件 for NoneBot2

功能

  • /群热度 - 获取过去30分钟的群热度值,附带 bot 评价
  • /昨日热度图 - 生成昨日每30分钟的热度折线图,并显示平均热度

热度计算规则

消息类型 热度值
文本消息 +0.05
表情包 +0.20
文件(图片/视频/语音等) +0.30
其他消息 不计入
  • 每个统计周期的初始热度为 -10°

评价机制

热度范围 评价
< 0 群成冰块啦,群主快开暖气
0 ~ 10 是冬天到了吗,好冷www
10 ~ 20 温度非常舒适,大家继续努力~
20 ~ 30 群热度达到最佳状态!
30 ~ 39 好热,群主快开空调!
≥ 39 请发送高温补贴喵。。

安装

nb plugin install nonebot-plugin-group-heat
pip install nonebot-plugin-group-heat

使用

在群聊中发送以下命令:

/群热度 - 查询过去30分钟的群热度

/昨日热度图 - 获取昨日热度折线图

配置

默认即装即用,可选配置项(写入 .env 文件):

group_heat_retention_days=7

消息记录保留天数,超过保留期的记录每天自动清理,防止数据库无限膨胀。

数据存储

  • 消息记录与统计数据:SQLite,位于 localstore 插件数据目录
  • 热度图临时文件:渲染后即发即删

0.2.0 更新日志

  • 修复:/群热度 与 /昨日热度图 成功回复后还会追加一条“获取热度失败/生成热度图失败”的报错(finish() 抛出的 FinishedException 被宽泛的 except Exception 捕获所致)
  • 修复:昨日全天无消息时不再输出 -10° 的误导性平线图,正确提示“暂无昨日数据”
  • 修复:Linux 服务器上热度图中文全部显示为方框的问题(自动检测并使用系统可用的中文字体,覆盖 Windows/macOS/Linux 常见字体)
  • 修复:热度图固定文件名导致多个群同时请求时互相覆盖(改为随机文件名,发送后即删)
  • 修复:错误地把发布工具 twine 声明为运行时依赖
  • 新增消息记录保留期(默认 7 天),启动时与每日凌晨自动清理过期记录,防止数据库无限增长
  • 昨日热度统计由 48 次串行查询优化为单次 SQL 分桶聚合;开启 WAL 提升 SQLite 并发性能
  • requires-python 提升至 3.10,新增测试套件(nonebug + pytest,27 例)

开发

pip install -e ".[test]"
pytest

开源协议

MIT

Metadata

Release files for nonebot-plugin-group-heat 0.2.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-group-heat 0.2.0
File Size Uploaded Provenance
nonebot_plugin_group_heat-0.2.0.tar.gz 11.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for nonebot-plugin-group-heat 0.2.0
File Interpreter ABI Platform
nonebot_plugin_group_heat-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 20.7 kB

Release files / nonebot_plugin_group_heat-0.2.0.tar.gz

Download URL nonebot_plugin_group_heat-0.2.0.tar.gz
Size 11.7 kB
Tags Source
SHA-256 checksum
How to use checksums
4cd1d3f47c53bbe733f6f9f37e20c181e6cde3425ed1d86c7e3e8ac25a2b3486
BLAKE2b-256 checksum
How to use checksums
32f358a70b028e87c4a3562032f86cba98151456a2f501c9210badee85fd2c6e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release files / nonebot_plugin_group_heat-0.2.0-py3-none-any.whl

Download URL nonebot_plugin_group_heat-0.2.0-py3-none-any.whl
Size 9.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fa5588a73aef38177c852ea7959350dcea0411410069beea96c4160f92997980
BLAKE2b-256 checksum
How to use checksums
b7447bb8252321116ef5dde20dcaeaf41deaecf7e8b704b483134bd70caa53da
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Security for nonebot-plugin-group-heat 0.2.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.

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