APScheduler Support for NoneBot2
Project description
NoneBot Plugin APScheduler
✨ NoneBot APScheduler 定时任务插件 ✨
使用方式
加载插件后使用 require
获取 scheduler
对象(请注意插件加载顺序)
from nonebot import require
require("nonebot_plugin_apscheduler")
from nonebot_plugin_apscheduler import scheduler
@scheduler.scheduled_job("cron", hour="*/2", id="xxx", args=[1], kwargs={"arg2": 2})
async def run_every_2_hour(arg1, arg2):
pass
scheduler.add_job(run_every_day_from_program_start, "interval", days=1, id="xxx")
配置项
apscheduler_autostart
是否自动启动 scheduler
apscheduler_log_level
int
类型日志等级
WARNING
=30
(默认)INFO
=20
DEBUG
=10
(只有在开启 nonebot 的 debug 模式才会显示 debug 日志)
apscheduler_config
apscheduler
的相关配置。参考 配置 scheduler, 配置参数
配置需要包含 prefix: apscheduler.
默认配置:
{ "apscheduler.timezone": "Asia/Shanghai" }
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_apscheduler-0.3.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7c41cc1d49ea6af7c4518c72cd15f8c2f549071b8bc8bfc4b21fbdd0a4875cfd |
|
MD5 | 40a9af25fe3d68bd8b33f33a56284133 |
|
BLAKE2b-256 | e6d85194c1642c9f13f52e012c5e2d55263760532040e685ef22743e8cf53523 |
Close
Hashes for nonebot_plugin_apscheduler-0.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ec5e0267293fc9803e543c6086d3e109ac87bf6dccea5473d219cad826238aae |
|
MD5 | 19ab1afb6c825d38dd890e70ace1afe7 |
|
BLAKE2b-256 | 6ecc3d994a7bd814f24981cc05e44772969f5f89c46972765b5f56a6e3a44ecc |