Skip to main content

nonebot

nonebot-plugin-eventmonitor

✨ 基于 NoneBot2 实现的 监测 QQ 群事件,群荣誉事件的插件 ✨

license pypi python Nonebot2

介绍:

监测群组的以下变动事件:

群成员增加、减少时,自动发送通知

群管理变更时,自动发送通知

被其他成员戳一戳时,自动回复

群成员上传文件时,自动发送通知

群红包被抢完时,自动发送红包运气王

群成员荣誉变更时,发送变更通知

[!CAUTION]

从 v0.3.x 开始,自动更新必须满足以下要求:

1.使用前请确保插件位置移动至: /xxx/awesome-bot/src/plugins/

弃用了使用指令更新插件的功能(目前仅可手动检查更新)

[!TIP]

本插件从 v0.4.0 开始使用 localstore 管理插件数据,若需要使用旧配置,请使用迁移脚本迁移 config.json

若想全新开始,插件已初始化并配置好默认值,请使用指令按需修改

[!IMPORTANT]

手动迁移方法:

原数据目录:/xxx/awesome-bot/data/eventmonitor/config.json

目标位置请移步数据存储

安装方式

nb-cli

nb plugin install nonebot-plugin-eventmonitor

pip

pip install nonebot-plugin-eventmonitor

在’pyproject.toml‘文件中写入

plugins = ["nonebot_plugin_nonebot_plugin_eventmonitor"]

更新:

pip install --upgrade nonebot-plugin-eventmonitor

配置(必填)

config type default example usag
SUPERUSERS set[str] set() SUPERUSERS=["114514"] 机器人超级用户,可以使用权限 SUPERUSER
NICKNAME set[str] set(Bot) NICKNAME=["IKun"] 机器人昵称
event_check_plugin_update bool True event_check_plugin_update = True 是否启用插件检测更新
event_check_txt_img bool False event_check_txt_img= false 是否启用文字转图片
event_chuo_cd int 10 event_chuo_cd= 10 戳一戳的 cd

指令帮助

User: (戳一戳-> bot)
Bot: "请不要戳AI-Md >_<"

SUPERUSER: "/检查event更新"
Bot: "
    ✨插件自动检测更新✨
    插件名称:nonebot-plugin-eventmonitor
    更新日期:xxxx.xx.xx
    版本: 0.3.x -> 0.4.x
	"

SUPERUSER/GROUP_ADMIN/GROUP_OWNER: "/开启 群荣誉检测"
Bot: "群荣誉检测功能已开启喵"

SUPERUSER/GROUP_ADMIN/GROUP_OWNER: "/eventstatus"
Bot: "
	群114514的Event配置状态:
	戳一戳: 开启
	群荣誉检测: 开启
	群文件检测: 开启
	群成员减少检测: 开启
	群成员增加检测: 开启
	管理员变动检测: 开启
	运气王检测: 关闭
	"

SUPERUSER/GROUP_ADMIN/GROUP_OWNER: "/eventhelp"
Bot: "
	指令1:戳一戳(戳一戳bot获取文案)
	指令2:群荣誉监测(检测群聊中龙王,群聊之火,快乐源泉的获得并发送提示,当 bot获得群荣誉时有特殊消息)
	... ...
	"

指令结构帮助:

usage = """
    指令1:戳一戳(戳一戳bot获取文案)
    指令2:群荣誉监测(检测群聊中龙王,群聊之火,快乐源泉的获得并发送提示,当 bot获得群荣誉时有特殊消息)
    指令3:群文件检测(检测所有人发送群文件并发送提示)
    指令4:群成员减少检测(当有人退群时,发送退群消息;当主人/superuser退群有特殊回复)
    指令5:群成员增加检测(当有人入群时,发送入群欢迎,当bot首次入群会乞讨管理,当主人/superuser入群会有特殊回复)
    指令6:管理员变动检测(当新增管理员或取消管理员时发送消息提示,当bot自身被上/下管理时有特殊回复)
    指令7:运气王检测(检测抢红包检测后的运气王并发送提示消息)
    指令8:检查event更新|checkeventupdate
    指令9:event配置|eventstatus
    指令10:开启|关闭文案
    指令11:event指令帮助|eventhelp
    """


json结构(默认值):
{
	"114514": {
        "chuo": true,
        "honor": true,
        "files": true,
        "del_user": true,
        "add_user": true,
        "admin": true,
        "red_package": false
    }
}

TODO

  • 更多的事件检测功能
  • 事件检测功能开关
  • 定时任务
  • 文字转图片发送
  • 插件自动更新

更新日志

  • v0.4.9

    • ✨ 新增群配置一键开关功能
    • 🐛 修复bot退群后产生的异常报错
  • v0.4.8

    • ✨ 使用UTC-8显示时间
  • v0.4.6

    • 🐛 修复依赖顺序加载错误
  • v0.4.5

    • 🐛 修复依赖缺失的错误
  • v0.4.3

    • ✨ 优化入退群消息

    • ✨ 优化了烦人的每天插件更新播报(仅在每次启动 bot 时自动发送)

  • v0.4.2

    • 🐛 修复 nickname 未格式化
  • v0.4.1

    • 🐛 修复配置文件读取错误

    • 🐛 修复版本号读取错误

    • 🐛 修复配置文件读取错误

    • 🐛 修复版本号读取错误

  • v0.4.0

    • ✨ 使用 Localstore 管理插件数据

    • ✨ 重构代码,增加可读性便于维护

    • 💥 弃用插件指令自动更新(仅可手动更新)

  • v0.3.2

    • ✨ 新增插件定时任务
    • ✨ 新增消息文字转图片
  • v0.3.1

    • ♻ 重构项目
    • ✨ 新增插件自动更新
    • 🐛 修复红包运气王无法检测 bug
    • 🐛 修复自动更新时意外报错 bug
  • v0.2.1

    • ✨ 适配插件元数据
    • 🐛 修复 bug
  • v0.2.0

    • 🐛 修复 bot 加群 bugissue6
    • ♻️ 优化提示
  • v0.1.9

    • ✨ 新增功能开关指令:event 状态/event 配置
    • 🐛 修复群文件不能检测 bug(少写一个字母 qwq)
    • ♻️ 优化目录结构
  • v0.1.7

    • ✨ 新增所有功能开关#issue5
    • ✨ 新增权限控制
    • 🐛 修复潜在的 bug
  • v0.1.6

    • 🐛 修复 bug
  • v0.1.5

    • 🐛 修复获取 superusers 数值 bug
    • ♻️ 优化配置文件 #issue4
    • 💥 删除冗余代码
  • v0.1.3

    • 🐛 修复配置文件 bug
  • v0.1.2

    • ✨ 增加戳一戳的文案
    • 🐛 修复 bug
  • v0.1.1

    • 🐛 修复 bug
  • v0.1.0

    • ✨ 新增戳一戳加了 cd(本人觉得功能鸡肋)
    • 🐛 修复管理员变动时 API 报错问题#issue1
    • ♻️ 优化原有的配置模式
  • v0.0.6

    • 🐛 修复了大量的 bug

关于 ISSUE

以下 ISSUE 会被直接关闭

  • 提交 BUG 不使用 Template
  • 询问已知问题
  • 提问找不到重点
  • 重复提问

请注意, 开发者并没有义务回复您的问题. 您应该具备基本的提问技巧。
有关如何提问,请阅读《提问的智慧》

感谢:

感谢@cjladmin的开源代码,在此基础上修改了 bug

以后将持续更新并完善

其他插件

nonebot-plugin-dog(获取舔狗文案,汪!)

nonebot-plugin-hyp(查询 hypixel 玩家数据)

Metadata

Release files for nonebot-plugin-eventmonitor 0.4.9

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-eventmonitor 0.4.9
File Size Uploaded Provenance Actions
nonebot_plugin_eventmonitor-0.4.9.tar.gz 3.1 MB Without provenance Details for nonebot_plugin_eventmonitor-0.4.9.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for nonebot-plugin-eventmonitor 0.4.9
File Interpreter ABI Platform Actions
nonebot_plugin_eventmonitor-0.4.9-py3-none-any.whl Python 3 none any Details for nonebot_plugin_eventmonitor-0.4.9-py3-none-any.whl

Total release size: 6.1 MB

Release files / nonebot_plugin_eventmonitor-0.4.9.tar.gz

Download URL nonebot_plugin_eventmonitor-0.4.9.tar.gz
Size 3.1 MB
Tags Source
SHA-256 checksum
How to use checksums
c1cdf2cdc47fab9314c526499330677b67fea08dd0bd7ece4ff753782ce6378a
BLAKE2b-256 checksum
How to use checksums
e39b26f84bcbd0c7b226d9ce247bba99d1949d43e860561e78fa90ae0ec860ec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release files / nonebot_plugin_eventmonitor-0.4.9-py3-none-any.whl

Download URL nonebot_plugin_eventmonitor-0.4.9-py3-none-any.whl
Size 3.1 MB
Tags Python 3
SHA-256 checksum
How to use checksums
74898f623cce9d9ee4d48381899c0df1df4dfe7b9c62abffb712e7b436acb351
BLAKE2b-256 checksum
How to use checksums
9e58b9b39b700b2466028e1429c0837f5dce7c0d04d992c504ffce098f2f8d22
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Security for nonebot-plugin-eventmonitor 0.4.9

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.

Release history Release notifications | RSS feed

This release

0.4.9 This release

2 release files No provenance

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