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.2.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7b63e99a611b657533b48fcf1f8c6627c18c2eb3fa820a906cd4ec4666c0ceb0 |
|
MD5 | dcff2d77b153d7366491a73602dd1e8c |
|
BLAKE2b-256 | 773411d54a11bf7c6256bf61598e9f2b93df6bf4b1cc2b58f26ff1140539be81 |
Close
Hashes for nonebot_plugin_apscheduler-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9285ee84ca1cfa4db73c86cedb5911bbbd25a21ec0cd5f22447cd12f89e48fb4 |
|
MD5 | 61778418d81a6440b0df76a28bef10db |
|
BLAKE2b-256 | b4e008455966af13f69ee39b14ac345f77c5a7c5b2fbd671b0182a18e195173f |