Skip to content

A-kirami/nonebot-plugin-eventexpiry

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NoneBotPluginLogo

NoneBotPluginText

nonebot-plugin-eventexpiry

✨ 自动过滤过期事件 ✨

license pypi python

📖 介绍

检查每个事件的产生时间,如果超过指定的过期时间,那么这个事件会被忽略。

可能的应用场景:

go-cqhttp 在未连接时会将所有事件积压,待连接建立后全部上报,而这些事件可能已经过时,你可以使用本插件来清理这些事件。

💿 安装

使用 nb-cli 安装 在 nonebot2 项目的根目录下打开命令行, 输入以下指令即可安装
nb plugin install nonebot-plugin-eventexpiry
使用包管理器安装 在 nonebot2 项目的插件目录下, 打开命令行, 根据你使用的包管理器, 输入相应的安装命令
pip
pip install nonebot-plugin-eventexpiry
pdm
pdm add nonebot-plugin-eventexpiry
poetry
poetry add nonebot-plugin-eventexpiry
conda
conda install nonebot-plugin-eventexpiry

打开 nonebot2 项目根目录下的 pyproject.toml 文件, 在 [tool.nonebot] 部分追加写入

plugins = ["nonebot_plugin_eventexpiry"]

⚙️ 配置

在 nonebot2 项目的.env文件中添加下表中的必填配置

配置项 必填 默认值 说明
EVENTEXPIRY_EXPIRE 30 指示插件应忽略多少秒前的事件,默认30秒

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages