NoneBot2 event expiry filter
Project description
📖 介绍
检查每个事件的产生时间,如果超过指定的过期时间,那么这个事件会被忽略。
可能的应用场景:
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秒 |
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for nonebot-plugin-eventexpiry-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8467e2e1d67a956af002cc282a1b4c38e0a646a8a6941bfb22fa12f950112848 |
|
MD5 | d40f1e56e5650fb9ec67dfe550cad48f |
|
BLAKE2b-256 | 95585e7663dead4940a0090a1e4a9fe06f2e8ca9a9389fbd77725cf92a67808b |
Close
Hashes for nonebot_plugin_eventexpiry-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f55ef6013ff2b015d713f9366c8b28c634a22bbf0720b9e5d77ecf0c40f15150 |
|
MD5 | c338aa0b0ad6bfe54ba1f4b5cbe75c49 |
|
BLAKE2b-256 | bfb124ef4e42fbc67306720fc1793fbd0f37b03af44ff1dfc92128e4122de97d |