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.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | fe11e0fbde56cde12a6f1a50997803a422ea2f085c4e9d496210b03ef9cca585 |
|
MD5 | 712520bda62e09c9dc2792977ade0b88 |
|
BLAKE2b-256 | b159fcdbf5afc0bd36145543f45b897796a56d20635741a28b7c1746c78d74f6 |
Close
Hashes for nonebot_plugin_apscheduler-0.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 76456f625089045c9f2f8943e90c009841afd461b9dc51e9de21169bbd1b2677 |
|
MD5 | 89816b8dfb52538cb79524f5b9bb97a5 |
|
BLAKE2b-256 | 0b79c076fad1fac307f281e9f0f8f4ae84e24f4b2255d204474cfb7d2bbcd730 |