📝 refactor dependency-injection documents (#791)

* 📝 update dependency-injection docs

* 🚨 auto fix by pre-commit hooks

* 📝 fix some indent

* 📝 fix description

* 📝 add create callable in DI docs

* 🚨 auto fix by pre-commit hooks

* 📝 delete unused params in docs

* 📝 update di docs

* 🚨 auto fix by pre-commit hooks

* 📝 update di doc

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: yanyongyu <42488585+yanyongyu@users.noreply.github.com>
This commit is contained in:
AkiraXie
2022-02-14 17:26:55 +08:00
committed by GitHub
parent 9a53b415d9
commit 925886534c
6 changed files with 220 additions and 95 deletions

View File

@ -56,7 +56,7 @@ async def _(bot: Bot, event: PrivateMessageEvent):
## 进阶
事件处理函数重载机制同样支持被 `matcher.got` 等装饰器装饰的函数。 例如:
事件处理函数重载机制同样支持被 `matcher.got` 等装饰器装饰的函数。例如:
```python
@matcher.got("key1", prompt="群事件提问")
@ -70,3 +70,7 @@ async def _(bot: Bot, event: PrivateMessageEvent):
```
只有触发事件符合的函数才会触发装饰器。
:::warning 注意
bot 和 event 参数具有最高的检查优先级,因此,如果参数类型不符合,所有的依赖项 `Depends` 等都不会被执行。
:::