mirror of
https://github.com/nonebot/nonebot2.git
synced 2025-01-31 15:41:34 +08:00
📝 update scheduler.md @StarHeartHunt (#184)
This commit is contained in:
commit
a739e71df6
@ -96,10 +96,14 @@ scheduler = require('nonebot_plugin_apscheduler').scheduler
|
||||
|
||||
对于大多数情况,我们需要在 `nonebot2` 项目被启动时启动定时任务,则此处设为 `true`
|
||||
|
||||
### 在 `.env` 中添加
|
||||
|
||||
```bash
|
||||
APSCHEDULER_AUTOSTART=true
|
||||
```
|
||||
|
||||
### 在 `bot.py` 中添加
|
||||
|
||||
```python
|
||||
nonebot.init(apscheduler_autostart=True)
|
||||
```
|
||||
@ -116,10 +120,14 @@ nonebot.init(apscheduler_autostart=True)
|
||||
|
||||
> 官方文档在绝大多数时候能提供最准确和最具时效性的指南
|
||||
|
||||
### 在 `.env` 中添加
|
||||
|
||||
```bash
|
||||
APSCHEDULER_CONFIG={"apscheduler.timezone": "Asia/Shanghai"}
|
||||
```
|
||||
|
||||
### 在 `bot.py` 中添加
|
||||
|
||||
```python
|
||||
nonebot.init(apscheduler_config={
|
||||
"apscheduler.timezone": "Asia/Shanghai"
|
||||
|
Loading…
x
Reference in New Issue
Block a user