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.5.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6c0230e99765f275dc83d6639ff33bd6f71203fa10cd1b8a204b0f95530cda86 |
|
MD5 | 8b1fa960b7f96ee04008fb3b5cdf49ab |
|
BLAKE2b-256 | d653019bfea58c506c0166d8ef77959fd8676019469d0d3d8e135ae8f1a4b772 |
Close
Hashes for nonebot_plugin_apscheduler-0.5.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8b99b5ee60c4bc195d4df2fd27dab3d6963691e3332f6cee31a06eb4277c307f |
|
MD5 | ddbfd42a33ddda1800ba890c9a378515 |
|
BLAKE2b-256 | fbf48a3334dcd91e368d2f4e2b21f4805ac70b5dd8a1f9dac94fea5269e82bd3 |