Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

nonebot-plugin-apscheduler

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nonebot-plugin-apscheduler

APScheduler Support for NoneBot2

  • 0.5.0
  • PyPI
  • Socket score

Maintainers
1

nonebot

NoneBot Plugin APScheduler

✨ NoneBot APScheduler 定时任务插件 ✨

license pypi python

使用方式

加载插件后使用 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" }

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc