🔀 Merge pull request #435

Docs: scheduler docs typo
This commit is contained in:
Ju4tCode 2021-07-11 15:21:51 +08:00 committed by GitHub
commit a740a9cfea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -47,9 +47,9 @@ poetry add nonebot-plugin-apscheduler
```python ```python
from nonebot import require from nonebot import require
scheduler = require('nonebot_plugin_apscheduler').scheduler scheduler = require("nonebot_plugin_apscheduler").scheduler
@scheduler.scheduled_job('cron', hour='*/2', id='xxx', args=[1], kwargs={arg2: 2}) @scheduler.scheduled_job("cron", hour="*/2", id="xxx", args=[1], kwargs={"arg2": 2})
async def run_every_2_hour(arg1, arg2): async def run_every_2_hour(arg1, arg2):
pass pass
@ -71,7 +71,7 @@ scheduler.add_job(run_every_day_from_program_start, "interval", days=1, id="xxx"
```python ```python
from nonebot import require from nonebot import require
scheduler = require('nonebot_plugin_apscheduler').scheduler scheduler = require("nonebot_plugin_apscheduler").scheduler
``` ```
### 编写定时任务 ### 编写定时任务