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
File details
Details for the file nonebot-plugin-eventexpiry-0.1.1.tar.gz
.
File metadata
- Download URL: nonebot-plugin-eventexpiry-0.1.1.tar.gz
- Upload date:
- Size: 2.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1a0d9da05d8e924910f1c52a89fa6e3ceb0d70afb792797ad2fd175e6d453490 |
|
MD5 | 40f1961cba4c9d7a89d48ebeca40f3ea |
|
BLAKE2b-256 | 69ff548cd548b1d9062b6e332820a160af3ca5ffb0e5caef0b45ef7c17429fc9 |
File details
Details for the file nonebot_plugin_eventexpiry-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: nonebot_plugin_eventexpiry-0.1.1-py3-none-any.whl
- Upload date:
- Size: 3.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 64abf66abcfd0ea957023d523ad3335053572e653240ee1ea35397e0322f6205 |
|
MD5 | 4209ba3fb6f1dfbbfd53e152cb67d8af |
|
BLAKE2b-256 | 1e517b60e02d5d5aac04e1a31dfd0bafa5206087c862a9ef77a63226e383c515 |