APScheduler Support for NoneBot2
Project description
NoneBot Plugin APScheduler
✨ NoneBot APScheduler 定时任务插件 ✨
使用方式
加载插件后使用 require
获取 scheduler
对象(请注意插件加载顺序)
from nonebot import require
scheduler = require("nonebot_plugin_apscheduler").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.1.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7541cfb2af48f244b74b66fd14f6486ef39a6d79f17b15c31cf1c6ad9a9632ca |
|
MD5 | 2bf9fbcb6290e699facc59c135143c8f |
|
BLAKE2b-256 | 863236ae5f500b5109ae53ae2adf59b271d6f004155b09c006aaf44949d0c67b |
Close
Hashes for nonebot_plugin_apscheduler-0.1.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c904c344c22c8fb2bafec9875ee195b7be7d1f0b758a04e96da6758d62cf4e83 |
|
MD5 | d715774a9ba6bfd10358351e76cf1b24 |
|
BLAKE2b-256 | 3aa5f2eec6edf97bbd9a6fc09d78b10dabf87d5573b6780a73de2971f108c8fd |