Compare commits

...

84 Commits

Author SHA1 Message Date
ericzhang-debug
6471eaff94 🍻 publish plugin nonebot-plugin-msglogger (#3714) 2025-10-08 22:52:25 +08:00
noneflow[bot]
76a38ced81 📝 Update changelog
Some checks failed
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.9) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.10) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.11) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.12) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.13) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.9) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.10) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.11) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.12) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.13) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.9) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.10) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.11) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.12) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.13) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.9) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.10) (push) Failing after 3s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.11) (push) Failing after 3s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.12) (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.13) (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.9) (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.10) (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.11) (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.12) (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.13) (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.9) (push) Failing after 2s
Pyright Lint / Pyright Lint (pydantic-v1) (push) Failing after 2s
Pyright Lint / Pyright Lint (pydantic-v2) (push) Failing after 2s
Ruff Lint / Ruff Lint (push) Failing after 2s
Site Deploy / publish (push) Failing after 2s
2025-10-08 12:47:12 +00:00
StarHeart
6c130cb45f 👷 CI: 严格约束 test_depend CPython 版本范围 (#3713)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-10-08 20:45:52 +08:00
noneflow[bot]
f0bc69bd36 📝 Update changelog 2025-10-08 12:29:01 +00:00
fllesser
f1d867e588 🍻 publish plugin 链接分享自动解析 (#3705) 2025-10-08 12:27:44 +00:00
noneflow[bot]
fa0bfa7346 📝 Update changelog
Some checks failed
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.9) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.10) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.11) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.12) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.12) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.13) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.13) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.10) (push) Failing after 3s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.11) (push) Failing after 3s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.12) (push) Failing after 3s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.9) (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.13) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.9) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.10) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.11) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.9) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.10) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.11) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.12) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.9) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.13) (push) Failing after 3s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.10) (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.11) (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.12) (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.13) (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.9) (push) Failing after 2s
Pyright Lint / Pyright Lint (pydantic-v1) (push) Failing after 2s
Pyright Lint / Pyright Lint (pydantic-v2) (push) Failing after 2s
Ruff Lint / Ruff Lint (push) Failing after 2s
Site Deploy / publish (push) Failing after 2s
2025-10-08 09:40:33 +00:00
worldmozara
29720bada8 Feature: 更新 NB-CLI 新版插件加载格式与文档 (#3614) 2025-10-08 17:39:11 +08:00
dependabot[bot]
67e5126f6a ⬆️ Bump astral-sh/setup-uv from 6 to 7 in /.github/actions/setup-python in the actions group (#3710)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Ju4tCode <42488585+yanyongyu@users.noreply.github.com>
2025-10-08 14:14:36 +08:00
noneflow[bot]
0212247694 📝 Update changelog 2025-10-08 03:41:31 +00:00
Nyuan Zhang
34aef36bac 📝 Docs: 添加 htmlkit 文档至最佳实践 (#3682)
Co-authored-by: StarHeart <starheart233@gmail.com>
2025-10-08 11:40:22 +08:00
pre-commit-ci[bot]
8ea2d4b81f ⬆️ auto update by pre-commit hooks (#3709)
Some checks failed
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.10) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.10) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.11) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.12) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.13) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.9) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.10) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.11) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.12) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.13) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.9) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.10) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.11) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.12) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.13) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.9) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.10) (push) Failing after 3s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.11) (push) Failing after 3s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.12) (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.13) (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.9) (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.10) (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.11) (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.12) (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.13) (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.9) (push) Failing after 2s
Pyright Lint / Pyright Lint (pydantic-v1) (push) Failing after 2s
Pyright Lint / Pyright Lint (pydantic-v2) (push) Failing after 2s
Ruff Lint / Ruff Lint (push) Failing after 2s
Site Deploy / publish (push) Failing after 2s
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-10-08 11:02:18 +08:00
noneflow[bot]
c9c50fa0eb 📝 Update changelog
Some checks failed
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.9) (push) Failing after 3s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.10) (push) Failing after 3s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.11) (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.12) (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.13) (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.9) (push) Failing after 2s
Pyright Lint / Pyright Lint (pydantic-v1) (push) Failing after 2s
Pyright Lint / Pyright Lint (pydantic-v2) (push) Failing after 2s
Ruff Lint / Ruff Lint (push) Failing after 2s
Site Deploy / publish (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.13) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.13) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.13) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.13) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.9) (push) Has been cancelled
2025-10-06 09:32:21 +00:00
padoru233
9dcb734547 🍻 publish plugin 怪物猎人集会码插件 (#3683) 2025-10-06 09:31:03 +00:00
noneflow[bot]
577d27ef5f 📝 Update changelog
Some checks failed
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.9) (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.10) (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.11) (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.12) (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.13) (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.9) (push) Failing after 2s
Pyright Lint / Pyright Lint (pydantic-v1) (push) Failing after 2s
Pyright Lint / Pyright Lint (pydantic-v2) (push) Failing after 2s
Ruff Lint / Ruff Lint (push) Failing after 2s
Site Deploy / publish (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.13) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.13) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.13) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.13) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.12) (push) Has been cancelled
2025-10-01 14:31:52 +00:00
BlueGlassBlock
a6687dc887 🍻 publish plugin nonebot-plugin-htmlkit (#3694) 2025-10-01 14:30:32 +00:00
noneflow[bot]
a27e9b078c 📝 Update changelog
Some checks failed
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.9) (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.10) (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.11) (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.12) (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.13) (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.9) (push) Failing after 2s
Pyright Lint / Pyright Lint (pydantic-v1) (push) Failing after 2s
Pyright Lint / Pyright Lint (pydantic-v2) (push) Failing after 2s
Ruff Lint / Ruff Lint (push) Failing after 2s
Site Deploy / publish (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.13) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.13) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.13) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.13) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.9) (push) Has been cancelled
2025-09-26 14:19:21 +00:00
KomoriDev
d75d29b954 🍻 publish plugin 言令 (#3674) 2025-09-26 14:15:58 +00:00
noneflow[bot]
6ad289274f 📝 Update changelog
Some checks failed
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.9) (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.10) (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.11) (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.12) (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.13) (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.9) (push) Failing after 2s
Pyright Lint / Pyright Lint (pydantic-v1) (push) Failing after 2s
Pyright Lint / Pyright Lint (pydantic-v2) (push) Failing after 2s
Ruff Lint / Ruff Lint (push) Failing after 2s
Site Deploy / publish (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.13) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.13) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.13) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.13) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.9) (push) Has been cancelled
2025-09-26 03:48:15 +00:00
Tabris-ZX
7d87244b3e 🍻 publish plugin 算法比赛助手 (#3663) 2025-09-26 03:47:02 +00:00
noneflow[bot]
fd0ca2d883 📝 Update changelog 2025-09-26 03:05:42 +00:00
zanderzhng
45c96cad1a 🍻 publish plugin 复盘打卡 (#3680) 2025-09-26 03:04:23 +00:00
uitok
8d4822ed21 🍻 publish plugin DMP 饥荒管理平台机器人 (#3615)
Some checks failed
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.9) (push) Failing after 20s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.10) (push) Failing after 20s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.11) (push) Failing after 20s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.12) (push) Failing after 20s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.13) (push) Failing after 19s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.9) (push) Failing after 19s
Pyright Lint / Pyright Lint (pydantic-v1) (push) Failing after 19s
Pyright Lint / Pyright Lint (pydantic-v2) (push) Failing after 19s
Ruff Lint / Ruff Lint (push) Failing after 18s
Site Deploy / publish (push) Failing after 18s
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.13) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.13) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.13) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.13) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.9) (push) Has been cancelled
2025-09-24 14:24:24 +00:00
noneflow[bot]
e5194c715b 📝 Update changelog
Some checks failed
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.9) (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.10) (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.11) (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.12) (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.13) (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.9) (push) Failing after 2s
Pyright Lint / Pyright Lint (pydantic-v1) (push) Failing after 2s
Pyright Lint / Pyright Lint (pydantic-v2) (push) Failing after 2s
Ruff Lint / Ruff Lint (push) Failing after 3s
Site Deploy / publish (push) Failing after 3s
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.13) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.13) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.13) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.13) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.9) (push) Has been cancelled
2025-09-17 02:25:26 +00:00
Hanserprpr
f532573458 🍻 publish plugin 谁是卧底小游戏 (#3628) 2025-09-17 02:24:21 +00:00
noneflow[bot]
c9c8e4d106 📝 Update changelog
Some checks failed
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.9) (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.10) (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.11) (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.12) (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.13) (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.9) (push) Failing after 2s
Pyright Lint / Pyright Lint (pydantic-v1) (push) Failing after 2s
Pyright Lint / Pyright Lint (pydantic-v2) (push) Failing after 2s
Ruff Lint / Ruff Lint (push) Failing after 2s
Site Deploy / publish (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.13) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.13) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.13) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.13) (push) Has been cancelled
2025-09-09 04:09:27 +00:00
fllesser
58f3325b2c 🍻 publish plugin 夸克自动转存 (#3670) 2025-09-09 04:08:13 +00:00
noneflow[bot]
456f923cd2 📝 Update changelog
Some checks failed
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.11) (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.11) (push) Failing after 6s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.13) (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.9) (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.9) (push) Failing after 6s
Pyright Lint / Pyright Lint (pydantic-v2) (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.12) (push) Failing after 5s
Ruff Lint / Ruff Lint (push) Failing after 2s
Pyright Lint / Pyright Lint (pydantic-v1) (push) Failing after 5s
Site Deploy / publish (push) Failing after 5s
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.13) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.13) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.13) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.13) (push) Has been cancelled
2025-09-07 14:30:51 +00:00
SuperWaterGod
66d70b5675 🍻 publish plugin 禁止复读 (#3643) 2025-09-07 14:29:37 +00:00
noneflow[bot]
c7e57a070a 📝 Update changelog
Some checks failed
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.11) (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.11) (push) Failing after 6s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.13) (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.9) (push) Failing after 2s
Pyright Lint / Pyright Lint (pydantic-v2) (push) Failing after 2s
Ruff Lint / Ruff Lint (push) Failing after 2s
Pyright Lint / Pyright Lint (pydantic-v1) (push) Failing after 5s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.12) (push) Failing after 9s
Site Deploy / publish (push) Failing after 8s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.9) (push) Failing after 17s
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.13) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.13) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.13) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.13) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.11) (push) Has been cancelled
2025-09-07 03:03:57 +00:00
captain-wangrun-cn
948f96d0f2 🍻 publish plugin 蔚蓝档案今日运势 (#3652) 2025-09-07 03:02:38 +00:00
noneflow[bot]
d67238194f 📝 Update changelog
Some checks failed
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.11) (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.13) (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.9) (push) Failing after 2s
Pyright Lint / Pyright Lint (pydantic-v2) (push) Failing after 2s
Ruff Lint / Ruff Lint (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.11) (push) Failing after 1m34s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.9) (push) Failing after 2m2s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.12) (push) Failing after 3m30s
Pyright Lint / Pyright Lint (pydantic-v1) (push) Failing after 3m58s
Site Deploy / publish (push) Failing after 4m26s
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.13) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.13) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.13) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.13) (push) Has been cancelled
2025-09-06 15:32:50 +00:00
Tosd0
3c53260f07 🍻 publish plugin 分布式黑名单插件 (#3654) 2025-09-06 15:31:49 +00:00
noneflow[bot]
581ba52fcb 📝 Update changelog
Some checks failed
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.11) (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.13) (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.9) (push) Failing after 2s
Pyright Lint / Pyright Lint (pydantic-v2) (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.11) (push) Failing after 9s
Ruff Lint / Ruff Lint (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.12) (push) Failing after 9s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.9) (push) Failing after 12s
Pyright Lint / Pyright Lint (pydantic-v1) (push) Failing after 9s
Site Deploy / publish (push) Failing after 9s
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.13) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.13) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.13) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.13) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.9) (push) Has been cancelled
2025-09-06 10:25:32 +00:00
padoru233
f7d385be93 🍻 publish plugin 图片手办化 (#3661) 2025-09-06 10:24:21 +00:00
dependabot[bot]
f4a31a6404 ⬆️ Bump actions/github-script from 7 to 8 in the actions group (#3669)
Some checks failed
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.11) (push) Failing after 6s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.11) (push) Failing after 3s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.13) (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.9) (push) Failing after 6s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.9) (push) Failing after 2s
Pyright Lint / Pyright Lint (pydantic-v2) (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.12) (push) Failing after 5s
Ruff Lint / Ruff Lint (push) Failing after 2s
Pyright Lint / Pyright Lint (pydantic-v1) (push) Failing after 5s
Site Deploy / publish (push) Failing after 4s
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.13) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.13) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.13) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.13) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.9) (push) Has been cancelled
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-05 21:07:22 +08:00
noneflow[bot]
e7f0a2466a 📝 Update changelog
Some checks failed
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.11) (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.11) (push) Failing after 6s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.13) (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.9) (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.9) (push) Failing after 6s
Pyright Lint / Pyright Lint (pydantic-v2) (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.12) (push) Failing after 5s
Ruff Lint / Ruff Lint (push) Failing after 2s
Pyright Lint / Pyright Lint (pydantic-v1) (push) Failing after 5s
Site Deploy / publish (push) Failing after 4s
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.13) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.13) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.13) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.13) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.9) (push) Has been cancelled
2025-09-04 13:06:25 +00:00
StarHeart
d228c3665c 👷 CI: 升级文档构建 node 版本 (#3668) 2025-09-04 21:05:07 +08:00
dependabot[bot]
fc6aca5394 ⬆️ Bump actions/setup-node (#3667)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-04 19:18:42 +08:00
noneflow[bot]
8f62306086 📝 Update changelog
Some checks failed
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.10) (push) Failing after 3s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.13) (push) Failing after 6s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.12) (push) Failing after 3s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.13) (push) Failing after 3s
Pyright Lint / Pyright Lint (pydantic-v1) (push) Failing after 3s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.11) (push) Failing after 7s
Pyright Lint / Pyright Lint (pydantic-v2) (push) Failing after 3s
Site Deploy / publish (push) Failing after 3s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.9) (push) Failing after 6s
Ruff Lint / Ruff Lint (push) Failing after 6s
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.13) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.13) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.13) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.13) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.9) (push) Has been cancelled
2025-09-02 03:21:40 +00:00
006lp
10048d401a 🍻 publish plugin Akash Image Generator (#3650) 2025-09-02 03:20:22 +00:00
pre-commit-ci[bot]
3043b1e2f2 ⬆️ auto update by pre-commit hooks (#3666)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-09-02 10:53:16 +08:00
noneflow[bot]
debdb55955 📝 Update changelog
Some checks failed
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.9) (push) Failing after 4s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.11) (push) Failing after 4s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.12) (push) Failing after 4s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.10) (push) Failing after 7s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.9) (push) Failing after 4s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.13) (push) Failing after 6s
Pyright Lint / Pyright Lint (pydantic-v1) (push) Failing after 4s
Ruff Lint / Ruff Lint (push) Failing after 4s
Site Deploy / publish (push) Failing after 3s
Pyright Lint / Pyright Lint (pydantic-v2) (push) Failing after 5s
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.13) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.13) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.13) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.13) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.9) (push) Has been cancelled
2025-08-31 15:34:21 +00:00
XieXiLin
da7e914c74 📝 Docs: 修复 userinfo 插件链接 (#3660) 2025-08-31 23:33:06 +08:00
noneflow[bot]
e854d0ddf8 📝 Update changelog 2025-08-31 09:58:56 +00:00
hlfzsi
04465ea688 🍻 publish plugin 让我看看!! (#3647) 2025-08-31 09:57:49 +00:00
noneflow[bot]
24c862843a 📝 Update changelog
Some checks failed
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.11) (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.13) (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.9) (push) Failing after 2s
Pyright Lint / Pyright Lint (pydantic-v2) (push) Failing after 2s
Ruff Lint / Ruff Lint (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.9) (push) Failing after 34s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.12) (push) Failing after 1m2s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.11) (push) Failing after 1m36s
Pyright Lint / Pyright Lint (pydantic-v1) (push) Failing after 2m0s
Site Deploy / publish (push) Failing after 2m28s
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.13) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.13) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.13) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.13) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.9) (push) Has been cancelled
2025-08-28 11:37:54 +00:00
DZYCD
c85b4bcee3 🍻 publish plugin ImageLibrary (#3619) 2025-08-28 11:36:38 +00:00
noneflow[bot]
34c99bd2c0 📝 Update changelog
Some checks failed
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.11) (push) Failing after 4s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.13) (push) Failing after 4s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.9) (push) Failing after 4s
Pyright Lint / Pyright Lint (pydantic-v2) (push) Failing after 3s
Ruff Lint / Ruff Lint (push) Failing after 3s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.11) (push) Failing after 34s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.9) (push) Failing after 1m1s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.12) (push) Failing after 1m29s
Pyright Lint / Pyright Lint (pydantic-v1) (push) Failing after 1m57s
Site Deploy / publish (push) Failing after 2m25s
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.13) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.13) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.13) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.13) (push) Has been cancelled
2025-08-27 02:22:22 +00:00
fllesser
ddc99eedda 🍻 publish plugin 抽象 (#3637) 2025-08-27 02:21:08 +00:00
noneflow[bot]
4c71b8a2a0 📝 Update changelog
Some checks failed
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.10) (push) Failing after 4s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.12) (push) Failing after 4s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.13) (push) Failing after 4s
Pyright Lint / Pyright Lint (pydantic-v1) (push) Failing after 4s
Pyright Lint / Pyright Lint (pydantic-v2) (push) Failing after 4s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.11) (push) Failing after 8s
Site Deploy / publish (push) Failing after 4s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.9) (push) Failing after 8s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.13) (push) Failing after 14s
Ruff Lint / Ruff Lint (push) Failing after 10s
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.13) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.13) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.13) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.13) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.12) (push) Has been cancelled
2025-08-26 12:41:18 +00:00
XTxiaoting14332
7cb39acab6 🍻 publish plugin 卖若插件 (#3630) 2025-08-26 12:39:51 +00:00
noneflow[bot]
933a105348 📝 Update changelog
Some checks failed
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.11) (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.13) (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.9) (push) Failing after 2s
Pyright Lint / Pyright Lint (pydantic-v2) (push) Failing after 2s
Ruff Lint / Ruff Lint (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.11) (push) Failing after 1m36s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.9) (push) Failing after 2m4s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.12) (push) Failing after 3m32s
Pyright Lint / Pyright Lint (pydantic-v1) (push) Failing after 4m0s
Site Deploy / publish (push) Failing after 4m28s
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.13) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.13) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.13) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.13) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.9) (push) Has been cancelled
2025-08-26 02:30:21 +00:00
StarHeart
b52905b8ee CI: 测试矩阵加入 Python 3.13 (#3605) 2025-08-26 10:29:11 +08:00
noneflow[bot]
9e9c1a27e5 📝 Update changelog
Some checks failed
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.10) (push) Failing after 3s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.12) (push) Failing after 3s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.10) (push) Failing after 3s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.11) (push) Failing after 3s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.9) (push) Failing after 3s
Pyright Lint / Pyright Lint (pydantic-v1) (push) Failing after 3s
Ruff Lint / Ruff Lint (push) Failing after 3s
Site Deploy / publish (push) Failing after 3s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.11) (push) Failing after 1m34s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.9) (push) Failing after 3m3s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.12) (push) Failing after 3m31s
Pyright Lint / Pyright Lint (pydantic-v2) (push) Failing after 3m59s
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.9) (push) Has been cancelled
2025-08-25 15:02:13 +00:00
StarHeart
e2463e9e39 📝 Docs: 升级 docusaurus 3.8.1 (#3649) 2025-08-25 23:00:43 +08:00
noneflow[bot]
9681c92bfc 📝 Update changelog
Some checks failed
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.11) (push) Failing after 3s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.12) (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.10) (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.10) (push) Failing after 5s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.11) (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.9) (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.9) (push) Failing after 5s
Pyright Lint / Pyright Lint (pydantic-v1) (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.12) (push) Failing after 4s
Ruff Lint / Ruff Lint (push) Failing after 2s
Site Deploy / publish (push) Failing after 2s
Pyright Lint / Pyright Lint (pydantic-v2) (push) Failing after 5s
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.9) (push) Has been cancelled
2025-08-24 13:52:56 +00:00
CL
def8c34918 📝 Docs: 更新文档《手动创建项目》 (#3623)
Some checks failed
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.11) (push) Failing after 3s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.12) (push) Failing after 3s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.10) (push) Failing after 3s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.11) (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.9) (push) Failing after 2s
Pyright Lint / Pyright Lint (pydantic-v1) (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.9) (push) Failing after 6s
Ruff Lint / Ruff Lint (push) Failing after 2s
Site Deploy / publish (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.10) (push) Failing after 12s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.12) (push) Failing after 13s
Pyright Lint / Pyright Lint (pydantic-v2) (push) Failing after 17s
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.9) (push) Has been cancelled
Co-authored-by: Ju4tCode <42488585+yanyongyu@users.noreply.github.com>
Co-authored-by: StarHeartHunt <starheart233@gmail.com>
2025-08-24 21:51:28 +08:00
noneflow[bot]
6dc52c9d6b 📝 Update changelog 2025-08-24 13:37:37 +00:00
inkink365
a22b8213ef 🍻 publish plugin HuaEr聊天bot (#3563) 2025-08-24 13:36:22 +00:00
noneflow[bot]
e2901debfb 📝 Update changelog 2025-08-24 13:25:25 +00:00
JohnRichard4096
7e16b034b8 🍻 publish bot Amrita (#3640) 2025-08-24 13:24:13 +00:00
noneflow[bot]
a30bfb76ff 📝 Update changelog 2025-08-24 13:23:33 +00:00
lgc2333
9d6ca5c7eb ✏️ remove nonebot_plugin_cnrail (#185) 2025-08-24 13:22:15 +00:00
noneflow[bot]
2ac102ea53 📝 Update changelog 2025-08-24 13:17:43 +00:00
lgc2333
9fe86f61d6 ✏️ remove nonebot_plugin_pingti (#186) 2025-08-24 13:16:19 +00:00
noneflow[bot]
47be1aea18 📝 Update changelog
Some checks failed
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.11) (push) Failing after 3s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.12) (push) Failing after 3s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.10) (push) Failing after 3s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.11) (push) Failing after 3s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.9) (push) Failing after 3s
Pyright Lint / Pyright Lint (pydantic-v1) (push) Failing after 2s
Ruff Lint / Ruff Lint (push) Failing after 2s
Site Deploy / publish (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.10) (push) Failing after 1m34s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.9) (push) Failing after 1m34s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.12) (push) Failing after 1m33s
Pyright Lint / Pyright Lint (pydantic-v2) (push) Failing after 1m33s
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.9) (push) Has been cancelled
2025-08-21 12:55:16 +00:00
AriadusTT
180de00d0b 🍻 publish plugin Anipusher推送机 (#3581) 2025-08-21 12:54:03 +00:00
noneflow[bot]
fbec37d089 📝 Update changelog
Some checks failed
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.10) (push) Failing after 4s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.12) (push) Failing after 4s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.9) (push) Failing after 4s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.11) (push) Failing after 3s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.12) (push) Failing after 3s
Pyright Lint / Pyright Lint (pydantic-v1) (push) Failing after 3s
Pyright Lint / Pyright Lint (pydantic-v2) (push) Failing after 3s
Site Deploy / publish (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.11) (push) Failing after 16s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.10) (push) Failing after 16s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.9) (push) Failing after 17s
Ruff Lint / Ruff Lint (push) Failing after 17s
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.9) (push) Has been cancelled
2025-08-18 07:16:21 +00:00
nomdn
9b83cf4945 🍻 publish plugin nonebot-plugin-simple-setu (#3593) 2025-08-18 07:15:07 +00:00
noneflow[bot]
790461d8b7 📝 Update changelog
Some checks failed
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.10) (push) Failing after 4s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.11) (push) Failing after 4s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.9) (push) Failing after 3s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.10) (push) Failing after 3s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.12) (push) Failing after 3s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.9) (push) Failing after 3s
Pyright Lint / Pyright Lint (pydantic-v2) (push) Failing after 3s
Ruff Lint / Ruff Lint (push) Failing after 3s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.11) (push) Failing after 9s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.12) (push) Failing after 13s
Pyright Lint / Pyright Lint (pydantic-v1) (push) Failing after 10s
Site Deploy / publish (push) Failing after 10s
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.9) (push) Has been cancelled
2025-08-16 03:56:07 +00:00
MingxuanGame
22b848dfcc 📝 Docs: 增加 B站直播间 适配器说明 (#3636) 2025-08-16 11:55:05 +08:00
noneflow[bot]
9915e89ceb 📝 Update changelog
Some checks failed
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.11) (push) Failing after 3s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.12) (push) Failing after 3s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.10) (push) Failing after 3s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.11) (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.9) (push) Failing after 2s
Pyright Lint / Pyright Lint (pydantic-v1) (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.10) (push) Failing after 7s
Ruff Lint / Ruff Lint (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.9) (push) Failing after 7s
Site Deploy / publish (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.12) (push) Failing after 7s
Pyright Lint / Pyright Lint (pydantic-v2) (push) Failing after 7s
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.9) (push) Has been cancelled
2025-08-15 08:52:49 +00:00
he0119
3adc2cc761 🍻 publish plugin Alisten (#3634) 2025-08-15 08:51:41 +00:00
noneflow[bot]
38d8701d45 📝 Update changelog
Some checks failed
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.10) (push) Failing after 4s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.12) (push) Failing after 5s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.9) (push) Failing after 5s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.11) (push) Failing after 7s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.11) (push) Failing after 5s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.9) (push) Failing after 4s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.12) (push) Failing after 5s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.10) (push) Failing after 7s
Pyright Lint / Pyright Lint (pydantic-v1) (push) Failing after 5s
Ruff Lint / Ruff Lint (push) Failing after 5s
Pyright Lint / Pyright Lint (pydantic-v2) (push) Failing after 5s
Site Deploy / publish (push) Failing after 5s
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.9) (push) Has been cancelled
2025-08-13 16:20:51 +00:00
5656565566
6633d4d2c9 📝 Docs: 增加 VoceChat 适配器说明 (#3627) 2025-08-14 00:19:46 +08:00
noneflow[bot]
1864269be5 📝 Update changelog
Some checks failed
Site Deploy / publish (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.10) (push) Failing after 3s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.12) (push) Failing after 3s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.9) (push) Failing after 3s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.11) (push) Failing after 3s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.11) (push) Failing after 7s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.12) (push) Failing after 3s
Pyright Lint / Pyright Lint (pydantic-v1) (push) Failing after 3s
Pyright Lint / Pyright Lint (pydantic-v2) (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.10) (push) Failing after 6s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.9) (push) Failing after 7s
Ruff Lint / Ruff Lint (push) Failing after 8s
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.9) (push) Has been cancelled
2025-08-13 06:18:08 +00:00
MingxuanGame
df5b21cb9f 🍻 publish adapter B站直播间 (#3591) 2025-08-13 06:17:04 +00:00
noneflow[bot]
460fb59322 📝 Update changelog 2025-08-13 05:59:53 +00:00
5656565566
0b63ff6e73 🍻 publish adapter nonebot-adapter-vocechat (#3535) 2025-08-13 05:58:42 +00:00
dependabot[bot]
d1b9dad8f4 ⬆️ Bump actions/checkout from 4 to 5 in the actions group (#3626)
Some checks failed
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.10) (push) Failing after 3s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.12) (push) Failing after 4s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.9) (push) Failing after 4s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.11) (push) Failing after 5s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.12) (push) Failing after 6s
Pyright Lint / Pyright Lint (pydantic-v1) (push) Failing after 7s
Pyright Lint / Pyright Lint (pydantic-v2) (push) Failing after 8s
Site Deploy / publish (push) Failing after 8s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.10) (push) Failing after 1m56s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.11) (push) Failing after 2m2s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.9) (push) Failing after 2m3s
Ruff Lint / Ruff Lint (push) Failing after 2m4s
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.9) (push) Has been cancelled
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-12 23:58:50 +08:00
noneflow[bot]
42e4206916 📝 Update changelog
Some checks failed
Ruff Lint / Ruff Lint (push) Successful in 35s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.9) (push) Failing after 1m7s
Pyright Lint / Pyright Lint (pydantic-v1) (push) Successful in 1m24s
Site Deploy / publish (push) Failing after 1m25s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.12) (push) Failing after 2m29s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.11) (push) Failing after 2m49s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.10) (push) Failing after 2m58s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.11) (push) Failing after 3m0s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.9) (push) Failing after 15m20s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.10) (push) Failing after 22m0s
Pyright Lint / Pyright Lint (pydantic-v2) (push) Failing after 27m12s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.12) (push) Failing after 31m20s
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.9) (push) Has been cancelled
2025-08-10 06:55:40 +00:00
GLDYM
384f99eae6 🍻 publish plugin MC玩家皮肤渲染 (#3612) 2025-08-10 06:54:26 +00:00
noneflow[bot]
152af6b458 📝 Update changelog 2025-08-10 02:53:58 +00:00
JohnRichard4096
e9bf5d6931 🍻 publish plugin EconomyValue (#3565) 2025-08-10 02:52:45 +00:00
134 changed files with 3768 additions and 4533 deletions

View File

@@ -4,10 +4,10 @@ description: Setup Node
runs: runs:
using: "composite" using: "composite"
steps: steps:
- uses: actions/setup-node@v4 - uses: actions/setup-node@v5
with: with:
node-version: "18" node-version: lts/*
cache: "yarn" cache: yarn
- run: yarn install --frozen-lockfile - run: yarn install --frozen-lockfile
shell: bash shell: bash

View File

@@ -14,7 +14,7 @@ inputs:
runs: runs:
using: "composite" using: "composite"
steps: steps:
- uses: astral-sh/setup-uv@v6 - uses: astral-sh/setup-uv@v7
with: with:
python-version: ${{ inputs.python-version }} python-version: ${{ inputs.python-version }}
cache-suffix: ${{ inputs.env-group }} cache-suffix: ${{ inputs.env-group }}

View File

@@ -25,7 +25,7 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"] python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
os: [ubuntu-latest, windows-latest, macos-latest] os: [ubuntu-latest, windows-latest, macos-latest]
env: [pydantic-v1, pydantic-v2] env: [pydantic-v1, pydantic-v2]
env: env:
@@ -34,7 +34,7 @@ jobs:
PYDANTIC_VERSION: ${{ matrix.env }} PYDANTIC_VERSION: ${{ matrix.env }}
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v5
- name: Setup Python environment - name: Setup Python environment
uses: ./.github/actions/setup-python uses: ./.github/actions/setup-python

View File

@@ -45,7 +45,7 @@ jobs:
private_key: ${{ secrets.APP_KEY }} private_key: ${{ secrets.APP_KEY }}
- name: Checkout Code - name: Checkout Code
uses: actions/checkout@v4 uses: actions/checkout@v5
with: with:
token: ${{ steps.generate-token.outputs.token }} token: ${{ steps.generate-token.outputs.token }}

View File

@@ -28,7 +28,7 @@ jobs:
fail-fast: false fail-fast: false
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v5
- name: Setup Python environment - name: Setup Python environment
uses: ./.github/actions/setup-python uses: ./.github/actions/setup-python

View File

@@ -25,7 +25,7 @@ jobs:
app_id: ${{ secrets.APP_ID }} app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_KEY }} private_key: ${{ secrets.APP_KEY }}
- uses: actions/checkout@v4 - uses: actions/checkout@v5
with: with:
token: ${{ steps.generate-token.outputs.token }} token: ${{ steps.generate-token.outputs.token }}
@@ -70,7 +70,7 @@ jobs:
app_id: ${{ secrets.APP_ID }} app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_KEY }} private_key: ${{ secrets.APP_KEY }}
- uses: actions/checkout@v4 - uses: actions/checkout@v5
- name: Setup Python Environment - name: Setup Python Environment
uses: ./.github/actions/setup-python uses: ./.github/actions/setup-python

View File

@@ -14,7 +14,7 @@ jobs:
app_id: ${{ secrets.APP_ID }} app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_KEY }} private_key: ${{ secrets.APP_KEY }}
- uses: actions/checkout@v4 - uses: actions/checkout@v5
with: with:
token: ${{ steps.generate-token.outputs.token }} token: ${{ steps.generate-token.outputs.token }}

View File

@@ -24,7 +24,7 @@ jobs:
cancel-in-progress: true cancel-in-progress: true
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v5
- name: Run Ruff Lint - name: Run Ruff Lint
uses: astral-sh/ruff-action@v3 uses: astral-sh/ruff-action@v3

View File

@@ -13,7 +13,7 @@ jobs:
cancel-in-progress: true cancel-in-progress: true
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v5
with: with:
fetch-depth: 0 fetch-depth: 0

View File

@@ -24,7 +24,7 @@ jobs:
steps: steps:
- name: Set Commit Status - name: Set Commit Status
uses: actions/github-script@v7 uses: actions/github-script@v8
with: with:
script: | script: |
github.rest.repos.createCommitStatus({ github.rest.repos.createCommitStatus({
@@ -78,7 +78,7 @@ jobs:
:rocket: Deployed to ${{ steps.deploy.outputs.deploy-url }} :rocket: Deployed to ${{ steps.deploy.outputs.deploy-url }}
- name: Set Commit Status - name: Set Commit Status
uses: actions/github-script@v7 uses: actions/github-script@v8
if: always() if: always()
with: with:
script: | script: |

View File

@@ -11,7 +11,7 @@ jobs:
cancel-in-progress: true cancel-in-progress: true
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v5
with: with:
ref: ${{ github.event.pull_request.head.sha }} ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0 fetch-depth: 0

View File

@@ -7,7 +7,7 @@ ci:
autoupdate_commit_msg: ":arrow_up: auto update by pre-commit hooks" autoupdate_commit_msg: ":arrow_up: auto update by pre-commit hooks"
repos: repos:
- repo: https://github.com/astral-sh/ruff-pre-commit - repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.12.7 rev: v0.14.0
hooks: hooks:
- id: ruff-check - id: ruff-check
args: [--fix] args: [--fix]

View File

@@ -1 +1,2 @@
.github/**/*.md .github/**/*.md
website/docs/tutorial/application.mdx

View File

@@ -129,7 +129,6 @@ NoneBot2 是一个现代、跨平台、可扩展的 Python 聊天机器人框架
| 开黑啦([仓库](https://github.com/Tian-que/nonebot-adapter-kaiheila)[协议](https://developer.kookapp.cn/) | ↗️ | 由社区贡献 | | 开黑啦([仓库](https://github.com/Tian-que/nonebot-adapter-kaiheila)[协议](https://developer.kookapp.cn/) | ↗️ | 由社区贡献 |
| Ntchat[仓库](https://github.com/JustUndertaker/adapter-ntchat) | ↗️ | 微信协议,由社区贡献 | | Ntchat[仓库](https://github.com/JustUndertaker/adapter-ntchat) | ↗️ | 微信协议,由社区贡献 |
| MineCraft[仓库](https://github.com/17TheWord/nonebot-adapter-minecraft) | ↗️ | 由社区贡献 | | MineCraft[仓库](https://github.com/17TheWord/nonebot-adapter-minecraft) | ↗️ | 由社区贡献 |
| BiliBili Live[仓库](https://github.com/wwweww/adapter-bilibili) | ↗️ | 由社区贡献 |
| Walle-Q[仓库](https://github.com/onebot-walle/nonebot_adapter_walleq) | ↗️ | QQ 协议,由社区贡献 | | Walle-Q[仓库](https://github.com/onebot-walle/nonebot_adapter_walleq) | ↗️ | QQ 协议,由社区贡献 |
| Villa[仓库](https://github.com/CMHopeSunshine/nonebot-adapter-villa) | ❌ | 米游社大别野 Bot 协议,官方已下线 | | Villa[仓库](https://github.com/CMHopeSunshine/nonebot-adapter-villa) | ❌ | 米游社大别野 Bot 协议,官方已下线 |
| Rocket.Chat[仓库](https://github.com/IUnlimit/nonebot-adapter-rocketchat)[协议](https://developer.rocket.chat/) | ↗️ | Rocket.Chat Bot 协议,由社区贡献 | | Rocket.Chat[仓库](https://github.com/IUnlimit/nonebot-adapter-rocketchat)[协议](https://developer.rocket.chat/) | ↗️ | Rocket.Chat Bot 协议,由社区贡献 |
@@ -139,6 +138,8 @@ NoneBot2 是一个现代、跨平台、可扩展的 Python 聊天机器人框架
| 微信公众平台([仓库](https://github.com/YangRucheng/nonebot-adapter-wxmp)[协议](https://developers.weixin.qq.com/doc/)| ↗️ | 微信公众平台协议,由社区贡献 | | 微信公众平台([仓库](https://github.com/YangRucheng/nonebot-adapter-wxmp)[协议](https://developers.weixin.qq.com/doc/)| ↗️ | 微信公众平台协议,由社区贡献 |
| Gewechat[仓库](https://github.com/Shine-Light/nonebot-adapter-gewechat)[协议](https://github.com/Devo919/Gewechat)| ❌ | Gewechat 微信协议Gewechat不再维护及可用 | | Gewechat[仓库](https://github.com/Shine-Light/nonebot-adapter-gewechat)[协议](https://github.com/Devo919/Gewechat)| ❌ | Gewechat 微信协议Gewechat不再维护及可用 |
| EFChat[仓库](https://github.com/molanp/nonebot_adapter_efchat)[协议](https://irinu-live.melon.fish/efc-help/) | ↗️ | 恒五聊平台协议,由社区贡献 | | EFChat[仓库](https://github.com/molanp/nonebot_adapter_efchat)[协议](https://irinu-live.melon.fish/efc-help/) | ↗️ | 恒五聊平台协议,由社区贡献 |
| VoceChat [仓库](https://github.com/5656565566/nonebot-adapter-vocechat)[协议](https://doc.voce.chat/zh-cn/bot/bot-and-webhook) | ↗️ | VoceChat 平台协议,由社区贡献 |
| B站直播间[仓库](https://github.com/MingxuanGame/nonebot-adapter-bilibili-live)[Web API 协议](https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/docs/live)[开放平台协议](https://open-live.bilibili.com/document) | ↗️ | B站直播间Web API/开放平台)协议,由社区贡献 |
- 坚实后盾:支持多种 web 框架,可自定义替换、组合 - 坚实后盾:支持多种 web 框架,可自定义替换、组合

View File

@@ -313,4 +313,29 @@
], ],
"is_official": false "is_official": false
}, },
{
"module_name": "nonebot.adapters.vocechat",
"project_link": "nonebot-adapter-vocechat",
"name": "nonebot-adapter-vocechat",
"desc": "Vocechat 协议适配器",
"author_id": 56059687,
"homepage": "https://github.com/5656565566/nonebot-adapter-vocechat",
"tags": [],
"is_official": false
},
{
"module_name": "nonebot.adapters.bilibili_live",
"project_link": "nonebot-adapter-bilibili-live",
"name": "B站直播间",
"desc": "B 站直播间协议Web API/开放平台)支持",
"author_id": 68982190,
"homepage": "https://github.com/MingxuanGame/nonebot-adapter-bilibili-live",
"tags": [
{
"label": "bilibili",
"color": "#ff6699"
}
],
"is_official": false
},
] ]

View File

@@ -743,4 +743,25 @@
"tags": [], "tags": [],
"is_official": false "is_official": false
}, },
{
"name": "Amrita",
"desc": "LLM聊天机器人框架",
"author_id": 67693593,
"homepage": "https://github.com/LiteSuggarDEV/Amrita",
"tags": [
{
"label": "聊天",
"color": "#ea5252"
},
{
"label": "LLM",
"color": "#5c86db"
},
{
"label": "快捷部署",
"color": "#eebe0b"
}
],
"is_official": false
},
] ]

View File

@@ -5148,13 +5148,6 @@
], ],
"is_official": false "is_official": false
}, },
{
"module_name": "nonebot_plugin_cnrail",
"project_link": "nonebot-plugin-cnrail",
"author_id": 59048777,
"tags": [],
"is_official": false
},
{ {
"module_name": "nonebot_plugin_longtu", "module_name": "nonebot_plugin_longtu",
"project_link": "nonebot-plugin-longtu", "project_link": "nonebot-plugin-longtu",
@@ -5251,13 +5244,6 @@
], ],
"is_official": false "is_official": false
}, },
{
"module_name": "nonebot_plugin_pingti",
"project_link": "nonebot-plugin-pingti",
"author_id": 59048777,
"tags": [],
"is_official": false
},
{ {
"module_name": "nonebot_plugin_wx4", "module_name": "nonebot_plugin_wx4",
"project_link": "nonebot-plugin-wx4", "project_link": "nonebot-plugin-wx4",
@@ -9444,4 +9430,378 @@
"tags": [], "tags": [],
"is_official": false "is_official": false
}, },
{
"module_name": "nonebot_plugin_value",
"project_link": "nonebot-plugin-value",
"author_id": 67693593,
"tags": [
{
"label": "value",
"color": "#d10a0a"
},
{
"label": "货币",
"color": "#3c0eff"
},
{
"label": "经济",
"color": "#1b9f1d"
}
],
"is_official": false
},
{
"module_name": "nonebot_plugin_mcplayer_render",
"project_link": "nonebot-plugin-mcplayer-render",
"author_id": 49135577,
"tags": [
{
"label": "Minecraft",
"color": "#ea5252"
}
],
"is_official": false
},
{
"module_name": "nonebot_plugin_alisten",
"project_link": "nonebot-plugin-alisten",
"author_id": 5219550,
"tags": [],
"is_official": false
},
{
"module_name": "nonebot_plugin_simple_setu",
"project_link": "nonebot-plugin-simple-setu",
"author_id": 178264759,
"tags": [
{
"label": "pixiv",
"color": "#00f5ed"
},
{
"label": "色图",
"color": "#ed0823"
}
],
"is_official": false
},
{
"module_name": "nonebot-plugin-anipusher",
"project_link": "nonebot-plugin-anipusher",
"author_id": 32594985,
"tags": [
{
"label": "Emby",
"color": "#0b8a31"
},
{
"label": "AniRss",
"color": "#0b8a31"
}
],
"is_official": false
},
{
"module_name": "nonebot_plugin_huaer_bot",
"project_link": "nonebot-plugin-huaer-bot",
"author_id": 216365707,
"tags": [
{
"label": "LLM",
"color": "#0583b3"
}
],
"is_official": false
},
{
"module_name": "nonebot_plugin_sell_poor",
"project_link": "nonebot-plugin-sell-poor",
"author_id": 96647974,
"tags": [
{
"label": "卖弱",
"color": "#ea5252"
},
{
"label": "😭😭😭",
"color": "#52eaba"
}
],
"is_official": false
},
{
"module_name": "nonebot_plugin_abs",
"project_link": "nonebot-plugin-abs",
"author_id": 64878354,
"tags": [
{
"label": "abstract",
"color": "#edf119"
}
],
"is_official": false
},
{
"module_name": "nonebot_plugin_ImageLibrary",
"project_link": "nonebot-plugin-imagelibrary",
"author_id": 126797731,
"tags": [
{
"label": "image",
"color": "#7629c4"
}
],
"is_official": false
},
{
"module_name": "nonebot_plugin_exhibitionism",
"project_link": "nonebot_plugin_exhibitionism",
"author_id": 78413699,
"tags": [],
"is_official": false
},
{
"module_name": "nonebot_plugin_akashgen",
"project_link": "nonebot-plugin-akashgen",
"author_id": 144674902,
"tags": [
{
"label": "绘画",
"color": "#98f698"
},
{
"label": "Akash",
"color": "#a1eecf"
},
{
"label": "AI",
"color": "#78bbf0"
}
],
"is_official": false
},
{
"module_name": "nonebot_plugin_figurine",
"project_link": "nonebot-plugin-figurine",
"author_id": 99017826,
"tags": [
{
"label": "figurine",
"color": "#ea5252"
},
{
"label": "手办",
"color": "#ea5252"
}
],
"is_official": false
},
{
"module_name": "nonebot_plugin_distributed_blacklist",
"project_link": "nonebot-plugin-distributed-blacklist",
"author_id": 65720409,
"tags": [
{
"label": "blacklist",
"color": "#000000"
}
],
"is_official": false
},
{
"module_name": "nonebot_plugin_bafortune",
"project_link": "nonebot-plugin-bafortune",
"author_id": 98072207,
"tags": [
{
"label": "碧蓝档案",
"color": "#2b8dce"
},
{
"label": "今日运势",
"color": "#ce2b2b"
},
{
"label": "多平台适配",
"color": "#c2ce2b"
}
],
"is_official": false
},
{
"module_name": "nonebot_plugin_repeat_checker",
"project_link": "nonebot-plugin-repeat-checker",
"author_id": 56631400,
"tags": [
{
"label": "复读",
"color": "#ea5252"
}
],
"is_official": false
},
{
"module_name": "nonebot_plugin_quark_autosave",
"project_link": "nonebot-plugin-quark-autosave",
"author_id": 64878354,
"tags": [
{
"label": "quark",
"color": "#593dc3"
},
{
"label": "夸克",
"color": "#6542eb"
},
{
"label": "网盘",
"color": "#235c84"
}
],
"is_official": false
},
{
"module_name": "nonebot_plugin_who_is_spy",
"project_link": "nonebot-plugin-who-is-spy",
"author_id": 144591143,
"tags": [
{
"label": "game",
"color": "#ea5252"
},
{
"label": "游戏",
"color": "#ea52cd"
}
],
"is_official": false
},
{
"module_name": "nonebot_plugin_dst_qq",
"project_link": "nonebot-plugin-dst-qq",
"author_id": 145603392,
"tags": [
{
"label": "server",
"color": "#52ea9d"
}
],
"is_official": false
},
{
"module_name": "nonebot_plugin_fupan",
"project_link": "nonebot-plugin-fupan",
"author_id": 867749,
"tags": [
{
"label": "股票",
"color": "#ea5252"
},
{
"label": "打卡",
"color": "#ea5252"
}
],
"is_official": false
},
{
"module_name": "nonebot_plugin_algo",
"project_link": "nonebot-plugin-algo",
"author_id": 188494207,
"tags": [
{
"label": "算法竞赛",
"color": "#52c5ea"
},
{
"label": "ACM",
"color": "#eb0e31"
}
],
"is_official": false
},
{
"module_name": "nonebot_plugin_llm_extension",
"project_link": "nonebot-plugin-llm-extension",
"author_id": 110453675,
"tags": [
{
"label": "🇦🇮",
"color": "#f0f0f0"
}
],
"is_official": false
},
{
"module_name": "nonebot_plugin_htmlkit",
"project_link": "nonebot-plugin-htmlkit",
"author_id": 50769752,
"tags": [
{
"label": "模板渲染",
"color": "#a57021"
},
{
"label": "图片生成",
"color": "#74c817"
},
{
"label": "HTML渲染",
"color": "#199579"
}
],
"is_official": true
},
{
"module_name": "nonebot_plugin_mhcodes",
"project_link": "nonebot-plugin-mhcodes",
"author_id": 99017826,
"tags": [
{
"label": "怪物猎人",
"color": "#ea5252"
}
],
"is_official": false
},
{
"module_name": "nonebot_plugin_parser",
"project_link": "nonebot-plugin-parser",
"author_id": 64878354,
"tags": [
{
"label": "图集",
"color": "#263bd5"
},
{
"label": "视频",
"color": "#152ac0"
},
{
"label": "解析",
"color": "#152ac0"
}
],
"is_official": false
},
{
"module_name": "nonebot-plugin-msglogger",
"project_link": "nonebot-plugin-msglogger",
"author_id": 71204348,
"tags": [
{
"label": "消息记录",
"color": "#eb1919"
},
{
"label": "群信息记录",
"color": "#633fef"
},
{
"label": "图片保存",
"color": "#0af70a"
}
],
"is_official": false
},
] ]

View File

@@ -8,11 +8,13 @@ FrontMatter:
""" """
from collections.abc import Iterable from collections.abc import Iterable
from itertools import chain
import json import json
from pathlib import Path from pathlib import Path
from types import ModuleType from types import ModuleType
from typing import Optional, Union from typing import Optional, Union
from nonebot.log import logger
from nonebot.utils import path_to_module_name from nonebot.utils import path_to_module_name
from . import _managers, _module_name_to_plugin_id, get_plugin from . import _managers, _module_name_to_plugin_id, get_plugin
@@ -108,6 +110,19 @@ def load_from_toml(file_path: str, encoding: str = "utf-8") -> set[Plugin]:
encoding: 指定 toml 文件编码 encoding: 指定 toml 文件编码
用法: 用法:
新格式:
```toml title=pyproject.toml
[tool.nonebot]
plugin_dirs = ["some_dir"]
[tool.nonebot.plugins]
some-store-plugin = ["some_store_plugin"]
"@local" = ["some_local_plugin"]
```
旧格式:
```toml title=pyproject.toml ```toml title=pyproject.toml
[tool.nonebot] [tool.nonebot]
plugins = ["some_plugin"] plugins = ["some_plugin"]
@@ -126,11 +141,22 @@ def load_from_toml(file_path: str, encoding: str = "utf-8") -> set[Plugin]:
raise ValueError("Cannot find '[tool.nonebot]' in given toml file!") raise ValueError("Cannot find '[tool.nonebot]' in given toml file!")
if not isinstance(nonebot_data, dict): if not isinstance(nonebot_data, dict):
raise TypeError("'[tool.nonebot]' must be a Table!") raise TypeError("'[tool.nonebot]' must be a Table!")
plugins = nonebot_data.get("plugins", []) plugins = nonebot_data.get("plugins", {})
plugin_dirs = nonebot_data.get("plugin_dirs", []) plugin_dirs = nonebot_data.get("plugin_dirs", [])
assert isinstance(plugins, list), "plugins must be a list of plugin name" assert isinstance(plugins, (list, dict)), (
"plugins must be a list or a dict of plugin name"
)
assert isinstance(plugin_dirs, list), "plugin_dirs must be a list of directories" assert isinstance(plugin_dirs, list), "plugin_dirs must be a list of directories"
return load_all_plugins(plugins, plugin_dirs) if isinstance(plugins, list):
logger.warning("Legacy project format found! Upgrade with `nb upgrade-format`.")
return load_all_plugins(
set(
chain.from_iterable(plugins.values())
if isinstance(plugins, dict)
else plugins
),
plugin_dirs,
)
def load_builtin_plugin(name: str) -> Optional[Plugin]: def load_builtin_plugin(name: str) -> Optional[Plugin]:

View File

@@ -89,7 +89,7 @@ def origin_is_annotated(origin: t.Optional[type[t.Any]]) -> bool:
return origin is t_ext.Annotated return origin is t_ext.Annotated
NONE_TYPES = {None, type(None), t.Literal[None], t_ext.Literal[None]} NONE_TYPES = {None, type(None), t.Literal[None], t_ext.Literal[None]} # noqa: PYI061
if sys.version_info >= (3, 10): if sys.version_info >= (3, 10):
NONE_TYPES.add(types.NoneType) NONE_TYPES.add(types.NoneType)
@@ -104,6 +104,7 @@ if sys.version_info < (3, 12):
def is_type_alias_type(type_: type[t.Any]) -> bool: def is_type_alias_type(type_: type[t.Any]) -> bool:
"""判断是否是 TypeAliasType 类型""" """判断是否是 TypeAliasType 类型"""
return isinstance(type_, t_ext.TypeAliasType) return isinstance(type_, t_ext.TypeAliasType)
else: else:
def is_type_alias_type(type_: type[t.Any]) -> bool: def is_type_alias_type(type_: type[t.Any]) -> bool:

View File

@@ -42,7 +42,7 @@ all = [
[dependency-groups] [dependency-groups]
dev = [ dev = [
"ruff >=0.12.0, <0.13.0", "ruff >=0.14.0, <0.15.0",
"nonemoji >=0.1.2, <0.2.0", "nonemoji >=0.1.2, <0.2.0",
"pre-commit >=4.0.0, <5.0.0", "pre-commit >=4.0.0, <5.0.0",
] ]

View File

@@ -0,0 +1,3 @@
[tool.nonebot]
plugins = []
plugin_dirs = []

View File

@@ -1,3 +1,5 @@
[tool.nonebot] [tool.nonebot]
plugins = []
plugin_dirs = [] plugin_dirs = []
[tool.nonebot.plugins]
"@local" = []

View File

@@ -42,6 +42,10 @@ UNKNOWN_PARAM = "Unknown parameter"
@pytest.mark.anyio @pytest.mark.anyio
@pytest.mark.xfail(
((3, 13) <= sys.version_info < (3, 13, 8)) or (3, 14) <= sys.version_info,
reason="CPython Bug, see python/cpython#137317, python/cpython#137862",
)
async def test_depend(app: App): async def test_depend(app: App):
from plugins.param.param_depend import ( from plugins.param.param_depend import (
ClassDependency, ClassDependency,

View File

@@ -93,6 +93,8 @@ def test_load_json():
@_recover @_recover
def test_load_toml(): def test_load_toml():
nonebot.load_from_toml("./plugins.legacy.toml")
nonebot.load_from_toml("./plugins.toml") nonebot.load_from_toml("./plugins.toml")
with pytest.raises(ValueError, match="Cannot find"): with pytest.raises(ValueError, match="Cannot find"):

57
uv.lock generated
View File

@@ -1,5 +1,5 @@
version = 1 version = 1
revision = 2 revision = 3
requires-python = ">=3.9, <4.0" requires-python = ">=3.9, <4.0"
resolution-markers = [ resolution-markers = [
"python_full_version >= '3.10'", "python_full_version >= '3.10'",
@@ -1005,7 +1005,7 @@ name = "importlib-metadata"
version = "8.7.0" version = "8.7.0"
source = { registry = "https://pypi.org/simple" } source = { registry = "https://pypi.org/simple" }
dependencies = [ dependencies = [
{ name = "zipp" }, { name = "zipp", marker = "python_full_version < '3.10' or (extra == 'group-8-nonebot2-pydantic-v1' and extra == 'group-8-nonebot2-pydantic-v2')" },
] ]
sdist = { url = "https://files.pythonhosted.org/packages/76/66/650a33bd90f786193e4de4b3ad86ea60b53c89b669a5c7be931fac31cdb0/importlib_metadata-8.7.0.tar.gz", hash = "sha256:d13b81ad223b890aa16c5471f2ac3056cf76c5f10f82d6f9292f0b415f389000", size = 56641, upload-time = "2025-04-27T15:29:01.736Z" } sdist = { url = "https://files.pythonhosted.org/packages/76/66/650a33bd90f786193e4de4b3ad86ea60b53c89b669a5c7be931fac31cdb0/importlib_metadata-8.7.0.tar.gz", hash = "sha256:d13b81ad223b890aa16c5471f2ac3056cf76c5f10f82d6f9292f0b415f389000", size = 56641, upload-time = "2025-04-27T15:29:01.736Z" }
wheels = [ wheels = [
@@ -1364,7 +1364,7 @@ provides-extras = ["websockets", "httpx", "aiohttp", "quart", "fastapi", "all"]
dev = [ dev = [
{ name = "nonemoji", specifier = ">=0.1.2,<0.2.0" }, { name = "nonemoji", specifier = ">=0.1.2,<0.2.0" },
{ name = "pre-commit", specifier = ">=4.0.0,<5.0.0" }, { name = "pre-commit", specifier = ">=4.0.0,<5.0.0" },
{ name = "ruff", specifier = ">=0.12.0,<0.13.0" }, { name = "ruff", specifier = ">=0.14.0,<0.15.0" },
] ]
docs = [{ name = "nb-autodoc", specifier = ">=1.0.0a5,<2.0.0" }] docs = [{ name = "nb-autodoc", specifier = ">=1.0.0a5,<2.0.0" }]
pydantic-v1 = [{ name = "pydantic", specifier = ">=1.10.0,<2.0.0" }] pydantic-v1 = [{ name = "pydantic", specifier = ">=1.10.0,<2.0.0" }]
@@ -1745,10 +1745,10 @@ resolution-markers = [
"python_full_version < '3.10'", "python_full_version < '3.10'",
] ]
dependencies = [ dependencies = [
{ name = "annotated-types" }, { name = "annotated-types", marker = "extra == 'group-8-nonebot2-pydantic-v2' or extra != 'group-8-nonebot2-pydantic-v1'" },
{ name = "pydantic-core" }, { name = "pydantic-core", marker = "extra == 'group-8-nonebot2-pydantic-v2' or extra != 'group-8-nonebot2-pydantic-v1'" },
{ name = "typing-extensions" }, { name = "typing-extensions", marker = "extra == 'group-8-nonebot2-pydantic-v2' or extra != 'group-8-nonebot2-pydantic-v1'" },
{ name = "typing-inspection" }, { name = "typing-inspection", marker = "extra == 'group-8-nonebot2-pydantic-v2' or extra != 'group-8-nonebot2-pydantic-v1'" },
] ]
sdist = { url = "https://files.pythonhosted.org/packages/00/dd/4325abf92c39ba8623b5af936ddb36ffcfe0beae70405d456ab1fb2f5b8c/pydantic-2.11.7.tar.gz", hash = "sha256:d989c3c6cb79469287b1569f7447a17848c998458d49ebe294e975b9baf0f0db", size = 788350, upload-time = "2025-06-14T08:33:17.137Z" } sdist = { url = "https://files.pythonhosted.org/packages/00/dd/4325abf92c39ba8623b5af936ddb36ffcfe0beae70405d456ab1fb2f5b8c/pydantic-2.11.7.tar.gz", hash = "sha256:d989c3c6cb79469287b1569f7447a17848c998458d49ebe294e975b9baf0f0db", size = 788350, upload-time = "2025-06-14T08:33:17.137Z" }
wheels = [ wheels = [
@@ -1760,7 +1760,7 @@ name = "pydantic-core"
version = "2.33.2" version = "2.33.2"
source = { registry = "https://pypi.org/simple" } source = { registry = "https://pypi.org/simple" }
dependencies = [ dependencies = [
{ name = "typing-extensions" }, { name = "typing-extensions", marker = "extra == 'group-8-nonebot2-pydantic-v2' or extra != 'group-8-nonebot2-pydantic-v1'" },
] ]
sdist = { url = "https://files.pythonhosted.org/packages/ad/88/5f2260bdfae97aabf98f1778d43f69574390ad787afb646292a638c923d4/pydantic_core-2.33.2.tar.gz", hash = "sha256:7cb8bc3605c29176e1b105350d2e6474142d7c1bd1d9327c4a9bdb46bf827acc", size = 435195, upload-time = "2025-04-23T18:33:52.104Z" } sdist = { url = "https://files.pythonhosted.org/packages/ad/88/5f2260bdfae97aabf98f1778d43f69574390ad787afb646292a638c923d4/pydantic_core-2.33.2.tar.gz", hash = "sha256:7cb8bc3605c29176e1b105350d2e6474142d7c1bd1d9327c4a9bdb46bf827acc", size = 435195, upload-time = "2025-04-23T18:33:52.104Z" }
wheels = [ wheels = [
@@ -2029,27 +2029,28 @@ wheels = [
[[package]] [[package]]
name = "ruff" name = "ruff"
version = "0.12.7" version = "0.14.0"
source = { registry = "https://pypi.org/simple" } source = { registry = "https://pypi.org/simple" }
sdist = { url = "https://files.pythonhosted.org/packages/a1/81/0bd3594fa0f690466e41bd033bdcdf86cba8288345ac77ad4afbe5ec743a/ruff-0.12.7.tar.gz", hash = "sha256:1fc3193f238bc2d7968772c82831a4ff69252f673be371fb49663f0068b7ec71", size = 5197814, upload-time = "2025-07-29T22:32:35.877Z" } sdist = { url = "https://files.pythonhosted.org/packages/41/b9/9bd84453ed6dd04688de9b3f3a4146a1698e8faae2ceeccce4e14c67ae17/ruff-0.14.0.tar.gz", hash = "sha256:62ec8969b7510f77945df916de15da55311fade8d6050995ff7f680afe582c57", size = 5452071, upload-time = "2025-10-07T18:21:55.763Z" }
wheels = [ wheels = [
{ url = "https://files.pythonhosted.org/packages/e1/d2/6cb35e9c85e7a91e8d22ab32ae07ac39cc34a71f1009a6f9e4a2a019e602/ruff-0.12.7-py3-none-linux_armv6l.whl", hash = "sha256:76e4f31529899b8c434c3c1dede98c4483b89590e15fb49f2d46183801565303", size = 11852189, upload-time = "2025-07-29T22:31:41.281Z" }, { url = "https://files.pythonhosted.org/packages/3a/4e/79d463a5f80654e93fa653ebfb98e0becc3f0e7cf6219c9ddedf1e197072/ruff-0.14.0-py3-none-linux_armv6l.whl", hash = "sha256:58e15bffa7054299becf4bab8a1187062c6f8cafbe9f6e39e0d5aface455d6b3", size = 12494532, upload-time = "2025-10-07T18:21:00.373Z" },
{ url = "https://files.pythonhosted.org/packages/63/5b/a4136b9921aa84638f1a6be7fb086f8cad0fde538ba76bda3682f2599a2f/ruff-0.12.7-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:789b7a03e72507c54fb3ba6209e4bb36517b90f1a3569ea17084e3fd295500fb", size = 12519389, upload-time = "2025-07-29T22:31:54.265Z" }, { url = "https://files.pythonhosted.org/packages/ee/40/e2392f445ed8e02aa6105d49db4bfff01957379064c30f4811c3bf38aece/ruff-0.14.0-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:838d1b065f4df676b7c9957992f2304e41ead7a50a568185efd404297d5701e8", size = 13160768, upload-time = "2025-10-07T18:21:04.73Z" },
{ url = "https://files.pythonhosted.org/packages/a8/c9/3e24a8472484269b6b1821794141f879c54645a111ded4b6f58f9ab0705f/ruff-0.12.7-py3-none-macosx_11_0_arm64.whl", hash = "sha256:2e1c2a3b8626339bb6369116e7030a4cf194ea48f49b64bb505732a7fce4f4e3", size = 11743384, upload-time = "2025-07-29T22:31:59.575Z" }, { url = "https://files.pythonhosted.org/packages/75/da/2a656ea7c6b9bd14c7209918268dd40e1e6cea65f4bb9880eaaa43b055cd/ruff-0.14.0-py3-none-macosx_11_0_arm64.whl", hash = "sha256:703799d059ba50f745605b04638fa7e9682cc3da084b2092feee63500ff3d9b8", size = 12363376, upload-time = "2025-10-07T18:21:07.833Z" },
{ url = "https://files.pythonhosted.org/packages/26/7c/458dd25deeb3452c43eaee853c0b17a1e84169f8021a26d500ead77964fd/ruff-0.12.7-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:32dec41817623d388e645612ec70d5757a6d9c035f3744a52c7b195a57e03860", size = 11943759, upload-time = "2025-07-29T22:32:01.95Z" }, { url = "https://files.pythonhosted.org/packages/42/e2/1ffef5a1875add82416ff388fcb7ea8b22a53be67a638487937aea81af27/ruff-0.14.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3ba9a8925e90f861502f7d974cc60e18ca29c72bb0ee8bfeabb6ade35a3abde7", size = 12608055, upload-time = "2025-10-07T18:21:10.72Z" },
{ url = "https://files.pythonhosted.org/packages/7f/8b/658798472ef260ca050e400ab96ef7e85c366c39cf3dfbef4d0a46a528b6/ruff-0.12.7-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:47ef751f722053a5df5fa48d412dbb54d41ab9b17875c6840a58ec63ff0c247c", size = 11654028, upload-time = "2025-07-29T22:32:04.367Z" }, { url = "https://files.pythonhosted.org/packages/4a/32/986725199d7cee510d9f1dfdf95bf1efc5fa9dd714d0d85c1fb1f6be3bc3/ruff-0.14.0-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:e41f785498bd200ffc276eb9e1570c019c1d907b07cfb081092c8ad51975bbe7", size = 12318544, upload-time = "2025-10-07T18:21:13.741Z" },
{ url = "https://files.pythonhosted.org/packages/a8/86/9c2336f13b2a3326d06d39178fd3448dcc7025f82514d1b15816fe42bfe8/ruff-0.12.7-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a828a5fc25a3efd3e1ff7b241fd392686c9386f20e5ac90aa9234a5faa12c423", size = 13225209, upload-time = "2025-07-29T22:32:06.952Z" }, { url = "https://files.pythonhosted.org/packages/9a/ed/4969cefd53315164c94eaf4da7cfba1f267dc275b0abdd593d11c90829a3/ruff-0.14.0-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:30a58c087aef4584c193aebf2700f0fbcfc1e77b89c7385e3139956fa90434e2", size = 14001280, upload-time = "2025-10-07T18:21:16.411Z" },
{ url = "https://files.pythonhosted.org/packages/76/69/df73f65f53d6c463b19b6b312fd2391dc36425d926ec237a7ed028a90fc1/ruff-0.12.7-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:5726f59b171111fa6a69d82aef48f00b56598b03a22f0f4170664ff4d8298efb", size = 14182353, upload-time = "2025-07-29T22:32:10.053Z" }, { url = "https://files.pythonhosted.org/packages/ab/ad/96c1fc9f8854c37681c9613d825925c7f24ca1acfc62a4eb3896b50bacd2/ruff-0.14.0-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:f8d07350bc7af0a5ce8812b7d5c1a7293cf02476752f23fdfc500d24b79b783c", size = 15027286, upload-time = "2025-10-07T18:21:19.577Z" },
{ url = "https://files.pythonhosted.org/packages/58/1e/de6cda406d99fea84b66811c189b5ea139814b98125b052424b55d28a41c/ruff-0.12.7-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:74e6f5c04c4dd4aba223f4fe6e7104f79e0eebf7d307e4f9b18c18362124bccd", size = 13631555, upload-time = "2025-07-29T22:32:12.644Z" }, { url = "https://files.pythonhosted.org/packages/b3/00/1426978f97df4fe331074baf69615f579dc4e7c37bb4c6f57c2aad80c87f/ruff-0.14.0-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:eec3bbbf3a7d5482b5c1f42d5fc972774d71d107d447919fca620b0be3e3b75e", size = 14451506, upload-time = "2025-10-07T18:21:22.779Z" },
{ url = "https://files.pythonhosted.org/packages/6f/ae/625d46d5164a6cc9261945a5e89df24457dc8262539ace3ac36c40f0b51e/ruff-0.12.7-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5d0bfe4e77fba61bf2ccadf8cf005d6133e3ce08793bbe870dd1c734f2699a3e", size = 12667556, upload-time = "2025-07-29T22:32:15.312Z" }, { url = "https://files.pythonhosted.org/packages/58/d5/9c1cea6e493c0cf0647674cca26b579ea9d2a213b74b5c195fbeb9678e15/ruff-0.14.0-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:16b68e183a0e28e5c176d51004aaa40559e8f90065a10a559176713fcf435206", size = 13437384, upload-time = "2025-10-07T18:21:25.758Z" },
{ url = "https://files.pythonhosted.org/packages/55/bf/9cb1ea5e3066779e42ade8d0cd3d3b0582a5720a814ae1586f85014656b6/ruff-0.12.7-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:06bfb01e1623bf7f59ea749a841da56f8f653d641bfd046edee32ede7ff6c606", size = 12939784, upload-time = "2025-07-29T22:32:17.69Z" }, { url = "https://files.pythonhosted.org/packages/29/b4/4cd6a4331e999fc05d9d77729c95503f99eae3ba1160469f2b64866964e3/ruff-0.14.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:eb732d17db2e945cfcbbc52af0143eda1da36ca8ae25083dd4f66f1542fdf82e", size = 13447976, upload-time = "2025-10-07T18:21:28.83Z" },
{ url = "https://files.pythonhosted.org/packages/55/7f/7ead2663be5627c04be83754c4f3096603bf5e99ed856c7cd29618c691bd/ruff-0.12.7-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:e41df94a957d50083fd09b916d6e89e497246698c3f3d5c681c8b3e7b9bb4ac8", size = 11771356, upload-time = "2025-07-29T22:32:20.134Z" }, { url = "https://files.pythonhosted.org/packages/3b/c0/ac42f546d07e4f49f62332576cb845d45c67cf5610d1851254e341d563b6/ruff-0.14.0-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:c958f66ab884b7873e72df38dcabee03d556a8f2ee1b8538ee1c2bbd619883dd", size = 13682850, upload-time = "2025-10-07T18:21:31.842Z" },
{ url = "https://files.pythonhosted.org/packages/17/40/a95352ea16edf78cd3a938085dccc55df692a4d8ba1b3af7accbe2c806b0/ruff-0.12.7-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:4000623300563c709458d0ce170c3d0d788c23a058912f28bbadc6f905d67afa", size = 11612124, upload-time = "2025-07-29T22:32:22.645Z" }, { url = "https://files.pythonhosted.org/packages/5f/c4/4b0c9bcadd45b4c29fe1af9c5d1dc0ca87b4021665dfbe1c4688d407aa20/ruff-0.14.0-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:7eb0499a2e01f6e0c285afc5bac43ab380cbfc17cd43a2e1dd10ec97d6f2c42d", size = 12449825, upload-time = "2025-10-07T18:21:35.074Z" },
{ url = "https://files.pythonhosted.org/packages/4d/74/633b04871c669e23b8917877e812376827c06df866e1677f15abfadc95cb/ruff-0.12.7-py3-none-musllinux_1_2_i686.whl", hash = "sha256:69ffe0e5f9b2cf2b8e289a3f8945b402a1b19eff24ec389f45f23c42a3dd6fb5", size = 12479945, upload-time = "2025-07-29T22:32:24.765Z" }, { url = "https://files.pythonhosted.org/packages/4b/a8/e2e76288e6c16540fa820d148d83e55f15e994d852485f221b9524514730/ruff-0.14.0-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:4c63b2d99fafa05efca0ab198fd48fa6030d57e4423df3f18e03aa62518c565f", size = 12272599, upload-time = "2025-10-07T18:21:38.08Z" },
{ url = "https://files.pythonhosted.org/packages/be/34/c3ef2d7799c9778b835a76189c6f53c179d3bdebc8c65288c29032e03613/ruff-0.12.7-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:a07a5c8ffa2611a52732bdc67bf88e243abd84fe2d7f6daef3826b59abbfeda4", size = 12998677, upload-time = "2025-07-29T22:32:27.022Z" }, { url = "https://files.pythonhosted.org/packages/18/14/e2815d8eff847391af632b22422b8207704222ff575dec8d044f9ab779b2/ruff-0.14.0-py3-none-musllinux_1_2_i686.whl", hash = "sha256:668fce701b7a222f3f5327f86909db2bbe99c30877c8001ff934c5413812ac02", size = 13193828, upload-time = "2025-10-07T18:21:41.216Z" },
{ url = "https://files.pythonhosted.org/packages/77/ab/aca2e756ad7b09b3d662a41773f3edcbd262872a4fc81f920dc1ffa44541/ruff-0.12.7-py3-none-win32.whl", hash = "sha256:c928f1b2ec59fb77dfdf70e0419408898b63998789cc98197e15f560b9e77f77", size = 11756687, upload-time = "2025-07-29T22:32:29.381Z" }, { url = "https://files.pythonhosted.org/packages/44/c6/61ccc2987cf0aecc588ff8f3212dea64840770e60d78f5606cd7dc34de32/ruff-0.14.0-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:a86bf575e05cb68dcb34e4c7dfe1064d44d3f0c04bbc0491949092192b515296", size = 13628617, upload-time = "2025-10-07T18:21:44.04Z" },
{ url = "https://files.pythonhosted.org/packages/b4/71/26d45a5042bc71db22ddd8252ca9d01e9ca454f230e2996bb04f16d72799/ruff-0.12.7-py3-none-win_amd64.whl", hash = "sha256:9c18f3d707ee9edf89da76131956aba1270c6348bfee8f6c647de841eac7194f", size = 12912365, upload-time = "2025-07-29T22:32:31.517Z" }, { url = "https://files.pythonhosted.org/packages/73/e6/03b882225a1b0627e75339b420883dc3c90707a8917d2284abef7a58d317/ruff-0.14.0-py3-none-win32.whl", hash = "sha256:7450a243d7125d1c032cb4b93d9625dea46c8c42b4f06c6b709baac168e10543", size = 12367872, upload-time = "2025-10-07T18:21:46.67Z" },
{ url = "https://files.pythonhosted.org/packages/4c/9b/0b8aa09817b63e78d94b4977f18b1fcaead3165a5ee49251c5d5c245bb2d/ruff-0.12.7-py3-none-win_arm64.whl", hash = "sha256:dfce05101dbd11833a0776716d5d1578641b7fddb537fe7fa956ab85d1769b69", size = 11982083, upload-time = "2025-07-29T22:32:33.881Z" }, { url = "https://files.pythonhosted.org/packages/41/77/56cf9cf01ea0bfcc662de72540812e5ba8e9563f33ef3d37ab2174892c47/ruff-0.14.0-py3-none-win_amd64.whl", hash = "sha256:ea95da28cd874c4d9c922b39381cbd69cb7e7b49c21b8152b014bd4f52acddc2", size = 13464628, upload-time = "2025-10-07T18:21:50.318Z" },
{ url = "https://files.pythonhosted.org/packages/c6/2a/65880dfd0e13f7f13a775998f34703674a4554906167dce02daf7865b954/ruff-0.14.0-py3-none-win_arm64.whl", hash = "sha256:f42c9495f5c13ff841b1da4cb3c2a42075409592825dada7c5885c2c844ac730", size = 12565142, upload-time = "2025-10-07T18:21:53.577Z" },
] ]
[[package]] [[package]]
@@ -2167,7 +2168,7 @@ name = "typing-inspection"
version = "0.4.1" version = "0.4.1"
source = { registry = "https://pypi.org/simple" } source = { registry = "https://pypi.org/simple" }
dependencies = [ dependencies = [
{ name = "typing-extensions" }, { name = "typing-extensions", marker = "extra == 'group-8-nonebot2-pydantic-v2' or extra != 'group-8-nonebot2-pydantic-v1'" },
] ]
sdist = { url = "https://files.pythonhosted.org/packages/f8/b1/0c11f5058406b3af7609f121aaa6b609744687f1d158b3c3a5bf4cc94238/typing_inspection-0.4.1.tar.gz", hash = "sha256:6ae134cc0203c33377d43188d4064e9b357dba58cff3185f22924610e70a9d28", size = 75726, upload-time = "2025-05-21T18:55:23.885Z" } sdist = { url = "https://files.pythonhosted.org/packages/f8/b1/0c11f5058406b3af7609f121aaa6b609744687f1d158b3c3a5bf4cc94238/typing_inspection-0.4.1.tar.gz", hash = "sha256:6ae134cc0203c33377d43188d4064e9b357dba58cff3185f22924610e70a9d28", size = 75726, upload-time = "2025-05-21T18:55:23.885Z" }
wheels = [ wheels = [

View File

@@ -289,7 +289,6 @@ opt2 = Option("--foo", default=OptionResult(value=False, args={"bar": 1}))
`Arparma` 有如下属性: `Arparma` 有如下属性:
- 调试类 - 调试类
- matched: 是否匹配成功 - matched: 是否匹配成功
- error_data: 解析失败时剩余的数据 - error_data: 解析失败时剩余的数据
- error_info: 解析失败时的异常内容 - error_info: 解析失败时的异常内容

View File

@@ -150,7 +150,7 @@ async def handle(
- `xxx: CommandResult` - `xxx: CommandResult`
- `xxx: Arparma`:命令的[解析结果](./command.md#解析结果) - `xxx: Arparma`:命令的[解析结果](./command.md#解析结果)
- `xxx: Duplication`:命令的解析结果的 [`Duplication`](./command.md#Duplication) - `xxx: Duplication`:命令的解析结果的 [`Duplication`](./command.md#duplication)
- `xxx: Alconna`:命令的源命令 - `xxx: Alconna`:命令的源命令
- `<key>: Match[<type>]`:上述的匹配项,使用 `key` 作为查询路径 - `<key>: Match[<type>]`:上述的匹配项,使用 `key` 作为查询路径
- `xxx: Query[<type>] = Query(<path>, default)`:上述的查询项,必需声明默认值以设置查询路径 `path` - `xxx: Query[<type>] = Query(<path>, default)`:上述的查询项,必需声明默认值以设置查询路径 `path`

View File

@@ -159,7 +159,7 @@ async def _(target: MsgTarget):
事实上,构造 `Target` 对象时,`self_id`, `scope`, `adapter` 和 `platform` 都会参与到 `selector` 的构造中。 事实上,构造 `Target` 对象时,`self_id`, `scope`, `adapter` 和 `platform` 都会参与到 `selector` 的构造中。
::tip :::tip
你其实可以使用 `Target` 来帮你筛选 `Bot` 对象: 你其实可以使用 `Target` 来帮你筛选 `Bot` 对象:

View File

@@ -0,0 +1,229 @@
---
sidebar_position: 8
description: 轻量化 HTML 绘图
---
# 轻量化 HTML 绘图
图片是机器人交互中不可或缺的一部分,对于信息展示的直观性、美观性有很大的作用。
基于 PIL 直接绘制图片具有良好的性能和存储开销,但是难以调试、维护过程式的绘图代码。
使用浏览器渲染类插件可以方便地绘制网页,且能够直接通过 JS 对网页效果进行编程,但是它占用的存储和内存空间相对可观。
NoneBot 提供的 `nonebot-plugin-htmlkit` 提供了另一种基于 HTML 和 CSS 语法的轻量化绘图选择:它基于 `litehtml` 解析库,无须安装额外的依赖即可使用,没有进程间通信带来的额外开销,且在支持 `webp` `avif` 等丰富图片格式的前提下,安装用的 wheel 文件大小仅有约 10 MB。
作为粗略的性能参考,在一台 Ryzen 7 9700X 的 Windows 电脑上,渲染 [PEP 7](https://peps.python.org/pep-0007/) 的 HTML 页面(分辨率为 800x5788大小约 1.4MB,从本地文件系统读取 CSS大约需要 100ms每个渲染任务内存最高占用约为 40MB.
## 安装插件
在使用前请先安装 `nonebot-plugin-htmlkit` 插件至项目环境中,可参考[获取商店插件](../tutorial/store.mdx#安装插件)来了解并选择安装插件的方式。如:
在**项目目录**下执行以下命令:
```bash
nb plugin install nonebot-plugin-htmlkit
```
`nonebot-plugin-htmlkit` 插件目前兼容以下系统架构:
- Windows x64
- macOS arm64M-系列芯片)
- Linux x64 (非 Alpine 等 musl 系发行版)
- Linux arm64 (非 Alpine 等 musl 系发行版)
:::caution 访问网络内容
如果需要访问网络资源(如 http(s) 网页内容NoneBot 需要客户端型驱动器Forward。内置的驱动器有 `~httpx``~aiohttp`
详见[选择驱动器](../advanced/driver.md)。
:::
## 使用插件
### 加载插件
在使用本插件前同样需要使用 `require` 方法进行**加载**并**导入**需要使用的方法,可参考 [跨插件访问](../advanced/requiring.md) 一节进行了解,如:
```python
from nonebot import require
require("nonebot_plugin_htmlkit")
from nonebot_plugin_htmlkit import html_to_pic, md_to_pic, template_to_pic, text_to_pic
```
插件会自动使用[配置中的参数](#配置-fontconfig)初始化 `fontconfig` 以提供字体查找功能。
### 渲染 API
`nonebot-plugin-htmlkit` 主要提供以下**异步**渲染函数:
#### html_to_pic
```python
async def html_to_pic(
html: str,
*,
base_url: str = "",
dpi: float = 144.0,
max_width: float = 800.0,
device_height: float = 600.0,
default_font_size: float = 12.0,
font_name: str = "sans-serif",
allow_refit: bool = True,
image_format: Literal["png", "jpeg"] = "png",
jpeg_quality: int = 100,
lang: str = "zh",
culture: str = "CN",
img_fetch_fn: ImgFetchFn = combined_img_fetcher,
css_fetch_fn: CSSFetchFn = combined_css_fetcher,
urljoin_fn: Callable[[str, str], str] = urllib3.parse.urljoin,
) -> bytes:
...
```
最核心的渲染函数。
`base_url``urljoin_fn` 控制着传入 `image_fetch_fn``css_fetch_fn` 回调的 url 内容。
`allow_refit` 如果为真,渲染时会自动缩小产出图片的宽度到最适合的宽度,否则必定产出 `max_width` 宽度的图片。
`max_width``device_height` 会在 `@media` 判断中被使用。
`img_fetch_fn` 预期为一个异步可调用对象(函数),接收图片 url 并返回对应 url 的 jpeg 或 png 二进制数据(`bytes`),可在拒绝加载时返回 `None`.
`css_fetch_fn` 预期为一个异步可调用对象(函数),接收目标 CSS url 并返回对应 url 的 CSS 文本(`str`),可在拒绝加载时返回 `None`.
以下为辅助的封装函数,关键字参数若未特殊说明均与 `html_to_pic` 含义相同。
#### text_to_pic
```python
async def text_to_pic(
text: str,
css_path: str = "",
*,
max_width: int = 500,
allow_refit: bool = True,
image_format: Literal["png", "jpeg"] = "png",
jpeg_quality: int = 100,
) -> bytes:
...
```
可用于渲染多行文本。
`text` 会被放置于 `<div id="main" class="main-box"> <div class="text">` 中,可据此编写 CSS 来改变文本表现。
#### md_to_pic
```python
async def md_to_pic(
md: str = "",
md_path: str = "",
css_path: str = "",
*,
max_width: int = 500,
img_fetch_fn: ImgFetchFn = combined_img_fetcher,
allow_refit: bool = True,
image_format: Literal["png", "jpeg"] = "png",
jpeg_quality: int = 100,
) -> bytes:
...
```
可用于渲染 Markdown 文本。默认为 GitHub Markdown Light 风格,支持基于 `pygments` 的代码高亮。
`md``md_path` 二选一,前者设置时应为 Markdown 的文本,后者设置时应为指向 Markdown 文本文件的路径。
#### template_to_pic
```python
async def template_to_pic(
template_path: str | PathLike[str] | Sequence[str | PathLike[str]],
template_name: str,
templates: Mapping[Any, Any],
filters: None | Mapping[str, Any] = None,
*,
max_width: int = 500,
device_height: int = 600,
base_url: str | None = None,
img_fetch_fn: ImgFetchFn = combined_img_fetcher,
css_fetch_fn: CSSFetchFn = combined_css_fetcher,
allow_refit: bool = True,
image_format: Literal["png", "jpeg"] = "png",
jpeg_quality: int = 100,
) -> bytes:
...
```
渲染 jinja2 模板。
`template_path` 为 jinja2 环境的路径,`template_name` 是环境中要加载模板的名字,`templates` 为传入模板的参数,`filters` 为过滤器名 -> 自定义过滤器的映射。
### 控制外部资源获取
通过传入 `img_fetch_fn``css_fetch_fn`,我们可以在实际访问资源前进行审查,修改资源的来源,或是对 IO 操作进行缓存。
`img_fetch_fn` 预期为一个异步可调用对象(函数),接收图片 url 并返回对应 url 的 jpeg 或 png 二进制数据(`bytes`),可在拒绝加载时返回 `None`.
`css_fetch_fn` 预期为一个异步可调用对象(函数),接收目标 CSS url 并返回对应 url 的 CSS 文本(`str`),可在拒绝加载时返回 `None`.
如果你想要禁用外部资源加载/只从文件系统加载/只从网络加载,可以使用 `none_fetcher` `filesystem_***_fetcher` `network_***_fetcher`
默认的 fetcher 行为(对于 `file://` 从文件系统加载,其余从网络加载)位于 `combined_***_fetcher`,可以通过对其封装实现缓存等操作。
## 配置项
### 配置 fontconfig
`htmlkit` 使用 `fontconfig` 查找字体,请参阅 [`fontconfig 用户手册`](https://fontconfig.pages.freedesktop.org/fontconfig/fontconfig-user) 了解环境变量的具体含义、如何通过编写配置文件修改字体配置等。
#### fontconfig_file
- **类型**: `str | None`
- **默认值**: `None`
覆盖默认的配置文件路径。
#### fontconfig_path
- **类型**: `str | None`
- **默认值**: `None`
覆盖默认的配置目录。
#### fontconfig_sysroot
- **类型**: `str | None`
- **默认值**: `None`
覆盖默认的 sysroot。
#### fc_debug
- **类型**: `str | None`
- **默认值**: `None`
设置 Fontconfig 的 debug 级别。
#### fc_dbg_match_filter
- **类型**: `str | None`
- **默认值**: `None`
`FC_DEBUG` 设置为 `MATCH2` 时,过滤 debug 输出。
#### fc_lang
- **类型**: `str | None`
- **默认值**: `None`
设置默认语言,否则从 `LOCALE` 环境变量获取。
#### fontconfig_use_mmap
- **类型**: `str | None`
- **默认值**: `None`
是否使用 `mmap(2)` 读取字体缓存。

View File

@@ -42,7 +42,7 @@ async def handle_function():
#### 处理近似事件 #### 处理近似事件
对于一系列**差异不大**的事件,我们往往具有相同的处理逻辑。这时,我们不希望将相同的逻辑编写两遍,而应该复用代码,以实现在同一个事件处理函数中处理多个近似事件。我们可以使用[事件重载](../advanced/dependency.mdx#Event)的特性来实现这一功能。例如: 对于一系列**差异不大**的事件,我们往往具有相同的处理逻辑。这时,我们不希望将相同的逻辑编写两遍,而应该复用代码,以实现在同一个事件处理函数中处理多个近似事件。我们可以使用[事件重载](../advanced/dependency.mdx#event)的特性来实现这一功能。例如:
<Tabs groupId="python"> <Tabs groupId="python">
<TabItem value="3.10" label="Python 3.10+" default> <TabItem value="3.10" label="Python 3.10+" default>

View File

@@ -155,7 +155,6 @@ async def test_example(app: App):
1. `should_call_send` 1. `should_call_send`
定义事件响应器预期发送的消息,即通过[事件响应器操作 send](../../appendices/session-control.mdx#send)进行的操作。`should_call_send` 有四个参数: 定义事件响应器预期发送的消息,即通过[事件响应器操作 send](../../appendices/session-control.mdx#send)进行的操作。`should_call_send` 有四个参数:
- `event`:回复的目标事件。 - `event`:回复的目标事件。
- `message`:预期的消息对象,可以是 `str`、`Message` 或 `MessageSegment`。 - `message`:预期的消息对象,可以是 `str`、`Message` 或 `MessageSegment`。
- `result`send 的返回值,将会返回给插件。 - `result`send 的返回值,将会返回给插件。
@@ -163,8 +162,7 @@ async def test_example(app: App):
- `**kwargs`send 方法的额外参数。 - `**kwargs`send 方法的额外参数。
2. `should_call_api` 2. `should_call_api`
定义事件响应器预期调用的平台 API 接口,即通过[调用平台 API](../../appendices/api-calling.mdx#调用平台-API)进行的操作。`should_call_api` 有四个参数: 定义事件响应器预期调用的平台 API 接口,即通过[调用平台 API](../../appendices/api-calling.mdx#调用平台-api)进行的操作。`should_call_api` 有四个参数:
- `api`API 名称。 - `api`API 名称。
- `data`:预期的请求数据。 - `data`:预期的请求数据。
- `result`call_api 的返回值,将会返回给插件。 - `result`call_api 的返回值,将会返回给插件。

View File

@@ -5,7 +5,62 @@ description: 配置编辑器以获得最佳体验
# 编辑器支持 # 编辑器支持
框架基于 [PEP484](https://www.python.org/dev/peps/pep-0484/)、[PEP 561](https://www.python.org/dev/peps/pep-0561/)、[PEP8](https://www.python.org/dev/peps/pep-0008/) 等规范进行开发并且**拥有完整类型注解**。框架使用 PyrightPylance工具进行类型检查确保代码可以被编辑器正确解析。 框架基于 [PEP 484](https://www.python.org/dev/peps/pep-0484/)、[PEP 561](https://www.python.org/dev/peps/pep-0561/)、[PEP 8](https://www.python.org/dev/peps/pep-0008/) 等规范进行开发并且**拥有完整类型注解**。框架使用 PyrightPylance工具进行类型检查确保代码可以被编辑器正确解析。
## CLI 脚手架提供的编辑器工具支持
在使用 NB-CLI [创建项目](./quick-start.mdx#创建项目)时,如果选择了用于插件开发的 `simple` 模板,其会根据选择的开发工具,**自动配置项目根目录下的 `.vscode/extensions.json` 文件**,以推荐最匹配的 VS Code 插件,同时自动将相应的预设配置项写入 `pyproject.toml` 作为“开箱即用”配置,从而提升开发体验。
```bash
[?] 选择一个要使用的模板: simple (插件开发者)
...
[?] 要使用哪些开发工具?
```
### 支持的开发工具
1. Pyright (Pylance)
[VS Code 插件](https://marketplace.visualstudio.com/items?itemName=ms-python.vscode-pylance) | [项目](https://github.com/microsoft/pyright) | [文档](https://microsoft.github.io/pyright/)
由微软开发的 Python 静态类型检查器和语言服务器,提供智能感知、跳转定义、查找引用、实时错误检查等强大功能。
作为 VS Code 官方推荐的 Python 语言服务器,与 Pylance 扩展配合使用,能提供最流畅、最准确的代码补全和类型推断体验,是绝大多数开发者的首选。
2. Ruff
[VS Code 插件](https://marketplace.visualstudio.com/items?itemName=charliermarsh.ruff) | [项目](https://github.com/astral-sh/ruff) | [文档](https://docs.astral.sh/ruff/)
一个用 Rust 编写的超快 Python 代码格式化和 lint 工具,完全兼容 `black``isort``flake8` 等主流工具的规则。
速度极快(比 `black``flake8` 快 100 倍以上),配置简单,能自动格式化代码并检测潜在错误、代码风格问题(尤其是误用同步网络请求库),是提升代码质量和开发效率的必备利器。
3. MyPy
[VS Code 插件](https://marketplace.visualstudio.com/items?itemName=matangover.mypy) | [项目](https://github.com/python/mypy) | [文档](https://mypy.readthedocs.io/en/stable/index.html)
一个官方实现的 Python 静态类型检查器,通过分析代码中的类型注解来发现类型错误。
4. BasedPyright
[VS Code 插件](https://marketplace.visualstudio.com/items?itemName=detachhead.basedpyright) | [项目](https://github.com/DetachHead/basedpyright) | [文档](https://docs.basedpyright.com/)
一个基于 Pyright 的、由社区维护的替代性 Python 语言服务器,旨在提供更优的类型检查支持与接近 Pylance 的更好的使用体验。
相较于 PylanceBasedPyright 允许配合 VS Code 之外的其他编辑器使用,同时也复刻了部分 Pylance 限定的功能。
如果您是高级用户,希望尝试 Pylance 的替代方案,或遇到 Pylance 在特定环境下的兼容性问题,可以考虑使用 BasedPyright。
:::caution 提示
为避免 `Pylance``BasedPyright` 相互冲突导致配置混乱甚至异常,脚手架默认不允许在创建项目时同时配置这两者。
如果确实需要同时使用,请在创建项目时选择 Pylance/Pyright 并根据[相关文档](https://docs.basedpyright.com/latest/installation/ides/#vscode-vscodium)进行手动配置。
:::
### 配置效果
选择上述工具后NB-CLI 会在您的项目根目录下生成一个 `.vscode/extensions.json` 文件并在 `pyproject.toml` 文件中写入相应的配置项。当您在 VS Code 中打开此项目时IDE
会自动弹出提示,建议您安装这些推荐的扩展,一键即可完成开发环境的初始化,让您可以立即开始编写代码,无需手动搜索和安装插件。
## 编辑器推荐配置 ## 编辑器推荐配置

View File

@@ -81,8 +81,9 @@ nb create
请注意,多选项使用**空格**选中或取消,**回车**确认。 请注意,多选项使用**空格**选中或取消,**回车**确认。
```bash ```bash
[?] 要使用哪些驱动器? FastAPI (FastAPI 驱动器)
[?] 要使用哪些适配器? Console (基于终端的交互式适配器) [?] 要使用哪些适配器? Console (基于终端的交互式适配器)
[?] 要使用哪些驱动器? FastAPI (FastAPI 驱动器)
[?] 要使用什么本地存储策略? 用户全局 (默认,适用于单用户下单实例)
[?] 立即安装依赖? (Y/n) Yes [?] 立即安装依赖? (Y/n) Yes
[?] 创建虚拟环境? (Y/n) Yes [?] 创建虚拟环境? (Y/n) Yes
``` ```

View File

@@ -10,6 +10,9 @@ options:
# 手动创建项目 # 手动创建项目
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
在[快速上手](../quick-start.mdx)中,我们已经介绍了如何安装和使用 `nb-cli` 创建一个项目。在本章节中,我们将简要介绍如何在不使用 `nb-cli` 的方式创建一个机器人项目的**最小实例**并启动。如果你想要了解 NoneBot 的启动流程,也可以阅读本章节。 在[快速上手](../quick-start.mdx)中,我们已经介绍了如何安装和使用 `nb-cli` 创建一个项目。在本章节中,我们将简要介绍如何在不使用 `nb-cli` 的方式创建一个机器人项目的**最小实例**并启动。如果你想要了解 NoneBot 的启动流程,也可以阅读本章节。
:::caution 警告 :::caution 警告
@@ -30,23 +33,51 @@ options:
1. (可选)创建虚拟环境,以 venv 为例 1. (可选)创建虚拟环境,以 venv 为例
<Tabs groupId="platform">
<TabItem value="windows" label="Windows" default>
```bash ```bash
# 创建虚拟环境
python -m venv .venv --prompt nonebot2 python -m venv .venv --prompt nonebot2
# windows # 激活虚拟环境
.venv\Scripts\activate .venv\Scripts\activate
# linux/macOS ```
</TabItem>
<TabItem value="linux/macos" label="Linux/macOS">
```bash
# 创建虚拟环境
python -m venv .venv --prompt nonebot2
# 激活虚拟环境
source .venv/bin/activate source .venv/bin/activate
``` ```
2. 安装 nonebot2 以及驱动器 </TabItem>
</Tabs>
2. 安装 nonebot2 以及驱动器,以 Fastapi 驱动器为例
<Tabs groupId="platform">
<TabItem value="windows" label="Windows" default>
```bash ```bash
pip install 'nonebot2[fastapi]' pip install "nonebot2[fastapi]"
``` ```
驱动器包名可以在 [驱动器商店](/store/drivers) 中找到。 </TabItem>
<TabItem value="linux/macos" label="Linux/macOS">
3. 安装适配器 ```bash
pip install "nonebot2[fastapi]"
```
</TabItem>
</Tabs>
驱动器包名可以在 [驱动器商店](/store/drivers) 中找到,请替换上文方括号中的内容。
3. 安装适配器,以 Console 适配器为例
```bash ```bash
pip install nonebot-adapter-console pip install nonebot-adapter-console
@@ -58,7 +89,7 @@ options:
配置文件用于存放 NoneBot 运行所需要的配置项,使用 [`pydantic`](https://docs.pydantic.dev/) 以及 [`python-dotenv`](https://saurabh-kumar.com/python-dotenv/) 来读取配置。配置项需符合 dotenv 格式,复杂类型数据需使用 JSON 格式填写。具体可选配置方式以及配置项详情参考[配置](../appendices/config.mdx)。 配置文件用于存放 NoneBot 运行所需要的配置项,使用 [`pydantic`](https://docs.pydantic.dev/) 以及 [`python-dotenv`](https://saurabh-kumar.com/python-dotenv/) 来读取配置。配置项需符合 dotenv 格式,复杂类型数据需使用 JSON 格式填写。具体可选配置方式以及配置项详情参考[配置](../appendices/config.mdx)。
在**项目文件夹**中创建一个 `.env` 文本文件,并写入以下内容: 在**项目文件夹**中创建一个名为 `.env` 文件,并写入以下内容:
```bash title=.env ```bash title=.env
HOST=0.0.0.0 # 配置 NoneBot 监听的 IP / 主机名 HOST=0.0.0.0 # 配置 NoneBot 监听的 IP / 主机名
@@ -101,10 +132,29 @@ if __name__ == "__main__":
## 运行机器人 ## 运行机器人
在**项目文件夹**中,使用配置好环境的 Python 解释器运行入口文件(如果使用虚拟环境,请先激活虚拟环境): 在**项目文件夹**中,使用配置好环境的 Python 解释器运行入口文件:
<Tabs groupId="platform">
<TabItem value="windows" label="Windows" default>
```bash ```bash
# 激活虚拟环境(未使用虚拟环境时跳过此行)
.venv\Scripts\activate
# 运行机器人
python bot.py python bot.py
``` ```
</TabItem>
<TabItem value="linux/macos" label="Linux/macOS">
```bash
# 激活虚拟环境(未使用虚拟环境时跳过此行)
source .venv/bin/activate
# 运行机器人
python bot.py
```
</TabItem>
</Tabs>
如果你后续使用了 `nb-cli` ,你仍可以使用 `nb run` 命令来运行机器人,`nb-cli` 会自动检测入口文件 `bot.py` 是否存在并运行。同时,你也可以使用 `nb run --reload` 来自动检测代码的更改并自动重新运行入口文件。 如果你后续使用了 `nb-cli` ,你仍可以使用 `nb run` 命令来运行机器人,`nb-cli` 会自动检测入口文件 `bot.py` 是否存在并运行。同时,你也可以使用 `nb run --reload` 来自动检测代码的更改并自动重新运行入口文件。

View File

@@ -64,7 +64,7 @@ options:
::: :::
:::caution 注意 :::caution 注意
如果在之前的[创建项目](./application.md)章节中手动创建了相关文件,那么你需要做出如下修改: 如果在之前的[创建项目](./application.mdx)章节中手动创建了相关文件,那么你需要做出如下修改:
1. 在项目目录中创建一个两层文件夹 `awesome_bot/plugins` 1. 在项目目录中创建一个两层文件夹 `awesome_bot/plugins`
@@ -189,12 +189,16 @@ nonebot.load_from_json("plugin_config.json", encoding="utf-8")
### `load_from_toml` ### `load_from_toml`
通过 TOML 文件加载插件,是 [`load_all_plugins`](#load_all_plugins) 的 TOML 变种。通过读取 TOML 文件中的 `[tool.nonebot]` Table 中的 `plugins` 和 `plugin_dirs` Array 进行加载。例如: 通过 TOML 文件加载插件,是 [`load_all_plugins`](#load_all_plugins) 的 TOML 变种。通过读取 TOML 文件中的 `[tool.nonebot]` Table 中的 `plugin_dirs` Array
`[tool.nonebot.plugins]` Table 中的多个 Array 进行加载。例如:
```toml title=plugin_config.toml ```toml title=plugin_config.toml
[tool.nonebot] [tool.nonebot]
plugins = ["path.to.your.plugin"]
plugin_dirs = ["path/to/your/plugins"] plugin_dirs = ["path/to/your/plugins"]
[tool.nonebot.plugins]
"@local" = ["path.to.your.plugin"] # 本地插件等非插件商店来源的插件
"nonebot-plugin-someplugin" = ["nonebot_plugin_someplugin"] # 插件商店来源的插件
``` ```
```python ```python

View File

@@ -24,6 +24,9 @@ NoneBot 提供了一个[商店](/store/plugins),商店内容均由社区开发
商店中每个内容的卡片都包含了其名称和简介等信息,点击**卡片右上角**链接图标即可跳转到其主页。 商店中每个内容的卡片都包含了其名称和简介等信息,点击**卡片右上角**链接图标即可跳转到其主页。
与此同时NB-CLI 也提供了一个 TUI 版本的商店界面,可通过 `nb adapter store`、`nb plugin store`、`nb driver store` 命令或 CLI
交互式界面进入。其提供了接近网页商店的体验,同时允许快捷安装到当前项目。
## 安装插件 ## 安装插件
<Asciinema <Asciinema

View File

@@ -300,6 +300,7 @@ export default async function createConfigAsync() {
future: { future: {
experimental_faster: true, experimental_faster: true,
v4: true,
}, },
plugins: [ plugins: [

View File

@@ -5,6 +5,66 @@ toc_max_heading_level: 2
# 更新日志 # 更新日志
## 最近更新
### 🚀 新功能
- Feature: 更新 NB-CLI 新版插件加载格式与文档 [@NCBM](https://github.com/NCBM) ([#3614](https://github.com/nonebot/nonebot2/pull/3614))
### 📝 文档
- Feature: 更新 NB-CLI 新版插件加载格式与文档 [@NCBM](https://github.com/NCBM) ([#3614](https://github.com/nonebot/nonebot2/pull/3614))
- Docs: 添加 htmlkit 文档至最佳实践 [@BlueGlassBlock](https://github.com/BlueGlassBlock) ([#3682](https://github.com/nonebot/nonebot2/pull/3682))
- Docs: 修复 userinfo 插件链接 [@XieXiLin2](https://github.com/XieXiLin2) ([#3660](https://github.com/nonebot/nonebot2/pull/3660))
- Docs: 升级 docusaurus 3.8.1 [@StarHeartHunt](https://github.com/StarHeartHunt) ([#3649](https://github.com/nonebot/nonebot2/pull/3649))
- Docs: 更新文档《手动创建项目》 [@Chen-Luan](https://github.com/Chen-Luan) ([#3623](https://github.com/nonebot/nonebot2/pull/3623))
- Docs: 增加 B站直播间 适配器说明 [@MingxuanGame](https://github.com/MingxuanGame) ([#3636](https://github.com/nonebot/nonebot2/pull/3636))
- Docs: 增加 VoceChat 适配器说明 [@5656565566](https://github.com/5656565566) ([#3627](https://github.com/nonebot/nonebot2/pull/3627))
### 💫 杂项
- CI: 严格约束 `test_depend` CPython 版本范围 [@StarHeartHunt](https://github.com/StarHeartHunt) ([#3713](https://github.com/nonebot/nonebot2/pull/3713))
- CI: 升级文档构建 node 版本 [@StarHeartHunt](https://github.com/StarHeartHunt) ([#3668](https://github.com/nonebot/nonebot2/pull/3668))
- CI: 测试矩阵加入 Python 3.13 [@StarHeartHunt](https://github.com/StarHeartHunt) ([#3605](https://github.com/nonebot/nonebot2/pull/3605))
### 🍻 插件发布
- Plugin: 链接分享自动解析 [@noneflow](https://github.com/noneflow) ([#3706](https://github.com/nonebot/nonebot2/pull/3706))
- Plugin: 怪物猎人集会码插件 [@noneflow](https://github.com/noneflow) ([#3684](https://github.com/nonebot/nonebot2/pull/3684))
- Plugin: nonebot-plugin-htmlkit [@noneflow](https://github.com/noneflow) ([#3695](https://github.com/nonebot/nonebot2/pull/3695))
- Plugin: 言令 [@noneflow](https://github.com/noneflow) ([#3675](https://github.com/nonebot/nonebot2/pull/3675))
- Plugin: 算法比赛助手 [@noneflow](https://github.com/noneflow) ([#3672](https://github.com/nonebot/nonebot2/pull/3672))
- Plugin: 复盘打卡 [@noneflow](https://github.com/noneflow) ([#3681](https://github.com/nonebot/nonebot2/pull/3681))
- Plugin: DMP 饥荒管理平台机器人 [@noneflow](https://github.com/noneflow) ([#3616](https://github.com/nonebot/nonebot2/pull/3616))
- Plugin: 谁是卧底小游戏 [@noneflow](https://github.com/noneflow) ([#3629](https://github.com/nonebot/nonebot2/pull/3629))
- Plugin: 夸克自动转存 [@noneflow](https://github.com/noneflow) ([#3671](https://github.com/nonebot/nonebot2/pull/3671))
- Plugin: 禁止复读 [@noneflow](https://github.com/noneflow) ([#3644](https://github.com/nonebot/nonebot2/pull/3644))
- Plugin: 蔚蓝档案今日运势 [@noneflow](https://github.com/noneflow) ([#3653](https://github.com/nonebot/nonebot2/pull/3653))
- Plugin: 分布式黑名单插件 [@noneflow](https://github.com/noneflow) ([#3655](https://github.com/nonebot/nonebot2/pull/3655))
- Plugin: 图片手办化 [@noneflow](https://github.com/noneflow) ([#3662](https://github.com/nonebot/nonebot2/pull/3662))
- Plugin: Akash Image Generator [@noneflow](https://github.com/noneflow) ([#3651](https://github.com/nonebot/nonebot2/pull/3651))
- Plugin: 让我看看!! [@noneflow](https://github.com/noneflow) ([#3648](https://github.com/nonebot/nonebot2/pull/3648))
- Plugin: ImageLibrary [@noneflow](https://github.com/noneflow) ([#3620](https://github.com/nonebot/nonebot2/pull/3620))
- Plugin: 抽象 [@noneflow](https://github.com/noneflow) ([#3638](https://github.com/nonebot/nonebot2/pull/3638))
- Plugin: 卖若插件 [@noneflow](https://github.com/noneflow) ([#3631](https://github.com/nonebot/nonebot2/pull/3631))
- Plugin: HuaEr聊天bot [@noneflow](https://github.com/noneflow) ([#3564](https://github.com/nonebot/nonebot2/pull/3564))
- Plugin: Remove nonebot_plugin_cnrail [@noneflow](https://github.com/noneflow) ([#3645](https://github.com/nonebot/nonebot2/pull/3645))
- Plugin: Remove nonebot_plugin_pingti [@noneflow](https://github.com/noneflow) ([#3646](https://github.com/nonebot/nonebot2/pull/3646))
- Plugin: Anipusher推送机 [@noneflow](https://github.com/noneflow) ([#3582](https://github.com/nonebot/nonebot2/pull/3582))
- Plugin: nonebot-plugin-simple-setu [@noneflow](https://github.com/noneflow) ([#3594](https://github.com/nonebot/nonebot2/pull/3594))
- Plugin: Alisten [@noneflow](https://github.com/noneflow) ([#3635](https://github.com/nonebot/nonebot2/pull/3635))
- Plugin: MC玩家皮肤渲染 [@noneflow](https://github.com/noneflow) ([#3613](https://github.com/nonebot/nonebot2/pull/3613))
- Plugin: EconomyValue [@noneflow](https://github.com/noneflow) ([#3566](https://github.com/nonebot/nonebot2/pull/3566))
### 🍻 机器人发布
- Bot: Amrita [@noneflow](https://github.com/noneflow) ([#3641](https://github.com/nonebot/nonebot2/pull/3641))
### 🍻 适配器发布
- Adapter: B站直播间 [@noneflow](https://github.com/noneflow) ([#3592](https://github.com/nonebot/nonebot2/pull/3592))
- Adapter: nonebot-adapter-vocechat [@noneflow](https://github.com/noneflow) ([#3536](https://github.com/nonebot/nonebot2/pull/3536))
## v2.4.3 ## v2.4.3
### 🚀 新功能 ### 🚀 新功能

View File

@@ -20,7 +20,6 @@ description: nonebot.adapters 模块
通常,在 Adapter 中编写协议通信相关代码,如: 建立通信连接、处理接收与发送 data 等。 通常,在 Adapter 中编写协议通信相关代码,如: 建立通信连接、处理接收与发送 data 等。
- **参数** - **参数**
- `driver` ([Driver](../drivers/index.md#Driver)): [Driver](../drivers/index.md#Driver) 实例 - `driver` ([Driver](../drivers/index.md#Driver)): [Driver](../drivers/index.md#Driver) 实例
- `**kwargs` (Any): 其他由 [Driver.register_adapter](../drivers/index.md#Driver-register-adapter) 传入的额外参数 - `**kwargs` (Any): 其他由 [Driver.register_adapter](../drivers/index.md#Driver-register-adapter) 传入的额外参数
@@ -46,7 +45,6 @@ description: nonebot.adapters 模块
empty empty
- **返回** - **返回**
- str - str
### _property_ `config` {#Adapter-config} ### _property_ `config` {#Adapter-config}
@@ -64,11 +62,9 @@ description: nonebot.adapters 模块
当有新的 [Bot](#Bot) 实例连接建立成功时调用。 当有新的 [Bot](#Bot) 实例连接建立成功时调用。
- **参数** - **参数**
- `bot` ([Bot](#Bot)): [Bot](#Bot) 实例 - `bot` ([Bot](#Bot)): [Bot](#Bot) 实例
- **返回** - **返回**
- None - None
### _method_ `bot_disconnect(bot)` {#Adapter-bot-disconnect} ### _method_ `bot_disconnect(bot)` {#Adapter-bot-disconnect}
@@ -80,11 +76,9 @@ description: nonebot.adapters 模块
当有 [Bot](#Bot) 实例连接断开时调用。 当有 [Bot](#Bot) 实例连接断开时调用。
- **参数** - **参数**
- `bot` ([Bot](#Bot)): [Bot](#Bot) 实例 - `bot` ([Bot](#Bot)): [Bot](#Bot) 实例
- **返回** - **返回**
- None - None
### _method_ `setup_http_server(setup)` {#Adapter-setup-http-server} ### _method_ `setup_http_server(setup)` {#Adapter-setup-http-server}
@@ -92,11 +86,9 @@ description: nonebot.adapters 模块
- **说明:** 设置一个 HTTP 服务器路由配置 - **说明:** 设置一个 HTTP 服务器路由配置
- **参数** - **参数**
- `setup` ([HTTPServerSetup](../drivers/index.md#HTTPServerSetup)) - `setup` ([HTTPServerSetup](../drivers/index.md#HTTPServerSetup))
- **返回** - **返回**
- untyped - untyped
### _method_ `setup_websocket_server(setup)` {#Adapter-setup-websocket-server} ### _method_ `setup_websocket_server(setup)` {#Adapter-setup-websocket-server}
@@ -104,11 +96,9 @@ description: nonebot.adapters 模块
- **说明:** 设置一个 WebSocket 服务器路由配置 - **说明:** 设置一个 WebSocket 服务器路由配置
- **参数** - **参数**
- `setup` ([WebSocketServerSetup](../drivers/index.md#WebSocketServerSetup)) - `setup` ([WebSocketServerSetup](../drivers/index.md#WebSocketServerSetup))
- **返回** - **返回**
- untyped - untyped
### _async method_ `request(setup)` {#Adapter-request} ### _async method_ `request(setup)` {#Adapter-request}
@@ -116,11 +106,9 @@ description: nonebot.adapters 模块
- **说明:** 进行一个 HTTP 客户端请求 - **说明:** 进行一个 HTTP 客户端请求
- **参数** - **参数**
- `setup` ([Request](../drivers/index.md#Request)) - `setup` ([Request](../drivers/index.md#Request))
- **返回** - **返回**
- [Response](../drivers/index.md#Response) - [Response](../drivers/index.md#Response)
### _method_ `websocket(setup)` {#Adapter-websocket} ### _method_ `websocket(setup)` {#Adapter-websocket}
@@ -128,21 +116,17 @@ description: nonebot.adapters 模块
- **说明:** 建立一个 WebSocket 客户端连接请求 - **说明:** 建立一个 WebSocket 客户端连接请求
- **参数** - **参数**
- `setup` ([Request](../drivers/index.md#Request)) - `setup` ([Request](../drivers/index.md#Request))
- **返回** - **返回**
- AsyncGenerator[[WebSocket](../drivers/index.md#WebSocket), None] - AsyncGenerator[[WebSocket](../drivers/index.md#WebSocket), None]
### _method_ `on_ready(func)` {#Adapter-on-ready} ### _method_ `on_ready(func)` {#Adapter-on-ready}
- **参数** - **参数**
- `func` (LIFESPAN_FUNC) - `func` (LIFESPAN_FUNC)
- **返回** - **返回**
- LIFESPAN_FUNC - LIFESPAN_FUNC
## _abstract class_ `Bot(adapter, self_id)` {#Bot} ## _abstract class_ `Bot(adapter, self_id)` {#Bot}
@@ -154,7 +138,6 @@ description: nonebot.adapters 模块
用于处理上报消息,并提供 API 调用接口。 用于处理上报消息,并提供 API 调用接口。
- **参数** - **参数**
- `adapter` ([Adapter](#Adapter)): 协议适配器实例 - `adapter` ([Adapter](#Adapter)): 协议适配器实例
- `self_id` (str): 机器人 ID - `self_id` (str): 机器人 ID
@@ -188,13 +171,11 @@ description: nonebot.adapters 模块
- **说明:** 调用机器人 API 接口,可以通过该函数或直接通过 bot 属性进行调用 - **说明:** 调用机器人 API 接口,可以通过该函数或直接通过 bot 属性进行调用
- **参数** - **参数**
- `api` (str): API 名称 - `api` (str): API 名称
- `**data` (Any): API 数据 - `**data` (Any): API 数据
- **返回** - **返回**
- Any - Any
- **用法** - **用法**
@@ -209,7 +190,6 @@ description: nonebot.adapters 模块
- **说明:** 调用机器人基础发送消息接口 - **说明:** 调用机器人基础发送消息接口
- **参数** - **参数**
- `event` ([Event](#Event)): 上报事件 - `event` ([Event](#Event)): 上报事件
- `message` (str | [Message](#Message) | [MessageSegment](#MessageSegment)): 要发送的消息 - `message` (str | [Message](#Message) | [MessageSegment](#MessageSegment)): 要发送的消息
@@ -217,7 +197,6 @@ description: nonebot.adapters 模块
- `**kwargs` (Any): 任意额外参数 - `**kwargs` (Any): 任意额外参数
- **返回** - **返回**
- Any - Any
### _classmethod_ `on_calling_api(func)` {#Bot-on-calling-api} ### _classmethod_ `on_calling_api(func)` {#Bot-on-calling-api}
@@ -227,17 +206,14 @@ description: nonebot.adapters 模块
调用 api 预处理。 调用 api 预处理。
钩子函数参数: 钩子函数参数:
- bot: 当前 bot 对象 - bot: 当前 bot 对象
- api: 调用的 api 名称 - api: 调用的 api 名称
- data: api 调用的参数字典 - data: api 调用的参数字典
- **参数** - **参数**
- `func` ([T_CallingAPIHook](../typing.md#T-CallingAPIHook)) - `func` ([T_CallingAPIHook](../typing.md#T-CallingAPIHook))
- **返回** - **返回**
- [T_CallingAPIHook](../typing.md#T-CallingAPIHook) - [T_CallingAPIHook](../typing.md#T-CallingAPIHook)
### _classmethod_ `on_called_api(func)` {#Bot-on-called-api} ### _classmethod_ `on_called_api(func)` {#Bot-on-called-api}
@@ -247,7 +223,6 @@ description: nonebot.adapters 模块
调用 api 后处理。 调用 api 后处理。
钩子函数参数: 钩子函数参数:
- bot: 当前 bot 对象 - bot: 当前 bot 对象
- exception: 调用 api 时发生的错误 - exception: 调用 api 时发生的错误
- api: 调用的 api 名称 - api: 调用的 api 名称
@@ -255,11 +230,9 @@ description: nonebot.adapters 模块
- result: api 调用的返回 - result: api 调用的返回
- **参数** - **参数**
- `func` ([T_CalledAPIHook](../typing.md#T-CalledAPIHook)) - `func` ([T_CalledAPIHook](../typing.md#T-CalledAPIHook))
- **返回** - **返回**
- [T_CalledAPIHook](../typing.md#T-CalledAPIHook) - [T_CalledAPIHook](../typing.md#T-CalledAPIHook)
## _abstract class_ `Event(<auto>)` {#Event} ## _abstract class_ `Event(<auto>)` {#Event}
@@ -279,7 +252,6 @@ description: nonebot.adapters 模块
empty empty
- **返回** - **返回**
- str - str
### _abstract method_ `get_event_name()` {#Event-get-event-name} ### _abstract method_ `get_event_name()` {#Event-get-event-name}
@@ -291,7 +263,6 @@ description: nonebot.adapters 模块
empty empty
- **返回** - **返回**
- str - str
### _abstract method_ `get_event_description()` {#Event-get-event-description} ### _abstract method_ `get_event_description()` {#Event-get-event-description}
@@ -303,7 +274,6 @@ description: nonebot.adapters 模块
empty empty
- **返回** - **返回**
- str - str
### _method_ `get_log_string()` {#Event-get-log-string} ### _method_ `get_log_string()` {#Event-get-log-string}
@@ -320,11 +290,9 @@ description: nonebot.adapters 模块
empty empty
- **返回** - **返回**
- str - str
- **异常** - **异常**
- NoLogException: 希望 NoneBot 隐藏该事件日志 - NoLogException: 希望 NoneBot 隐藏该事件日志
### _abstract method_ `get_user_id()` {#Event-get-user-id} ### _abstract method_ `get_user_id()` {#Event-get-user-id}
@@ -336,7 +304,6 @@ description: nonebot.adapters 模块
empty empty
- **返回** - **返回**
- str - str
### _abstract method_ `get_session_id()` {#Event-get-session-id} ### _abstract method_ `get_session_id()` {#Event-get-session-id}
@@ -348,7 +315,6 @@ description: nonebot.adapters 模块
empty empty
- **返回** - **返回**
- str - str
### _abstract method_ `get_message()` {#Event-get-message} ### _abstract method_ `get_message()` {#Event-get-message}
@@ -360,7 +326,6 @@ description: nonebot.adapters 模块
empty empty
- **返回** - **返回**
- [Message](#Message) - [Message](#Message)
### _method_ `get_plaintext()` {#Event-get-plaintext} ### _method_ `get_plaintext()` {#Event-get-plaintext}
@@ -376,7 +341,6 @@ description: nonebot.adapters 模块
empty empty
- **返回** - **返回**
- str - str
### _abstract method_ `is_tome()` {#Event-is-tome} ### _abstract method_ `is_tome()` {#Event-is-tome}
@@ -388,7 +352,6 @@ description: nonebot.adapters 模块
empty empty
- **返回** - **返回**
- bool - bool
## _abstract class_ `Message(<auto>)` {#Message} ## _abstract class_ `Message(<auto>)` {#Message}
@@ -396,7 +359,6 @@ description: nonebot.adapters 模块
- **说明:** 消息序列 - **说明:** 消息序列
- **参数** - **参数**
- `message`: 消息内容 - `message`: 消息内容
### _classmethod_ `template(format_string)` {#Message-template} ### _classmethod_ `template(format_string)` {#Message-template}
@@ -410,11 +372,9 @@ description: nonebot.adapters 模块
可以通过该消息类型的 `MessageSegment` 工厂方法创建消息。 可以通过该消息类型的 `MessageSegment` 工厂方法创建消息。
- **参数** - **参数**
- `format_string` (str | TM): 格式化模板 - `format_string` (str | TM): 格式化模板
- **返回** - **返回**
- [MessageTemplate](#MessageTemplate)[Self]: 消息格式化器 - [MessageTemplate](#MessageTemplate)[Self]: 消息格式化器
### _abstract classmethod_ `get_segment_class()` {#Message-get-segment-class} ### _abstract classmethod_ `get_segment_class()` {#Message-get-segment-class}
@@ -426,7 +386,6 @@ description: nonebot.adapters 模块
empty empty
- **返回** - **返回**
- type[TMS] - type[TMS]
### _abstract staticmethod_ `_construct(msg)` {#Message--construct} ### _abstract staticmethod_ `_construct(msg)` {#Message--construct}
@@ -434,11 +393,9 @@ description: nonebot.adapters 模块
- **说明:** 构造消息数组 - **说明:** 构造消息数组
- **参数** - **参数**
- `msg` (str) - `msg` (str)
- **返回** - **返回**
- Iterable[TMS] - Iterable[TMS]
### _method_ `__getitem__(args)` {#Message---getitem--} ### _method_ `__getitem__(args)` {#Message---getitem--}
@@ -446,53 +403,38 @@ description: nonebot.adapters 模块
- **重载** - **重载**
**1.** `(args) -> Self` **1.** `(args) -> Self`
- **参数** - **参数**
- `args` (str): 消息段类型 - `args` (str): 消息段类型
- **返回** - **返回**
- Self: 所有类型为 `args` 的消息段 - Self: 所有类型为 `args` 的消息段
**2.** `(args) -> TMS` **2.** `(args) -> TMS`
- **参数** - **参数**
- `args` (tuple[str, int]): 消息段类型和索引 - `args` (tuple[str, int]): 消息段类型和索引
- **返回** - **返回**
- TMS: 类型为 `args[0]` 的消息段第 `args[1]` 个 - TMS: 类型为 `args[0]` 的消息段第 `args[1]` 个
**3.** `(args) -> Self` **3.** `(args) -> Self`
- **参数** - **参数**
- `args` (tuple[str, slice]): 消息段类型和切片 - `args` (tuple[str, slice]): 消息段类型和切片
- **返回** - **返回**
- Self: 类型为 `args[0]` 的消息段切片 `args[1]` - Self: 类型为 `args[0]` 的消息段切片 `args[1]`
**4.** `(args) -> TMS` **4.** `(args) -> TMS`
- **参数** - **参数**
- `args` (int): 索引 - `args` (int): 索引
- **返回** - **返回**
- TMS: 第 `args` 个消息段 - TMS: 第 `args` 个消息段
**5.** `(args) -> Self` **5.** `(args) -> Self`
- **参数** - **参数**
- `args` (slice): 切片 - `args` (slice): 切片
- **返回** - **返回**
- Self: 消息切片 `args` - Self: 消息切片 `args`
### _method_ `__contains__(value)` {#Message---contains--} ### _method_ `__contains__(value)` {#Message---contains--}
@@ -500,11 +442,9 @@ description: nonebot.adapters 模块
- **说明:** 检查消息段是否存在 - **说明:** 检查消息段是否存在
- **参数** - **参数**
- `value` (TMS | str): 消息段或消息段类型 - `value` (TMS | str): 消息段或消息段类型
- **返回** - **返回**
- bool: 消息内是否存在给定消息段或给定类型的消息段 - bool: 消息内是否存在给定消息段或给定类型的消息段
### _method_ `has(value)` {#Message-has} ### _method_ `has(value)` {#Message-has}
@@ -512,11 +452,9 @@ description: nonebot.adapters 模块
- **说明:** 与 [`__contains__`](#Message---contains--) 相同 - **说明:** 与 [`__contains__`](#Message---contains--) 相同
- **参数** - **参数**
- `value` (TMS | str) - `value` (TMS | str)
- **返回** - **返回**
- bool - bool
### _method_ `index(value, *args)` {#Message-index} ### _method_ `index(value, *args)` {#Message-index}
@@ -524,7 +462,6 @@ description: nonebot.adapters 模块
- **说明:** 索引消息段 - **说明:** 索引消息段
- **参数** - **参数**
- `value` (TMS | str): 消息段或者消息段类型 - `value` (TMS | str): 消息段或者消息段类型
- `*args` (SupportsIndex) - `*args` (SupportsIndex)
@@ -532,11 +469,9 @@ description: nonebot.adapters 模块
- `arg`: start 与 end - `arg`: start 与 end
- **返回** - **返回**
- int: 索引 index - int: 索引 index
- **异常** - **异常**
- ValueError: 消息段不存在 - ValueError: 消息段不存在
### _method_ `get(type_, count=None)` {#Message-get} ### _method_ `get(type_, count=None)` {#Message-get}
@@ -544,13 +479,11 @@ description: nonebot.adapters 模块
- **说明:** 获取指定类型的消息段 - **说明:** 获取指定类型的消息段
- **参数** - **参数**
- `type_` (str): 消息段类型 - `type_` (str): 消息段类型
- `count` (int | None): 获取个数 - `count` (int | None): 获取个数
- **返回** - **返回**
- Self: 构建的新消息 - Self: 构建的新消息
### _method_ `count(value)` {#Message-count} ### _method_ `count(value)` {#Message-count}
@@ -558,11 +491,9 @@ description: nonebot.adapters 模块
- **说明:** 计算指定消息段的个数 - **说明:** 计算指定消息段的个数
- **参数** - **参数**
- `value` (TMS | str): 消息段或消息段类型 - `value` (TMS | str): 消息段或消息段类型
- **返回** - **返回**
- int: 个数 - int: 个数
### _method_ `only(value)` {#Message-only} ### _method_ `only(value)` {#Message-only}
@@ -570,11 +501,9 @@ description: nonebot.adapters 模块
- **说明:** 检查消息中是否仅包含指定消息段 - **说明:** 检查消息中是否仅包含指定消息段
- **参数** - **参数**
- `value` (TMS | str): 指定消息段或消息段类型 - `value` (TMS | str): 指定消息段或消息段类型
- **返回** - **返回**
- bool: 是否仅包含指定消息段 - bool: 是否仅包含指定消息段
### _method_ `append(obj)` {#Message-append} ### _method_ `append(obj)` {#Message-append}
@@ -582,11 +511,9 @@ description: nonebot.adapters 模块
- **说明:** 添加一个消息段到消息数组末尾。 - **说明:** 添加一个消息段到消息数组末尾。
- **参数** - **参数**
- `obj` (str | TMS): 要添加的消息段 - `obj` (str | TMS): 要添加的消息段
- **返回** - **返回**
- Self - Self
### _method_ `extend(obj)` {#Message-extend} ### _method_ `extend(obj)` {#Message-extend}
@@ -594,11 +521,9 @@ description: nonebot.adapters 模块
- **说明:** 拼接一个消息数组或多个消息段到消息数组末尾。 - **说明:** 拼接一个消息数组或多个消息段到消息数组末尾。
- **参数** - **参数**
- `obj` (Self | Iterable[TMS]): 要添加的消息数组 - `obj` (Self | Iterable[TMS]): 要添加的消息数组
- **返回** - **返回**
- Self - Self
### _method_ `join(iterable)` {#Message-join} ### _method_ `join(iterable)` {#Message-join}
@@ -606,11 +531,9 @@ description: nonebot.adapters 模块
- **说明:** 将多个消息连接并将自身作为分割 - **说明:** 将多个消息连接并将自身作为分割
- **参数** - **参数**
- `iterable` (Iterable[TMS | Self]): 要连接的消息 - `iterable` (Iterable[TMS | Self]): 要连接的消息
- **返回** - **返回**
- Self: 连接后的消息 - Self: 连接后的消息
### _method_ `copy()` {#Message-copy} ### _method_ `copy()` {#Message-copy}
@@ -622,7 +545,6 @@ description: nonebot.adapters 模块
empty empty
- **返回** - **返回**
- Self - Self
### _method_ `include(*types)` {#Message-include} ### _method_ `include(*types)` {#Message-include}
@@ -630,11 +552,9 @@ description: nonebot.adapters 模块
- **说明:** 过滤消息 - **说明:** 过滤消息
- **参数** - **参数**
- `*types` (str): 包含的消息段类型 - `*types` (str): 包含的消息段类型
- **返回** - **返回**
- Self: 新构造的消息 - Self: 新构造的消息
### _method_ `exclude(*types)` {#Message-exclude} ### _method_ `exclude(*types)` {#Message-exclude}
@@ -642,11 +562,9 @@ description: nonebot.adapters 模块
- **说明:** 过滤消息 - **说明:** 过滤消息
- **参数** - **参数**
- `*types` (str): 不包含的消息段类型 - `*types` (str): 不包含的消息段类型
- **返回** - **返回**
- Self: 新构造的消息 - Self: 新构造的消息
### _method_ `extract_plain_text()` {#Message-extract-plain-text} ### _method_ `extract_plain_text()` {#Message-extract-plain-text}
@@ -658,7 +576,6 @@ description: nonebot.adapters 模块
empty empty
- **返回** - **返回**
- str - str
## _abstract class_ `MessageSegment(<auto>)` {#MessageSegment} ## _abstract class_ `MessageSegment(<auto>)` {#MessageSegment}
@@ -690,7 +607,6 @@ description: nonebot.adapters 模块
empty empty
- **返回** - **返回**
- type[TM] - type[TM]
### _abstract method_ `__str__()` {#MessageSegment---str--} ### _abstract method_ `__str__()` {#MessageSegment---str--}
@@ -702,29 +618,24 @@ description: nonebot.adapters 模块
empty empty
- **返回** - **返回**
- str - str
### _method_ `__add__(other)` {#MessageSegment---add--} ### _method_ `__add__(other)` {#MessageSegment---add--}
- **参数** - **参数**
- `other` (str | TMS | Iterable[TMS]) - `other` (str | TMS | Iterable[TMS])
- **返回** - **返回**
- TM - TM
### _method_ `get(key, default=None)` {#MessageSegment-get} ### _method_ `get(key, default=None)` {#MessageSegment-get}
- **参数** - **参数**
- `key` (str) - `key` (str)
- `default` (Any) - `default` (Any)
- **返回** - **返回**
- untyped - untyped
### _method_ `keys()` {#MessageSegment-keys} ### _method_ `keys()` {#MessageSegment-keys}
@@ -734,7 +645,6 @@ description: nonebot.adapters 模块
empty empty
- **返回** - **返回**
- untyped - untyped
### _method_ `values()` {#MessageSegment-values} ### _method_ `values()` {#MessageSegment-values}
@@ -744,7 +654,6 @@ description: nonebot.adapters 模块
empty empty
- **返回** - **返回**
- untyped - untyped
### _method_ `items()` {#MessageSegment-items} ### _method_ `items()` {#MessageSegment-items}
@@ -754,17 +663,14 @@ description: nonebot.adapters 模块
empty empty
- **返回** - **返回**
- untyped - untyped
### _method_ `join(iterable)` {#MessageSegment-join} ### _method_ `join(iterable)` {#MessageSegment-join}
- **参数** - **参数**
- `iterable` (Iterable[TMS | TM]) - `iterable` (Iterable[TMS | TM])
- **返回** - **返回**
- TM - TM
### _method_ `copy()` {#MessageSegment-copy} ### _method_ `copy()` {#MessageSegment-copy}
@@ -774,7 +680,6 @@ description: nonebot.adapters 模块
empty empty
- **返回** - **返回**
- Self - Self
### _abstract method_ `is_text()` {#MessageSegment-is-text} ### _abstract method_ `is_text()` {#MessageSegment-is-text}
@@ -786,7 +691,6 @@ description: nonebot.adapters 模块
empty empty
- **返回** - **返回**
- bool - bool
## _class_ `MessageTemplate(template, factory=str, private_getattr=False)` {#MessageTemplate} ## _class_ `MessageTemplate(template, factory=str, private_getattr=False)` {#MessageTemplate}
@@ -794,7 +698,6 @@ description: nonebot.adapters 模块
- **说明:** 消息模板格式化实现类。 - **说明:** 消息模板格式化实现类。
- **参数** - **参数**
- `template` (str | TM): 模板 - `template` (str | TM): 模板
- `factory` (type[str] | type[TM]): 消息类型工厂,默认为 `str` - `factory` (type[str] | type[TM]): 消息类型工厂,默认为 `str`
@@ -804,13 +707,11 @@ description: nonebot.adapters 模块
### _method_ `add_format_spec(spec, name=None)` {#MessageTemplate-add-format-spec} ### _method_ `add_format_spec(spec, name=None)` {#MessageTemplate-add-format-spec}
- **参数** - **参数**
- `spec` (FormatSpecFunc_T) - `spec` (FormatSpecFunc_T)
- `name` (str | None) - `name` (str | None)
- **返回** - **返回**
- FormatSpecFunc_T - FormatSpecFunc_T
### _method_ `format(*args, **kwargs)` {#MessageTemplate-format} ### _method_ `format(*args, **kwargs)` {#MessageTemplate-format}
@@ -818,13 +719,11 @@ description: nonebot.adapters 模块
- **说明:** 根据传入参数和模板生成消息对象 - **说明:** 根据传入参数和模板生成消息对象
- **参数** - **参数**
- `*args` - `*args`
- `**kwargs` - `**kwargs`
- **返回** - **返回**
- TF - TF
### _method_ `format_map(mapping)` {#MessageTemplate-format-map} ### _method_ `format_map(mapping)` {#MessageTemplate-format-map}
@@ -832,17 +731,14 @@ description: nonebot.adapters 模块
- **说明:** 根据传入字典和模板生成消息对象, 在传入字段名不是有效标识符时有用 - **说明:** 根据传入字典和模板生成消息对象, 在传入字段名不是有效标识符时有用
- **参数** - **参数**
- `mapping` (Mapping[str, Any]) - `mapping` (Mapping[str, Any])
- **返回** - **返回**
- TF - TF
### _method_ `vformat(format_string, args, kwargs)` {#MessageTemplate-vformat} ### _method_ `vformat(format_string, args, kwargs)` {#MessageTemplate-vformat}
- **参数** - **参数**
- `format_string` (str) - `format_string` (str)
- `args` (Sequence[Any]) - `args` (Sequence[Any])
@@ -850,13 +746,11 @@ description: nonebot.adapters 模块
- `kwargs` (Mapping[str, Any]) - `kwargs` (Mapping[str, Any])
- **返回** - **返回**
- TF - TF
### _method_ `get_field(field_name, args, kwargs)` {#MessageTemplate-get-field} ### _method_ `get_field(field_name, args, kwargs)` {#MessageTemplate-get-field}
- **参数** - **参数**
- `field_name` (str) - `field_name` (str)
- `args` (Sequence[Any]) - `args` (Sequence[Any])
@@ -864,17 +758,14 @@ description: nonebot.adapters 模块
- `kwargs` (Mapping[str, Any]) - `kwargs` (Mapping[str, Any])
- **返回** - **返回**
- tuple[Any, int | str] - tuple[Any, int | str]
### _method_ `format_field(value, format_spec)` {#MessageTemplate-format-field} ### _method_ `format_field(value, format_spec)` {#MessageTemplate-format-field}
- **参数** - **参数**
- `value` (Any) - `value` (Any)
- `format_spec` (str) - `format_spec` (str)
- **返回** - **返回**
- Any - Any

View File

@@ -36,7 +36,6 @@ description: nonebot.compat 模块
- **说明:** FieldInfo class with extra property for compatibility with pydantic v1 - **说明:** FieldInfo class with extra property for compatibility with pydantic v1
- **参数** - **参数**
- `default` (Any) - `default` (Any)
- `**kwargs` (Any) - `**kwargs` (Any)
@@ -82,7 +81,6 @@ description: nonebot.compat 模块
- **说明:** Construct a ModelField from given infos. - **说明:** Construct a ModelField from given infos.
- **参数** - **参数**
- `name` (str) - `name` (str)
- `annotation` (Any) - `annotation` (Any)
@@ -90,7 +88,6 @@ description: nonebot.compat 模块
- `field_info` (FieldInfo | None) - `field_info` (FieldInfo | None)
- **返回** - **返回**
- Self - Self
### _method_ `get_default()` {#ModelField-get-default} ### _method_ `get_default()` {#ModelField-get-default}
@@ -102,7 +99,6 @@ description: nonebot.compat 模块
empty empty
- **返回** - **返回**
- Any - Any
### _method_ `validate_value(value)` {#ModelField-validate-value} ### _method_ `validate_value(value)` {#ModelField-validate-value}
@@ -110,11 +106,9 @@ description: nonebot.compat 模块
- **说明:** Validate the value pass to the field. - **说明:** Validate the value pass to the field.
- **参数** - **参数**
- `value` (Any) - `value` (Any)
- **返回** - **返回**
- Any - Any
## _def_ `extract_field_info(field_info)` {#extract-field-info} ## _def_ `extract_field_info(field_info)` {#extract-field-info}
@@ -122,11 +116,9 @@ description: nonebot.compat 模块
- **说明:** Get FieldInfo init kwargs from a FieldInfo instance. - **说明:** Get FieldInfo init kwargs from a FieldInfo instance.
- **参数** - **参数**
- `field_info` (BaseFieldInfo) - `field_info` (BaseFieldInfo)
- **返回** - **返回**
- dict[str, Any] - dict[str, Any]
## _def_ `model_fields(model)` {#model-fields} ## _def_ `model_fields(model)` {#model-fields}
@@ -134,11 +126,9 @@ description: nonebot.compat 模块
- **说明:** Get field list of a model. - **说明:** Get field list of a model.
- **参数** - **参数**
- `model` (type[BaseModel]) - `model` (type[BaseModel])
- **返回** - **返回**
- list[ModelField] - list[ModelField]
## _def_ `model_config(model)` {#model-config} ## _def_ `model_config(model)` {#model-config}
@@ -146,17 +136,14 @@ description: nonebot.compat 模块
- **说明:** Get config of a model. - **说明:** Get config of a model.
- **参数** - **参数**
- `model` (type[BaseModel]) - `model` (type[BaseModel])
- **返回** - **返回**
- Any - Any
## _def_ `model_dump(model, include=None, exclude=None, by_alias=False, exclude_unset=False, exclude_defaults=False, exclude_none=False)` {#model-dump} ## _def_ `model_dump(model, include=None, exclude=None, by_alias=False, exclude_unset=False, exclude_defaults=False, exclude_none=False)` {#model-dump}
- **参数** - **参数**
- `model` (BaseModel) - `model` (BaseModel)
- `include` (set[str] | None) - `include` (set[str] | None)
@@ -172,7 +159,6 @@ description: nonebot.compat 模块
- `exclude_none` (bool) - `exclude_none` (bool)
- **返回** - **返回**
- dict[str, Any] - dict[str, Any]
## _def_ `type_validate_python(type_, data)` {#type-validate-python} ## _def_ `type_validate_python(type_, data)` {#type-validate-python}
@@ -180,13 +166,11 @@ description: nonebot.compat 模块
- **说明:** Validate data with given type. - **说明:** Validate data with given type.
- **参数** - **参数**
- `type_` (type[T]) - `type_` (type[T])
- `data` (Any) - `data` (Any)
- **返回** - **返回**
- T - T
## _def_ `type_validate_json(type_, data)` {#type-validate-json} ## _def_ `type_validate_json(type_, data)` {#type-validate-json}
@@ -194,13 +178,11 @@ description: nonebot.compat 模块
- **说明:** Validate JSON with given type. - **说明:** Validate JSON with given type.
- **参数** - **参数**
- `type_` (type[T]) - `type_` (type[T])
- `data` (str | bytes) - `data` (str | bytes)
- **返回** - **返回**
- T - T
## _def_ `custom_validation(class_)` {#custom-validation} ## _def_ `custom_validation(class_)` {#custom-validation}
@@ -208,9 +190,7 @@ description: nonebot.compat 模块
- **说明:** Use pydantic v1 like validator generator in pydantic v2 - **说明:** Use pydantic v1 like validator generator in pydantic v2
- **参数** - **参数**
- `class_` (type[CVC]) - `class_` (type[CVC])
- **返回** - **返回**
- type[CVC] - type[CVC]

View File

@@ -24,7 +24,6 @@ NoneBot 使用 [`pydantic`](https://pydantic-docs.helpmanual.io/) 以及
将会从 **环境变量** > **dotenv 配置文件** 的优先级读取环境信息。 将会从 **环境变量** > **dotenv 配置文件** 的优先级读取环境信息。
- **参数** - **参数**
- `_env_file` (DOTENV_TYPE | None) - `_env_file` (DOTENV_TYPE | None)
- `_env_file_encoding` (str | None) - `_env_file_encoding` (str | None)
@@ -55,7 +54,6 @@ NoneBot 使用 [`pydantic`](https://pydantic-docs.helpmanual.io/) 以及
配置方法参考: [配置](https://nonebot.dev/docs/appendices/config) 配置方法参考: [配置](https://nonebot.dev/docs/appendices/config)
- **参数** - **参数**
- `_env_file` (DOTENV_TYPE | None) - `_env_file` (DOTENV_TYPE | None)
- `_env_file_encoding` (str | None) - `_env_file_encoding` (str | None)

View File

@@ -18,7 +18,6 @@ description: nonebot.dependencies 模块
继承自 `pydantic.fields.FieldInfo`,用于描述参数信息(不包括参数名)。 继承自 `pydantic.fields.FieldInfo`,用于描述参数信息(不包括参数名)。
- **参数** - **参数**
- `*args` - `*args`
- `validate` (bool) - `validate` (bool)
@@ -30,7 +29,6 @@ description: nonebot.dependencies 模块
- **说明:** 依赖注入容器 - **说明:** 依赖注入容器
- **参数** - **参数**
- `call`: 依赖注入的可调用对象,可以是任何 Callable 对象 - `call`: 依赖注入的可调用对象,可以是任何 Callable 对象
- `pre_checkers`: 依赖注入解析前的参数检查 - `pre_checkers`: 依赖注入解析前的参数检查
@@ -44,31 +42,26 @@ description: nonebot.dependencies 模块
### _staticmethod_ `parse_params(call, allow_types)` {#Dependent-parse-params} ### _staticmethod_ `parse_params(call, allow_types)` {#Dependent-parse-params}
- **参数** - **参数**
- `call` (\_DependentCallable[R]) - `call` (\_DependentCallable[R])
- `allow_types` (tuple[type[Param], ...]) - `allow_types` (tuple[type[Param], ...])
- **返回** - **返回**
- tuple[[ModelField](../compat.md#ModelField), ...] - tuple[[ModelField](../compat.md#ModelField), ...]
### _staticmethod_ `parse_parameterless(parameterless, allow_types)` {#Dependent-parse-parameterless} ### _staticmethod_ `parse_parameterless(parameterless, allow_types)` {#Dependent-parse-parameterless}
- **参数** - **参数**
- `parameterless` (tuple[Any, ...]) - `parameterless` (tuple[Any, ...])
- `allow_types` (tuple[type[Param], ...]) - `allow_types` (tuple[type[Param], ...])
- **返回** - **返回**
- tuple[Param, ...] - tuple[Param, ...]
### _classmethod_ `parse(*, call, parameterless=None, allow_types)` {#Dependent-parse} ### _classmethod_ `parse(*, call, parameterless=None, allow_types)` {#Dependent-parse}
- **参数** - **参数**
- `call` (\_DependentCallable[R]) - `call` (\_DependentCallable[R])
- `parameterless` (Iterable[Any] | None) - `parameterless` (Iterable[Any] | None)
@@ -76,25 +69,20 @@ description: nonebot.dependencies 模块
- `allow_types` (Iterable[type[Param]]) - `allow_types` (Iterable[type[Param]])
- **返回** - **返回**
- Dependent[R] - Dependent[R]
### _async method_ `check(**params)` {#Dependent-check} ### _async method_ `check(**params)` {#Dependent-check}
- **参数** - **参数**
- `**params` (Any) - `**params` (Any)
- **返回** - **返回**
- None - None
### _async method_ `solve(**params)` {#Dependent-solve} ### _async method_ `solve(**params)` {#Dependent-solve}
- **参数** - **参数**
- `**params` (Any) - `**params` (Any)
- **返回** - **返回**
- dict[str, Any] - dict[str, Any]

View File

@@ -12,11 +12,9 @@ description: nonebot.dependencies.utils 模块
- **说明:** 获取可调用对象签名 - **说明:** 获取可调用对象签名
- **参数** - **参数**
- `call` ((...) -> Any) - `call` ((...) -> Any)
- **返回** - **返回**
- inspect.Signature - inspect.Signature
## _def_ `get_typed_annotation(param, globalns)` {#get-typed-annotation} ## _def_ `get_typed_annotation(param, globalns)` {#get-typed-annotation}
@@ -24,13 +22,11 @@ description: nonebot.dependencies.utils 模块
- **说明:** 获取参数的类型注解 - **说明:** 获取参数的类型注解
- **参数** - **参数**
- `param` (inspect.Parameter) - `param` (inspect.Parameter)
- `globalns` (dict[str, Any]) - `globalns` (dict[str, Any])
- **返回** - **返回**
- Any - Any
## _def_ `check_field_type(field, value)` {#check-field-type} ## _def_ `check_field_type(field, value)` {#check-field-type}
@@ -38,11 +34,9 @@ description: nonebot.dependencies.utils 模块
- **说明:** 检查字段类型是否匹配 - **说明:** 检查字段类型是否匹配
- **参数** - **参数**
- `field` ([ModelField](../compat.md#ModelField)) - `field` ([ModelField](../compat.md#ModelField))
- `value` (Any) - `value` (Any)
- **返回** - **返回**
- Any - Any

View File

@@ -22,7 +22,6 @@ pip install nonebot2[aiohttp]
## _class_ `Session(params=None, headers=None, cookies=None, version=HTTPVersion.H11, timeout=None, proxy=None)` {#Session} ## _class_ `Session(params=None, headers=None, cookies=None, version=HTTPVersion.H11, timeout=None, proxy=None)` {#Session}
- **参数** - **参数**
- `params` (QueryTypes) - `params` (QueryTypes)
- `headers` (HeaderTypes) - `headers` (HeaderTypes)
@@ -38,11 +37,9 @@ pip install nonebot2[aiohttp]
### _async method_ `request(setup)` {#Session-request} ### _async method_ `request(setup)` {#Session-request}
- **参数** - **参数**
- `setup` ([Request](index.md#Request)) - `setup` ([Request](index.md#Request))
- **返回** - **返回**
- [Response](index.md#Response) - [Response](index.md#Response)
### _async method_ `setup()` {#Session-setup} ### _async method_ `setup()` {#Session-setup}
@@ -52,7 +49,6 @@ pip install nonebot2[aiohttp]
empty empty
- **返回** - **返回**
- None - None
### _async method_ `close()` {#Session-close} ### _async method_ `close()` {#Session-close}
@@ -62,7 +58,6 @@ pip install nonebot2[aiohttp]
empty empty
- **返回** - **返回**
- None - None
## _class_ `Mixin(<auto>)` {#Mixin} ## _class_ `Mixin(<auto>)` {#Mixin}
@@ -76,27 +71,22 @@ pip install nonebot2[aiohttp]
### _async method_ `request(setup)` {#Mixin-request} ### _async method_ `request(setup)` {#Mixin-request}
- **参数** - **参数**
- `setup` ([Request](index.md#Request)) - `setup` ([Request](index.md#Request))
- **返回** - **返回**
- [Response](index.md#Response) - [Response](index.md#Response)
### _method_ `websocket(setup)` {#Mixin-websocket} ### _method_ `websocket(setup)` {#Mixin-websocket}
- **参数** - **参数**
- `setup` ([Request](index.md#Request)) - `setup` ([Request](index.md#Request))
- **返回** - **返回**
- AsyncGenerator[[WebSocket](index.md#WebSocket), None] - AsyncGenerator[[WebSocket](index.md#WebSocket), None]
### _method_ `get_session(params=None, headers=None, cookies=None, version=HTTPVersion.H11, timeout=None, proxy=None)` {#Mixin-get-session} ### _method_ `get_session(params=None, headers=None, cookies=None, version=HTTPVersion.H11, timeout=None, proxy=None)` {#Mixin-get-session}
- **参数** - **参数**
- `params` (QueryTypes) - `params` (QueryTypes)
- `headers` (HeaderTypes) - `headers` (HeaderTypes)
@@ -110,7 +100,6 @@ pip install nonebot2[aiohttp]
- `proxy` (str | None) - `proxy` (str | None)
- **返回** - **返回**
- Session - Session
## _class_ `WebSocket(*, request, session, websocket)` {#WebSocket} ## _class_ `WebSocket(*, request, session, websocket)` {#WebSocket}
@@ -118,7 +107,6 @@ pip install nonebot2[aiohttp]
- **说明:** AIOHTTP Websocket Wrapper - **说明:** AIOHTTP Websocket Wrapper
- **参数** - **参数**
- `request` ([Request](index.md#Request)) - `request` ([Request](index.md#Request))
- `session` (aiohttp.ClientSession) - `session` (aiohttp.ClientSession)
@@ -132,19 +120,16 @@ pip install nonebot2[aiohttp]
empty empty
- **返回** - **返回**
- untyped - untyped
### _async method_ `close(code=1000, reason="")` {#WebSocket-close} ### _async method_ `close(code=1000, reason="")` {#WebSocket-close}
- **参数** - **参数**
- `code` (int) - `code` (int)
- `reason` (str) - `reason` (str)
- **返回** - **返回**
- untyped - untyped
### _async method_ `receive()` {#WebSocket-receive} ### _async method_ `receive()` {#WebSocket-receive}
@@ -154,7 +139,6 @@ pip install nonebot2[aiohttp]
empty empty
- **返回** - **返回**
- str - str
### _async method_ `receive_text()` {#WebSocket-receive-text} ### _async method_ `receive_text()` {#WebSocket-receive-text}
@@ -164,7 +148,6 @@ pip install nonebot2[aiohttp]
empty empty
- **返回** - **返回**
- str - str
### _async method_ `receive_bytes()` {#WebSocket-receive-bytes} ### _async method_ `receive_bytes()` {#WebSocket-receive-bytes}
@@ -174,33 +157,27 @@ pip install nonebot2[aiohttp]
empty empty
- **返回** - **返回**
- bytes - bytes
### _async method_ `send_text(data)` {#WebSocket-send-text} ### _async method_ `send_text(data)` {#WebSocket-send-text}
- **参数** - **参数**
- `data` (str) - `data` (str)
- **返回** - **返回**
- None - None
### _async method_ `send_bytes(data)` {#WebSocket-send-bytes} ### _async method_ `send_bytes(data)` {#WebSocket-send-bytes}
- **参数** - **参数**
- `data` (bytes) - `data` (bytes)
- **返回** - **返回**
- None - None
## _class_ `Driver(env, config)` {#Driver} ## _class_ `Driver(env, config)` {#Driver}
- **参数** - **参数**
- `env` ([Env](../config.md#Env)) - `env` ([Env](../config.md#Env))
- `config` ([Config](../config.md#Config)) - `config` ([Config](../config.md#Config))

View File

@@ -92,7 +92,6 @@ pip install nonebot2[fastapi]
- **说明:** FastAPI 驱动框架。 - **说明:** FastAPI 驱动框架。
- **参数** - **参数**
- `env` ([Env](../config.md#Env)) - `env` ([Env](../config.md#Env))
- `config` (NoneBotConfig) - `config` (NoneBotConfig)
@@ -124,21 +123,17 @@ pip install nonebot2[fastapi]
### _method_ `setup_http_server(setup)` {#Driver-setup-http-server} ### _method_ `setup_http_server(setup)` {#Driver-setup-http-server}
- **参数** - **参数**
- `setup` ([HTTPServerSetup](index.md#HTTPServerSetup)) - `setup` ([HTTPServerSetup](index.md#HTTPServerSetup))
- **返回** - **返回**
- untyped - untyped
### _method_ `setup_websocket_server(setup)` {#Driver-setup-websocket-server} ### _method_ `setup_websocket_server(setup)` {#Driver-setup-websocket-server}
- **参数** - **参数**
- `setup` ([WebSocketServerSetup](index.md#WebSocketServerSetup)) - `setup` ([WebSocketServerSetup](index.md#WebSocketServerSetup))
- **返回** - **返回**
- None - None
### _method_ `run(host=None, port=None, *args, app=None, **kwargs)` {#Driver-run} ### _method_ `run(host=None, port=None, *args, app=None, **kwargs)` {#Driver-run}
@@ -146,7 +141,6 @@ pip install nonebot2[fastapi]
- **说明:** 使用 `uvicorn` 启动 FastAPI - **说明:** 使用 `uvicorn` 启动 FastAPI
- **参数** - **参数**
- `host` (str | None) - `host` (str | None)
- `port` (int | None) - `port` (int | None)
@@ -158,7 +152,6 @@ pip install nonebot2[fastapi]
- `**kwargs` - `**kwargs`
- **返回** - **返回**
- untyped - untyped
## _class_ `FastAPIWebSocket(*, request, websocket)` {#FastAPIWebSocket} ## _class_ `FastAPIWebSocket(*, request, websocket)` {#FastAPIWebSocket}
@@ -166,7 +159,6 @@ pip install nonebot2[fastapi]
- **说明:** FastAPI WebSocket Wrapper - **说明:** FastAPI WebSocket Wrapper
- **参数** - **参数**
- `request` (BaseRequest) - `request` (BaseRequest)
- `websocket` ([WebSocket](index.md#WebSocket)) - `websocket` ([WebSocket](index.md#WebSocket))
@@ -178,19 +170,16 @@ pip install nonebot2[fastapi]
empty empty
- **返回** - **返回**
- None - None
### _async method_ `close(code=status.WS_1000_NORMAL_CLOSURE, reason="")` {#FastAPIWebSocket-close} ### _async method_ `close(code=status.WS_1000_NORMAL_CLOSURE, reason="")` {#FastAPIWebSocket-close}
- **参数** - **参数**
- `code` (int) - `code` (int)
- `reason` (str) - `reason` (str)
- **返回** - **返回**
- None - None
### _async method_ `receive()` {#FastAPIWebSocket-receive} ### _async method_ `receive()` {#FastAPIWebSocket-receive}
@@ -200,7 +189,6 @@ pip install nonebot2[fastapi]
empty empty
- **返回** - **返回**
- str | bytes - str | bytes
### _async method_ `receive_text()` {#FastAPIWebSocket-receive-text} ### _async method_ `receive_text()` {#FastAPIWebSocket-receive-text}
@@ -210,7 +198,6 @@ pip install nonebot2[fastapi]
empty empty
- **返回** - **返回**
- str - str
### _async method_ `receive_bytes()` {#FastAPIWebSocket-receive-bytes} ### _async method_ `receive_bytes()` {#FastAPIWebSocket-receive-bytes}
@@ -220,25 +207,20 @@ pip install nonebot2[fastapi]
empty empty
- **返回** - **返回**
- bytes - bytes
### _async method_ `send_text(data)` {#FastAPIWebSocket-send-text} ### _async method_ `send_text(data)` {#FastAPIWebSocket-send-text}
- **参数** - **参数**
- `data` (str) - `data` (str)
- **返回** - **返回**
- None - None
### _async method_ `send_bytes(data)` {#FastAPIWebSocket-send-bytes} ### _async method_ `send_bytes(data)` {#FastAPIWebSocket-send-bytes}
- **参数** - **参数**
- `data` (bytes) - `data` (bytes)
- **返回** - **返回**
- None - None

View File

@@ -22,7 +22,6 @@ pip install nonebot2[httpx]
## _class_ `Session(params=None, headers=None, cookies=None, version=HTTPVersion.H11, timeout=None, proxy=None)` {#Session} ## _class_ `Session(params=None, headers=None, cookies=None, version=HTTPVersion.H11, timeout=None, proxy=None)` {#Session}
- **参数** - **参数**
- `params` (QueryTypes) - `params` (QueryTypes)
- `headers` (HeaderTypes) - `headers` (HeaderTypes)
@@ -38,11 +37,9 @@ pip install nonebot2[httpx]
### _async method_ `request(setup)` {#Session-request} ### _async method_ `request(setup)` {#Session-request}
- **参数** - **参数**
- `setup` ([Request](index.md#Request)) - `setup` ([Request](index.md#Request))
- **返回** - **返回**
- [Response](index.md#Response) - [Response](index.md#Response)
### _async method_ `setup()` {#Session-setup} ### _async method_ `setup()` {#Session-setup}
@@ -52,7 +49,6 @@ pip install nonebot2[httpx]
empty empty
- **返回** - **返回**
- None - None
### _async method_ `close()` {#Session-close} ### _async method_ `close()` {#Session-close}
@@ -62,7 +58,6 @@ pip install nonebot2[httpx]
empty empty
- **返回** - **返回**
- None - None
## _class_ `Mixin(<auto>)` {#Mixin} ## _class_ `Mixin(<auto>)` {#Mixin}
@@ -76,17 +71,14 @@ pip install nonebot2[httpx]
### _async method_ `request(setup)` {#Mixin-request} ### _async method_ `request(setup)` {#Mixin-request}
- **参数** - **参数**
- `setup` ([Request](index.md#Request)) - `setup` ([Request](index.md#Request))
- **返回** - **返回**
- [Response](index.md#Response) - [Response](index.md#Response)
### _method_ `get_session(params=None, headers=None, cookies=None, version=HTTPVersion.H11, timeout=None, proxy=None)` {#Mixin-get-session} ### _method_ `get_session(params=None, headers=None, cookies=None, version=HTTPVersion.H11, timeout=None, proxy=None)` {#Mixin-get-session}
- **参数** - **参数**
- `params` (QueryTypes) - `params` (QueryTypes)
- `headers` (HeaderTypes) - `headers` (HeaderTypes)
@@ -100,13 +92,11 @@ pip install nonebot2[httpx]
- `proxy` (str | None) - `proxy` (str | None)
- **返回** - **返回**
- Session - Session
## _class_ `Driver(env, config)` {#Driver} ## _class_ `Driver(env, config)` {#Driver}
- **参数** - **参数**
- `env` ([Env](../config.md#Env)) - `env` ([Env](../config.md#Env))
- `config` ([Config](../config.md#Config)) - `config` ([Config](../config.md#Config))

View File

@@ -40,11 +40,9 @@ description: nonebot.drivers 模块
- **说明:** 设置一个 HTTP 服务器路由配置 - **说明:** 设置一个 HTTP 服务器路由配置
- **参数** - **参数**
- `setup` ([HTTPServerSetup](#HTTPServerSetup)) - `setup` ([HTTPServerSetup](#HTTPServerSetup))
- **返回** - **返回**
- None - None
### _abstract method_ `setup_websocket_server(setup)` {#ASGIMixin-setup-websocket-server} ### _abstract method_ `setup_websocket_server(setup)` {#ASGIMixin-setup-websocket-server}
@@ -52,23 +50,19 @@ description: nonebot.drivers 模块
- **说明:** 设置一个 WebSocket 服务器路由配置 - **说明:** 设置一个 WebSocket 服务器路由配置
- **参数** - **参数**
- `setup` ([WebSocketServerSetup](#WebSocketServerSetup)) - `setup` ([WebSocketServerSetup](#WebSocketServerSetup))
- **返回** - **返回**
- None - None
## _class_ `Cookies(cookies=None)` {#Cookies} ## _class_ `Cookies(cookies=None)` {#Cookies}
- **参数** - **参数**
- `cookies` (CookieTypes) - `cookies` (CookieTypes)
### _method_ `set(name, value, domain="", path="/")` {#Cookies-set} ### _method_ `set(name, value, domain="", path="/")` {#Cookies-set}
- **参数** - **参数**
- `name` (str) - `name` (str)
- `value` (str) - `value` (str)
@@ -78,13 +72,11 @@ description: nonebot.drivers 模块
- `path` (str) - `path` (str)
- **返回** - **返回**
- None - None
### _method_ `get(name, default=None, domain=None, path=None)` {#Cookies-get} ### _method_ `get(name, default=None, domain=None, path=None)` {#Cookies-get}
- **参数** - **参数**
- `name` (str) - `name` (str)
- `default` (str | None) - `default` (str | None)
@@ -94,13 +86,11 @@ description: nonebot.drivers 模块
- `path` (str | None) - `path` (str | None)
- **返回** - **返回**
- str | None - str | None
### _method_ `delete(name, domain=None, path=None)` {#Cookies-delete} ### _method_ `delete(name, domain=None, path=None)` {#Cookies-delete}
- **参数** - **参数**
- `name` (str) - `name` (str)
- `domain` (str | None) - `domain` (str | None)
@@ -108,39 +98,32 @@ description: nonebot.drivers 模块
- `path` (str | None) - `path` (str | None)
- **返回** - **返回**
- None - None
### _method_ `clear(domain=None, path=None)` {#Cookies-clear} ### _method_ `clear(domain=None, path=None)` {#Cookies-clear}
- **参数** - **参数**
- `domain` (str | None) - `domain` (str | None)
- `path` (str | None) - `path` (str | None)
- **返回** - **返回**
- None - None
### _method_ `update(cookies=None)` {#Cookies-update} ### _method_ `update(cookies=None)` {#Cookies-update}
- **参数** - **参数**
- `cookies` (CookieTypes) - `cookies` (CookieTypes)
- **返回** - **返回**
- None - None
### _method_ `as_header(request)` {#Cookies-as-header} ### _method_ `as_header(request)` {#Cookies-as-header}
- **参数** - **参数**
- `request` (Request) - `request` (Request)
- **返回** - **返回**
- dict[str, str] - dict[str, str]
## _abstract class_ `Driver(env, config)` {#Driver} ## _abstract class_ `Driver(env, config)` {#Driver}
@@ -152,7 +135,6 @@ description: nonebot.drivers 模块
驱动器控制框架的启动和停止,适配器的注册,以及机器人生命周期管理。 驱动器控制框架的启动和停止,适配器的注册,以及机器人生命周期管理。
- **参数** - **参数**
- `env` ([Env](../config.md#Env)): 包含环境信息的 Env 对象 - `env` ([Env](../config.md#Env)): 包含环境信息的 Env 对象
- `config` ([Config](../config.md#Config)): 包含配置信息的 Config 对象 - `config` ([Config](../config.md#Config)): 包含配置信息的 Config 对象
@@ -180,13 +162,11 @@ description: nonebot.drivers 模块
- **说明:** 注册一个协议适配器 - **说明:** 注册一个协议适配器
- **参数** - **参数**
- `adapter` (type[[Adapter](../adapters/index.md#Adapter)]): 适配器类 - `adapter` (type[[Adapter](../adapters/index.md#Adapter)]): 适配器类
- `**kwargs`: 其他传递给适配器的参数 - `**kwargs`: 其他传递给适配器的参数
- **返回** - **返回**
- None - None
### _abstract property_ `type` {#Driver-type} ### _abstract property_ `type` {#Driver-type}
@@ -206,13 +186,11 @@ description: nonebot.drivers 模块
- **说明:** 启动驱动框架 - **说明:** 启动驱动框架
- **参数** - **参数**
- `*args` - `*args`
- `**kwargs` - `**kwargs`
- **返回** - **返回**
- untyped - untyped
### _method_ `on_startup(func)` {#Driver-on-startup} ### _method_ `on_startup(func)` {#Driver-on-startup}
@@ -220,11 +198,9 @@ description: nonebot.drivers 模块
- **说明:** 注册一个启动时执行的函数 - **说明:** 注册一个启动时执行的函数
- **参数** - **参数**
- `func` (LIFESPAN_FUNC) - `func` (LIFESPAN_FUNC)
- **返回** - **返回**
- LIFESPAN_FUNC - LIFESPAN_FUNC
### _method_ `on_shutdown(func)` {#Driver-on-shutdown} ### _method_ `on_shutdown(func)` {#Driver-on-shutdown}
@@ -232,11 +208,9 @@ description: nonebot.drivers 模块
- **说明:** 注册一个停止时执行的函数 - **说明:** 注册一个停止时执行的函数
- **参数** - **参数**
- `func` (LIFESPAN_FUNC) - `func` (LIFESPAN_FUNC)
- **返回** - **返回**
- LIFESPAN_FUNC - LIFESPAN_FUNC
### _classmethod_ `on_bot_connect(func)` {#Driver-on-bot-connect} ### _classmethod_ `on_bot_connect(func)` {#Driver-on-bot-connect}
@@ -246,15 +220,12 @@ description: nonebot.drivers 模块
装饰一个函数使他在 bot 连接成功时执行。 装饰一个函数使他在 bot 连接成功时执行。
钩子函数参数: 钩子函数参数:
- bot: 当前连接上的 Bot 对象 - bot: 当前连接上的 Bot 对象
- **参数** - **参数**
- `func` ([T_BotConnectionHook](../typing.md#T-BotConnectionHook)) - `func` ([T_BotConnectionHook](../typing.md#T-BotConnectionHook))
- **返回** - **返回**
- [T_BotConnectionHook](../typing.md#T-BotConnectionHook) - [T_BotConnectionHook](../typing.md#T-BotConnectionHook)
### _classmethod_ `on_bot_disconnect(func)` {#Driver-on-bot-disconnect} ### _classmethod_ `on_bot_disconnect(func)` {#Driver-on-bot-disconnect}
@@ -264,15 +235,12 @@ description: nonebot.drivers 模块
装饰一个函数使他在 bot 连接断开时执行。 装饰一个函数使他在 bot 连接断开时执行。
钩子函数参数: 钩子函数参数:
- bot: 当前连接上的 Bot 对象 - bot: 当前连接上的 Bot 对象
- **参数** - **参数**
- `func` ([T_BotDisconnectionHook](../typing.md#T-BotDisconnectionHook)) - `func` ([T_BotDisconnectionHook](../typing.md#T-BotDisconnectionHook))
- **返回** - **返回**
- [T_BotDisconnectionHook](../typing.md#T-BotDisconnectionHook) - [T_BotDisconnectionHook](../typing.md#T-BotDisconnectionHook)
## _var_ `ForwardDriver` {#ForwardDriver} ## _var_ `ForwardDriver` {#ForwardDriver}
@@ -306,11 +274,9 @@ description: nonebot.drivers 模块
- **说明:** 发送一个 HTTP 请求 - **说明:** 发送一个 HTTP 请求
- **参数** - **参数**
- `setup` ([Request](#Request)) - `setup` ([Request](#Request))
- **返回** - **返回**
- [Response](#Response) - [Response](#Response)
### _abstract method_ `get_session(params=None, headers=None, cookies=None, version=HTTPVersion.H11, timeout=None, proxy=None)` {#HTTPClientMixin-get-session} ### _abstract method_ `get_session(params=None, headers=None, cookies=None, version=HTTPVersion.H11, timeout=None, proxy=None)` {#HTTPClientMixin-get-session}
@@ -318,7 +284,6 @@ description: nonebot.drivers 模块
- **说明:** 获取一个 HTTP 会话 - **说明:** 获取一个 HTTP 会话
- **参数** - **参数**
- `params` (QueryTypes) - `params` (QueryTypes)
- `headers` (HeaderTypes) - `headers` (HeaderTypes)
@@ -332,7 +297,6 @@ description: nonebot.drivers 模块
- `proxy` (str | None) - `proxy` (str | None)
- **返回** - **返回**
- HTTPClientSession - HTTPClientSession
## _class_ `HTTPServerSetup(<auto>)` {#HTTPServerSetup} ## _class_ `HTTPServerSetup(<auto>)` {#HTTPServerSetup}
@@ -350,7 +314,6 @@ description: nonebot.drivers 模块
- **参数** - **参数**
auto auto
- `H10: '1.0'` - `H10: '1.0'`
- `H11: '1.1'` - `H11: '1.1'`
@@ -374,7 +337,6 @@ description: nonebot.drivers 模块
## _class_ `Request(method, url, *, params=None, headers=None, cookies=None, content=None, data=None, json=None, files=None, version=HTTPVersion.H11, timeout=None, proxy=None)` {#Request} ## _class_ `Request(method, url, *, params=None, headers=None, cookies=None, content=None, data=None, json=None, files=None, version=HTTPVersion.H11, timeout=None, proxy=None)` {#Request}
- **参数** - **参数**
- `method` (str | bytes) - `method` (str | bytes)
- `url` (URL | str | RawURL) - `url` (URL | str | RawURL)
@@ -402,7 +364,6 @@ description: nonebot.drivers 模块
## _class_ `Response(status_code, *, headers=None, content=None, request=None)` {#Response} ## _class_ `Response(status_code, *, headers=None, content=None, request=None)` {#Response}
- **参数** - **参数**
- `status_code` (int) - `status_code` (int)
- `headers` (HeaderTypes) - `headers` (HeaderTypes)
@@ -432,7 +393,6 @@ description: nonebot.drivers 模块
## _abstract class_ `WebSocket(*, request)` {#WebSocket} ## _abstract class_ `WebSocket(*, request)` {#WebSocket}
- **参数** - **参数**
- `request` (Request) - `request` (Request)
### _abstract property_ `closed` {#WebSocket-closed} ### _abstract property_ `closed` {#WebSocket-closed}
@@ -450,7 +410,6 @@ description: nonebot.drivers 模块
empty empty
- **返回** - **返回**
- None - None
### _abstract async method_ `close(code=1000, reason="")` {#WebSocket-close} ### _abstract async method_ `close(code=1000, reason="")` {#WebSocket-close}
@@ -458,13 +417,11 @@ description: nonebot.drivers 模块
- **说明:** 关闭 WebSocket 连接请求 - **说明:** 关闭 WebSocket 连接请求
- **参数** - **参数**
- `code` (int) - `code` (int)
- `reason` (str) - `reason` (str)
- **返回** - **返回**
- None - None
### _abstract async method_ `receive()` {#WebSocket-receive} ### _abstract async method_ `receive()` {#WebSocket-receive}
@@ -476,7 +433,6 @@ description: nonebot.drivers 模块
empty empty
- **返回** - **返回**
- str | bytes - str | bytes
### _abstract async method_ `receive_text()` {#WebSocket-receive-text} ### _abstract async method_ `receive_text()` {#WebSocket-receive-text}
@@ -488,7 +444,6 @@ description: nonebot.drivers 模块
empty empty
- **返回** - **返回**
- str - str
### _abstract async method_ `receive_bytes()` {#WebSocket-receive-bytes} ### _abstract async method_ `receive_bytes()` {#WebSocket-receive-bytes}
@@ -500,7 +455,6 @@ description: nonebot.drivers 模块
empty empty
- **返回** - **返回**
- bytes - bytes
### _async method_ `send(data)` {#WebSocket-send} ### _async method_ `send(data)` {#WebSocket-send}
@@ -508,11 +462,9 @@ description: nonebot.drivers 模块
- **说明:** 发送一条 WebSocket text/bytes 信息 - **说明:** 发送一条 WebSocket text/bytes 信息
- **参数** - **参数**
- `data` (str | bytes) - `data` (str | bytes)
- **返回** - **返回**
- None - None
### _abstract async method_ `send_text(data)` {#WebSocket-send-text} ### _abstract async method_ `send_text(data)` {#WebSocket-send-text}
@@ -520,11 +472,9 @@ description: nonebot.drivers 模块
- **说明:** 发送一条 WebSocket text 信息 - **说明:** 发送一条 WebSocket text 信息
- **参数** - **参数**
- `data` (str) - `data` (str)
- **返回** - **返回**
- None - None
### _abstract async method_ `send_bytes(data)` {#WebSocket-send-bytes} ### _abstract async method_ `send_bytes(data)` {#WebSocket-send-bytes}
@@ -532,11 +482,9 @@ description: nonebot.drivers 模块
- **说明:** 发送一条 WebSocket binary 信息 - **说明:** 发送一条 WebSocket binary 信息
- **参数** - **参数**
- `data` (bytes) - `data` (bytes)
- **返回** - **返回**
- None - None
## _abstract class_ `WebSocketClientMixin(<auto>)` {#WebSocketClientMixin} ## _abstract class_ `WebSocketClientMixin(<auto>)` {#WebSocketClientMixin}
@@ -552,11 +500,9 @@ description: nonebot.drivers 模块
- **说明:** 发起一个 WebSocket 连接 - **说明:** 发起一个 WebSocket 连接
- **参数** - **参数**
- `setup` ([Request](#Request)) - `setup` ([Request](#Request))
- **返回** - **返回**
- AsyncGenerator[[WebSocket](#WebSocket), None] - AsyncGenerator[[WebSocket](#WebSocket), None]
## _class_ `WebSocketServerSetup(<auto>)` {#WebSocketServerSetup} ## _class_ `WebSocketServerSetup(<auto>)` {#WebSocketServerSetup}
@@ -574,19 +520,14 @@ description: nonebot.drivers 模块
- **重载** - **重载**
**1.** `(driver) -> type[D]` **1.** `(driver) -> type[D]`
- **参数** - **参数**
- `driver` (type[D]) - `driver` (type[D])
- **返回** - **返回**
- type[D] - type[D]
**2.** `(driver, __m, /, *mixins) -> type[CombinedDriver]` **2.** `(driver, __m, /, *mixins) -> type[CombinedDriver]`
- **参数** - **参数**
- `driver` (type[D]) - `driver` (type[D])
- `__m` (type[[Mixin](#Mixin)]) - `__m` (type[[Mixin](#Mixin)])
@@ -594,5 +535,4 @@ description: nonebot.drivers 模块
- `*mixins` (type[[Mixin](#Mixin)]) - `*mixins` (type[[Mixin](#Mixin)])
- **返回** - **返回**
- type[CombinedDriver] - type[CombinedDriver]

View File

@@ -18,7 +18,6 @@ None 驱动适配
- **说明:** None 驱动框架 - **说明:** None 驱动框架
- **参数** - **参数**
- `env` ([Env](../config.md#Env)) - `env` ([Env](../config.md#Env))
- `config` ([Config](../config.md#Config)) - `config` ([Config](../config.md#Config))
@@ -40,13 +39,11 @@ None 驱动适配
- **说明:** 启动 none driver - **说明:** 启动 none driver
- **参数** - **参数**
- `*args` - `*args`
- `**kwargs` - `**kwargs`
- **返回** - **返回**
- untyped - untyped
### _method_ `exit(force=False)` {#Driver-exit} ### _method_ `exit(force=False)` {#Driver-exit}
@@ -54,9 +51,7 @@ None 驱动适配
- **说明:** 退出 none driver - **说明:** 退出 none driver
- **参数** - **参数**
- `force` (bool): 强制退出 - `force` (bool): 强制退出
- **返回** - **返回**
- untyped - untyped

View File

@@ -68,7 +68,6 @@ pip install nonebot2[quart]
- **说明:** Quart 驱动框架 - **说明:** Quart 驱动框架
- **参数** - **参数**
- `env` ([Env](../config.md#Env)) - `env` ([Env](../config.md#Env))
- `config` (NoneBotConfig) - `config` (NoneBotConfig)
@@ -100,21 +99,17 @@ pip install nonebot2[quart]
### _method_ `setup_http_server(setup)` {#Driver-setup-http-server} ### _method_ `setup_http_server(setup)` {#Driver-setup-http-server}
- **参数** - **参数**
- `setup` ([HTTPServerSetup](index.md#HTTPServerSetup)) - `setup` ([HTTPServerSetup](index.md#HTTPServerSetup))
- **返回** - **返回**
- untyped - untyped
### _method_ `setup_websocket_server(setup)` {#Driver-setup-websocket-server} ### _method_ `setup_websocket_server(setup)` {#Driver-setup-websocket-server}
- **参数** - **参数**
- `setup` ([WebSocketServerSetup](index.md#WebSocketServerSetup)) - `setup` ([WebSocketServerSetup](index.md#WebSocketServerSetup))
- **返回** - **返回**
- None - None
### _method_ `run(host=None, port=None, *args, app=None, **kwargs)` {#Driver-run} ### _method_ `run(host=None, port=None, *args, app=None, **kwargs)` {#Driver-run}
@@ -122,7 +117,6 @@ pip install nonebot2[quart]
- **说明:** 使用 `uvicorn` 启动 Quart - **说明:** 使用 `uvicorn` 启动 Quart
- **参数** - **参数**
- `host` (str | None) - `host` (str | None)
- `port` (int | None) - `port` (int | None)
@@ -134,7 +128,6 @@ pip install nonebot2[quart]
- `**kwargs` - `**kwargs`
- **返回** - **返回**
- untyped - untyped
## _class_ `WebSocket(*, request, websocket_ctx)` {#WebSocket} ## _class_ `WebSocket(*, request, websocket_ctx)` {#WebSocket}
@@ -142,7 +135,6 @@ pip install nonebot2[quart]
- **说明:** Quart WebSocket Wrapper - **说明:** Quart WebSocket Wrapper
- **参数** - **参数**
- `request` (BaseRequest) - `request` (BaseRequest)
- `websocket_ctx` (WebsocketContext) - `websocket_ctx` (WebsocketContext)
@@ -154,19 +146,16 @@ pip install nonebot2[quart]
empty empty
- **返回** - **返回**
- untyped - untyped
### _async method_ `close(code=1000, reason="")` {#WebSocket-close} ### _async method_ `close(code=1000, reason="")` {#WebSocket-close}
- **参数** - **参数**
- `code` (int) - `code` (int)
- `reason` (str) - `reason` (str)
- **返回** - **返回**
- untyped - untyped
### _async method_ `receive()` {#WebSocket-receive} ### _async method_ `receive()` {#WebSocket-receive}
@@ -176,7 +165,6 @@ pip install nonebot2[quart]
empty empty
- **返回** - **返回**
- str | bytes - str | bytes
### _async method_ `receive_text()` {#WebSocket-receive-text} ### _async method_ `receive_text()` {#WebSocket-receive-text}
@@ -186,7 +174,6 @@ pip install nonebot2[quart]
empty empty
- **返回** - **返回**
- str - str
### _async method_ `receive_bytes()` {#WebSocket-receive-bytes} ### _async method_ `receive_bytes()` {#WebSocket-receive-bytes}
@@ -196,25 +183,20 @@ pip install nonebot2[quart]
empty empty
- **返回** - **返回**
- bytes - bytes
### _async method_ `send_text(data)` {#WebSocket-send-text} ### _async method_ `send_text(data)` {#WebSocket-send-text}
- **参数** - **参数**
- `data` (str) - `data` (str)
- **返回** - **返回**
- untyped - untyped
### _async method_ `send_bytes(data)` {#WebSocket-send-bytes} ### _async method_ `send_bytes(data)` {#WebSocket-send-bytes}
- **参数** - **参数**
- `data` (bytes) - `data` (bytes)
- **返回** - **返回**
- untyped - untyped

View File

@@ -22,11 +22,9 @@ pip install nonebot2[websockets]
## _def_ `catch_closed(func)` {#catch-closed} ## _def_ `catch_closed(func)` {#catch-closed}
- **参数** - **参数**
- `func` ((P) -> Coroutine[Any, Any, T]) - `func` ((P) -> Coroutine[Any, Any, T])
- **返回** - **返回**
- (P) -> Coroutine[Any, Any, T] - (P) -> Coroutine[Any, Any, T]
## _class_ `Mixin(<auto>)` {#Mixin} ## _class_ `Mixin(<auto>)` {#Mixin}
@@ -40,11 +38,9 @@ pip install nonebot2[websockets]
### _method_ `websocket(setup)` {#Mixin-websocket} ### _method_ `websocket(setup)` {#Mixin-websocket}
- **参数** - **参数**
- `setup` ([Request](index.md#Request)) - `setup` ([Request](index.md#Request))
- **返回** - **返回**
- AsyncGenerator[[WebSocket](index.md#WebSocket), None] - AsyncGenerator[[WebSocket](index.md#WebSocket), None]
## _class_ `WebSocket(*, request, websocket)` {#WebSocket} ## _class_ `WebSocket(*, request, websocket)` {#WebSocket}
@@ -52,7 +48,6 @@ pip install nonebot2[websockets]
- **说明:** Websockets WebSocket Wrapper - **说明:** Websockets WebSocket Wrapper
- **参数** - **参数**
- `request` ([Request](index.md#Request)) - `request` ([Request](index.md#Request))
- `websocket` (WebSocketClientProtocol) - `websocket` (WebSocketClientProtocol)
@@ -64,19 +59,16 @@ pip install nonebot2[websockets]
empty empty
- **返回** - **返回**
- untyped - untyped
### _async method_ `close(code=1000, reason="")` {#WebSocket-close} ### _async method_ `close(code=1000, reason="")` {#WebSocket-close}
- **参数** - **参数**
- `code` (int) - `code` (int)
- `reason` (str) - `reason` (str)
- **返回** - **返回**
- untyped - untyped
### _async method_ `receive()` {#WebSocket-receive} ### _async method_ `receive()` {#WebSocket-receive}
@@ -86,7 +78,6 @@ pip install nonebot2[websockets]
empty empty
- **返回** - **返回**
- str | bytes - str | bytes
### _async method_ `receive_text()` {#WebSocket-receive-text} ### _async method_ `receive_text()` {#WebSocket-receive-text}
@@ -96,7 +87,6 @@ pip install nonebot2[websockets]
empty empty
- **返回** - **返回**
- str - str
### _async method_ `receive_bytes()` {#WebSocket-receive-bytes} ### _async method_ `receive_bytes()` {#WebSocket-receive-bytes}
@@ -106,33 +96,27 @@ pip install nonebot2[websockets]
empty empty
- **返回** - **返回**
- bytes - bytes
### _async method_ `send_text(data)` {#WebSocket-send-text} ### _async method_ `send_text(data)` {#WebSocket-send-text}
- **参数** - **参数**
- `data` (str) - `data` (str)
- **返回** - **返回**
- None - None
### _async method_ `send_bytes(data)` {#WebSocket-send-bytes} ### _async method_ `send_bytes(data)` {#WebSocket-send-bytes}
- **参数** - **参数**
- `data` (bytes) - `data` (bytes)
- **返回** - **返回**
- None - None
## _class_ `Driver(env, config)` {#Driver} ## _class_ `Driver(env, config)` {#Driver}
- **参数** - **参数**
- `env` ([Env](../config.md#Env)) - `env` ([Env](../config.md#Env))
- `config` ([Config](../config.md#Config)) - `config` ([Config](../config.md#Config))

View File

@@ -62,7 +62,6 @@ NoneBotException
- **说明:** 指示 NoneBot 应该忽略该事件。可由 PreProcessor 抛出。 - **说明:** 指示 NoneBot 应该忽略该事件。可由 PreProcessor 抛出。
- **参数** - **参数**
- `reason`: 忽略事件的原因 - `reason`: 忽略事件的原因
## _class_ `SkippedException(<auto>)` {#SkippedException} ## _class_ `SkippedException(<auto>)` {#SkippedException}
@@ -101,7 +100,6 @@ NoneBotException
- **说明:** 指示 NoneBot 阻止本次 API 调用或修改本次调用返回值,并返回自定义内容。 可由 api hook 抛出。 - **说明:** 指示 NoneBot 阻止本次 API 调用或修改本次调用返回值,并返回自定义内容。 可由 api hook 抛出。
- **参数** - **参数**
- `result`: 返回的内容 - `result`: 返回的内容
## _class_ `StopPropagation(<auto>)` {#StopPropagation} ## _class_ `StopPropagation(<auto>)` {#StopPropagation}
@@ -200,7 +198,6 @@ NoneBotException
- **说明:** 代表 `Adapter` 抛出的异常,所有的 `Adapter` 都要在内部继承自这个 `Exception`。 - **说明:** 代表 `Adapter` 抛出的异常,所有的 `Adapter` 都要在内部继承自这个 `Exception`。
- **参数** - **参数**
- `adapter_name`: 标识 adapter - `adapter_name`: 标识 adapter
## _class_ `NoLogException(<auto>)` {#NoLogException} ## _class_ `NoLogException(<auto>)` {#NoLogException}

View File

@@ -60,11 +60,9 @@ description: nonebot 模块
empty empty
- **返回** - **返回**
- [Driver](drivers/index.md#Driver): 全局 [Driver](drivers/index.md#Driver) 对象 - [Driver](drivers/index.md#Driver): 全局 [Driver](drivers/index.md#Driver) 对象
- **异常** - **异常**
- ValueError: 全局 [Driver](drivers/index.md#Driver) 对象尚未初始化 ([nonebot.init](#init) 尚未调用) - ValueError: 全局 [Driver](drivers/index.md#Driver) 对象尚未初始化 ([nonebot.init](#init) 尚未调用)
- **用法** - **用法**
@@ -80,27 +78,20 @@ description: nonebot 模块
- **重载** - **重载**
**1.** `(name) -> Adapter` **1.** `(name) -> Adapter`
- **参数** - **参数**
- `name` (str): 适配器名称 - `name` (str): 适配器名称
- **返回** - **返回**
- [Adapter](adapters/index.md#Adapter): 指定名称的 [Adapter](adapters/index.md#Adapter) 对象 - [Adapter](adapters/index.md#Adapter): 指定名称的 [Adapter](adapters/index.md#Adapter) 对象
**2.** `(name) -> A` **2.** `(name) -> A`
- **参数** - **参数**
- `name` (type[A]): 适配器类型 - `name` (type[A]): 适配器类型
- **返回** - **返回**
- A: 指定类型的 [Adapter](adapters/index.md#Adapter) 对象 - A: 指定类型的 [Adapter](adapters/index.md#Adapter) 对象
- **异常** - **异常**
- ValueError: 指定的 [Adapter](adapters/index.md#Adapter) 未注册 - ValueError: 指定的 [Adapter](adapters/index.md#Adapter) 未注册
- ValueError: 全局 [Driver](drivers/index.md#Driver) 对象尚未初始化 ([nonebot.init](#init) 尚未调用) - ValueError: 全局 [Driver](drivers/index.md#Driver) 对象尚未初始化 ([nonebot.init](#init) 尚未调用)
@@ -121,11 +112,9 @@ description: nonebot 模块
empty empty
- **返回** - **返回**
- dict[str, [Adapter](adapters/index.md#Adapter)]: 所有 [Adapter](adapters/index.md#Adapter) 实例字典 - dict[str, [Adapter](adapters/index.md#Adapter)]: 所有 [Adapter](adapters/index.md#Adapter) 实例字典
- **异常** - **异常**
- ValueError: 全局 [Driver](drivers/index.md#Driver) 对象尚未初始化 ([nonebot.init](#init) 尚未调用) - ValueError: 全局 [Driver](drivers/index.md#Driver) 对象尚未初始化 ([nonebot.init](#init) 尚未调用)
- **用法** - **用法**
@@ -143,11 +132,9 @@ description: nonebot 模块
empty empty
- **返回** - **返回**
- Any: Server App 对象 - Any: Server App 对象
- **异常** - **异常**
- AssertionError: 全局 Driver 对象不是 [ASGIMixin](drivers/index.md#ASGIMixin) 类型 - AssertionError: 全局 Driver 对象不是 [ASGIMixin](drivers/index.md#ASGIMixin) 类型
- ValueError: 全局 [Driver](drivers/index.md#Driver) 对象尚未初始化 ([nonebot.init](#init) 尚未调用) - ValueError: 全局 [Driver](drivers/index.md#Driver) 对象尚未初始化 ([nonebot.init](#init) 尚未调用)
@@ -167,11 +154,9 @@ description: nonebot 模块
empty empty
- **返回** - **返回**
- Any: ASGI 对象 - Any: ASGI 对象
- **异常** - **异常**
- AssertionError: 全局 Driver 对象不是 [ASGIMixin](drivers/index.md#ASGIMixin) 类型 - AssertionError: 全局 Driver 对象不是 [ASGIMixin](drivers/index.md#ASGIMixin) 类型
- ValueError: 全局 [Driver](drivers/index.md#Driver) 对象尚未初始化 ([nonebot.init](#init) 尚未调用) - ValueError: 全局 [Driver](drivers/index.md#Driver) 对象尚未初始化 ([nonebot.init](#init) 尚未调用)
@@ -192,15 +177,12 @@ description: nonebot 模块
当不提供时,返回一个 [Bot](adapters/index.md#Bot)。 当不提供时,返回一个 [Bot](adapters/index.md#Bot)。
- **参数** - **参数**
- `self_id` (str | None): 用来识别 [Bot](adapters/index.md#Bot) 的 [Bot.self_id](adapters/index.md#Bot-self-id) 属性 - `self_id` (str | None): 用来识别 [Bot](adapters/index.md#Bot) 的 [Bot.self_id](adapters/index.md#Bot-self-id) 属性
- **返回** - **返回**
- [Bot](adapters/index.md#Bot): [Bot](adapters/index.md#Bot) 对象 - [Bot](adapters/index.md#Bot): [Bot](adapters/index.md#Bot) 对象
- **异常** - **异常**
- KeyError: 对应 self_id 的 Bot 不存在 - KeyError: 对应 self_id 的 Bot 不存在
- ValueError: 没有传入 self_id 且没有 Bot 可用 - ValueError: 没有传入 self_id 且没有 Bot 可用
@@ -224,13 +206,11 @@ description: nonebot 模块
empty empty
- **返回** - **返回**
- dict[str, [Bot](adapters/index.md#Bot)]: 一个以 [Bot.self_id](adapters/index.md#Bot-self-id) 为键 - dict[str, [Bot](adapters/index.md#Bot)]: 一个以 [Bot.self_id](adapters/index.md#Bot-self-id) 为键
[Bot](adapters/index.md#Bot) 对象为值的字典 [Bot](adapters/index.md#Bot) 对象为值的字典
- **异常** - **异常**
- ValueError: 全局 [Driver](drivers/index.md#Driver) 对象尚未初始化 ([nonebot.init](#init) 尚未调用) - ValueError: 全局 [Driver](drivers/index.md#Driver) 对象尚未初始化 ([nonebot.init](#init) 尚未调用)
- **用法** - **用法**
@@ -250,13 +230,11 @@ description: nonebot 模块
也可以传入自定义的 `_env_file` 来指定 NoneBot 从该文件读取配置。 也可以传入自定义的 `_env_file` 来指定 NoneBot 从该文件读取配置。
- **参数** - **参数**
- `_env_file` (DOTENV_TYPE | None): 配置文件名,默认从 `.env.{env_name}` 中读取配置 - `_env_file` (DOTENV_TYPE | None): 配置文件名,默认从 `.env.{env_name}` 中读取配置
- `**kwargs` (Any): 任意变量,将会存储到 [Driver.config](drivers/index.md#Driver-config) 对象里 - `**kwargs` (Any): 任意变量,将会存储到 [Driver.config](drivers/index.md#Driver-config) 对象里
- **返回** - **返回**
- None - None
- **用法** - **用法**
@@ -270,13 +248,11 @@ description: nonebot 模块
- **说明:** 启动 NoneBot即运行全局 [Driver](drivers/index.md#Driver) 对象。 - **说明:** 启动 NoneBot即运行全局 [Driver](drivers/index.md#Driver) 对象。
- **参数** - **参数**
- `*args` (Any): 传入 [Driver.run](drivers/index.md#Driver-run) 的位置参数 - `*args` (Any): 传入 [Driver.run](drivers/index.md#Driver-run) 的位置参数
- `**kwargs` (Any): 传入 [Driver.run](drivers/index.md#Driver-run) 的命名参数 - `**kwargs` (Any): 传入 [Driver.run](drivers/index.md#Driver-run) 的命名参数
- **返回** - **返回**
- None - None
- **用法** - **用法**

View File

@@ -25,7 +25,6 @@ NoneBot 使用 [`loguru`][loguru] 来记录日志信息。
NoneBot 日志记录器对象。 NoneBot 日志记录器对象。
默认信息: 默认信息:
- 格式: `[%(asctime)s %(name)s] %(levelname)s: %(message)s` - 格式: `[%(asctime)s %(name)s] %(levelname)s: %(message)s`
- 等级: `INFO` ,根据 `config.log_level` 配置改变 - 等级: `INFO` ,根据 `config.log_level` 配置改变
- 输出: 输出至 stdout - 输出: 输出至 stdout
@@ -47,11 +46,9 @@ NoneBot 使用 [`loguru`][loguru] 来记录日志信息。
### _method_ `emit(record)` {#LoguruHandler-emit} ### _method_ `emit(record)` {#LoguruHandler-emit}
- **参数** - **参数**
- `record` (logging.LogRecord) - `record` (logging.LogRecord)
- **返回** - **返回**
- untyped - untyped
## _def_ `default_filter(record)` {#default-filter} ## _def_ `default_filter(record)` {#default-filter}
@@ -59,11 +56,9 @@ NoneBot 使用 [`loguru`][loguru] 来记录日志信息。
- **说明:** 默认的日志过滤器,根据 `config.log_level` 配置改变日志等级。 - **说明:** 默认的日志过滤器,根据 `config.log_level` 配置改变日志等级。
- **参数** - **参数**
- `record` (Record) - `record` (Record)
- **返回** - **返回**
- untyped - untyped
## _var_ `default_format` {#default-format} ## _var_ `default_format` {#default-format}

View File

@@ -76,7 +76,6 @@ description: nonebot.matcher 模块
- **说明:** 创建一个新的事件响应器,并存储至 `matchers <#matchers>`\_ - **说明:** 创建一个新的事件响应器,并存储至 `matchers <#matchers>`\_
- **参数** - **参数**
- `type_` (str): 事件响应器类型,与 `event.get_type()` 一致时触发,空字符串表示任意 - `type_` (str): 事件响应器类型,与 `event.get_type()` 一致时触发,空字符串表示任意
- `rule` ([Rule](rule.md#Rule) | None): 匹配规则 - `rule` ([Rule](rule.md#Rule) | None): 匹配规则
@@ -106,7 +105,6 @@ description: nonebot.matcher 模块
- `default_permission_updater` ([T_PermissionUpdater](typing.md#T-PermissionUpdater) | [Dependent](dependencies/index.md#Dependent)[[Permission](permission.md#Permission)] | None): 默认会话权限更新函数 - `default_permission_updater` ([T_PermissionUpdater](typing.md#T-PermissionUpdater) | [Dependent](dependencies/index.md#Dependent)[[Permission](permission.md#Permission)] | None): 默认会话权限更新函数
- **返回** - **返回**
- type[Matcher]: 新的事件响应器类 - type[Matcher]: 新的事件响应器类
### _classmethod_ `destroy()` {#Matcher-destroy} ### _classmethod_ `destroy()` {#Matcher-destroy}
@@ -118,7 +116,6 @@ description: nonebot.matcher 模块
empty empty
- **返回** - **返回**
- None - None
### _classmethod_ `check_perm(bot, event, stack=None, dependency_cache=None)` {#Matcher-check-perm} ### _classmethod_ `check_perm(bot, event, stack=None, dependency_cache=None)` {#Matcher-check-perm}
@@ -126,7 +123,6 @@ description: nonebot.matcher 模块
- **说明:** 检查是否满足触发权限 - **说明:** 检查是否满足触发权限
- **参数** - **参数**
- `bot` ([Bot](adapters/index.md#Bot)): Bot 对象 - `bot` ([Bot](adapters/index.md#Bot)): Bot 对象
- `event` ([Event](adapters/index.md#Event)): 上报事件 - `event` ([Event](adapters/index.md#Event)): 上报事件
@@ -136,7 +132,6 @@ description: nonebot.matcher 模块
- `dependency_cache` ([T_DependencyCache](typing.md#T-DependencyCache) | None): 依赖缓存 - `dependency_cache` ([T_DependencyCache](typing.md#T-DependencyCache) | None): 依赖缓存
- **返回** - **返回**
- bool: 是否满足权限 - bool: 是否满足权限
### _classmethod_ `check_rule(bot, event, state, stack=None, dependency_cache=None)` {#Matcher-check-rule} ### _classmethod_ `check_rule(bot, event, state, stack=None, dependency_cache=None)` {#Matcher-check-rule}
@@ -144,7 +139,6 @@ description: nonebot.matcher 模块
- **说明:** 检查是否满足匹配规则 - **说明:** 检查是否满足匹配规则
- **参数** - **参数**
- `bot` ([Bot](adapters/index.md#Bot)): Bot 对象 - `bot` ([Bot](adapters/index.md#Bot)): Bot 对象
- `event` ([Event](adapters/index.md#Event)): 上报事件 - `event` ([Event](adapters/index.md#Event)): 上报事件
@@ -156,7 +150,6 @@ description: nonebot.matcher 模块
- `dependency_cache` ([T_DependencyCache](typing.md#T-DependencyCache) | None): 依赖缓存 - `dependency_cache` ([T_DependencyCache](typing.md#T-DependencyCache) | None): 依赖缓存
- **返回** - **返回**
- bool: 是否满足匹配规则 - bool: 是否满足匹配规则
### _classmethod_ `type_updater(func)` {#Matcher-type-updater} ### _classmethod_ `type_updater(func)` {#Matcher-type-updater}
@@ -164,11 +157,9 @@ description: nonebot.matcher 模块
- **说明:** 装饰一个函数来更改当前事件响应器的默认响应事件类型更新函数 - **说明:** 装饰一个函数来更改当前事件响应器的默认响应事件类型更新函数
- **参数** - **参数**
- `func` ([T_TypeUpdater](typing.md#T-TypeUpdater)): 响应事件类型更新函数 - `func` ([T_TypeUpdater](typing.md#T-TypeUpdater)): 响应事件类型更新函数
- **返回** - **返回**
- [T_TypeUpdater](typing.md#T-TypeUpdater) - [T_TypeUpdater](typing.md#T-TypeUpdater)
### _classmethod_ `permission_updater(func)` {#Matcher-permission-updater} ### _classmethod_ `permission_updater(func)` {#Matcher-permission-updater}
@@ -176,23 +167,19 @@ description: nonebot.matcher 模块
- **说明:** 装饰一个函数来更改当前事件响应器的默认会话权限更新函数 - **说明:** 装饰一个函数来更改当前事件响应器的默认会话权限更新函数
- **参数** - **参数**
- `func` ([T_PermissionUpdater](typing.md#T-PermissionUpdater)): 会话权限更新函数 - `func` ([T_PermissionUpdater](typing.md#T-PermissionUpdater)): 会话权限更新函数
- **返回** - **返回**
- [T_PermissionUpdater](typing.md#T-PermissionUpdater) - [T_PermissionUpdater](typing.md#T-PermissionUpdater)
### _classmethod_ `append_handler(handler, parameterless=None)` {#Matcher-append-handler} ### _classmethod_ `append_handler(handler, parameterless=None)` {#Matcher-append-handler}
- **参数** - **参数**
- `handler` ([T_Handler](typing.md#T-Handler)) - `handler` ([T_Handler](typing.md#T-Handler))
- `parameterless` (Iterable[Any] | None) - `parameterless` (Iterable[Any] | None)
- **返回** - **返回**
- [Dependent](dependencies/index.md#Dependent)[Any] - [Dependent](dependencies/index.md#Dependent)[Any]
### _classmethod_ `handle(parameterless=None)` {#Matcher-handle} ### _classmethod_ `handle(parameterless=None)` {#Matcher-handle}
@@ -200,11 +187,9 @@ description: nonebot.matcher 模块
- **说明:** 装饰一个函数来向事件响应器直接添加一个处理函数 - **说明:** 装饰一个函数来向事件响应器直接添加一个处理函数
- **参数** - **参数**
- `parameterless` (Iterable[Any] | None): 非参数类型依赖列表 - `parameterless` (Iterable[Any] | None): 非参数类型依赖列表
- **返回** - **返回**
- ([T_Handler](typing.md#T-Handler)) -> [T_Handler](typing.md#T-Handler) - ([T_Handler](typing.md#T-Handler)) -> [T_Handler](typing.md#T-Handler)
### _classmethod_ `receive(id="", parameterless=None)` {#Matcher-receive} ### _classmethod_ `receive(id="", parameterless=None)` {#Matcher-receive}
@@ -212,13 +197,11 @@ description: nonebot.matcher 模块
- **说明:** 装饰一个函数来指示 NoneBot 在接收用户新的一条消息后继续运行该函数 - **说明:** 装饰一个函数来指示 NoneBot 在接收用户新的一条消息后继续运行该函数
- **参数** - **参数**
- `id` (str): 消息 ID - `id` (str): 消息 ID
- `parameterless` (Iterable[Any] | None): 非参数类型依赖列表 - `parameterless` (Iterable[Any] | None): 非参数类型依赖列表
- **返回** - **返回**
- ([T_Handler](typing.md#T-Handler)) -> [T_Handler](typing.md#T-Handler) - ([T_Handler](typing.md#T-Handler)) -> [T_Handler](typing.md#T-Handler)
### _classmethod_ `got(key, prompt=None, parameterless=None)` {#Matcher-got} ### _classmethod_ `got(key, prompt=None, parameterless=None)` {#Matcher-got}
@@ -231,7 +214,6 @@ description: nonebot.matcher 模块
如果 `key` 已存在则直接继续运行 如果 `key` 已存在则直接继续运行
- **参数** - **参数**
- `key` (str): 参数名 - `key` (str): 参数名
- `prompt` (str | [Message](adapters/index.md#Message) | [MessageSegment](adapters/index.md#MessageSegment) | [MessageTemplate](adapters/index.md#MessageTemplate) | None): 在参数不存在时向用户发送的消息 - `prompt` (str | [Message](adapters/index.md#Message) | [MessageSegment](adapters/index.md#MessageSegment) | [MessageTemplate](adapters/index.md#MessageTemplate) | None): 在参数不存在时向用户发送的消息
@@ -239,7 +221,6 @@ description: nonebot.matcher 模块
- `parameterless` (Iterable[Any] | None): 非参数类型依赖列表 - `parameterless` (Iterable[Any] | None): 非参数类型依赖列表
- **返回** - **返回**
- ([T_Handler](typing.md#T-Handler)) -> [T_Handler](typing.md#T-Handler) - ([T_Handler](typing.md#T-Handler)) -> [T_Handler](typing.md#T-Handler)
### _classmethod_ `send(message, **kwargs)` {#Matcher-send} ### _classmethod_ `send(message, **kwargs)` {#Matcher-send}
@@ -247,13 +228,11 @@ description: nonebot.matcher 模块
- **说明:** 发送一条消息给当前交互用户 - **说明:** 发送一条消息给当前交互用户
- **参数** - **参数**
- `message` (str | [Message](adapters/index.md#Message) | [MessageSegment](adapters/index.md#MessageSegment) | [MessageTemplate](adapters/index.md#MessageTemplate)): 消息内容 - `message` (str | [Message](adapters/index.md#Message) | [MessageSegment](adapters/index.md#MessageSegment) | [MessageTemplate](adapters/index.md#MessageTemplate)): 消息内容
- `**kwargs` (Any): [Bot.send](adapters/index.md#Bot-send) 的参数, 请参考对应 adapter 的 bot 对象 api - `**kwargs` (Any): [Bot.send](adapters/index.md#Bot-send) 的参数, 请参考对应 adapter 的 bot 对象 api
- **返回** - **返回**
- Any - Any
### _classmethod_ `finish(message=None, **kwargs)` {#Matcher-finish} ### _classmethod_ `finish(message=None, **kwargs)` {#Matcher-finish}
@@ -261,13 +240,11 @@ description: nonebot.matcher 模块
- **说明:** 发送一条消息给当前交互用户并结束当前事件响应器 - **说明:** 发送一条消息给当前交互用户并结束当前事件响应器
- **参数** - **参数**
- `message` (str | [Message](adapters/index.md#Message) | [MessageSegment](adapters/index.md#MessageSegment) | [MessageTemplate](adapters/index.md#MessageTemplate) | None): 消息内容 - `message` (str | [Message](adapters/index.md#Message) | [MessageSegment](adapters/index.md#MessageSegment) | [MessageTemplate](adapters/index.md#MessageTemplate) | None): 消息内容
- `**kwargs`: [Bot.send](adapters/index.md#Bot-send) 的参数, 请参考对应 adapter 的 bot 对象 api - `**kwargs`: [Bot.send](adapters/index.md#Bot-send) 的参数, 请参考对应 adapter 的 bot 对象 api
- **返回** - **返回**
- NoReturn - NoReturn
### _classmethod_ `pause(prompt=None, **kwargs)` {#Matcher-pause} ### _classmethod_ `pause(prompt=None, **kwargs)` {#Matcher-pause}
@@ -275,13 +252,11 @@ description: nonebot.matcher 模块
- **说明:** 发送一条消息给当前交互用户并暂停事件响应器,在接收用户新的一条消息后继续下一个处理函数 - **说明:** 发送一条消息给当前交互用户并暂停事件响应器,在接收用户新的一条消息后继续下一个处理函数
- **参数** - **参数**
- `prompt` (str | [Message](adapters/index.md#Message) | [MessageSegment](adapters/index.md#MessageSegment) | [MessageTemplate](adapters/index.md#MessageTemplate) | None): 消息内容 - `prompt` (str | [Message](adapters/index.md#Message) | [MessageSegment](adapters/index.md#MessageSegment) | [MessageTemplate](adapters/index.md#MessageTemplate) | None): 消息内容
- `**kwargs`: [Bot.send](adapters/index.md#Bot-send) 的参数, 请参考对应 adapter 的 bot 对象 api - `**kwargs`: [Bot.send](adapters/index.md#Bot-send) 的参数, 请参考对应 adapter 的 bot 对象 api
- **返回** - **返回**
- NoReturn - NoReturn
### _classmethod_ `reject(prompt=None, **kwargs)` {#Matcher-reject} ### _classmethod_ `reject(prompt=None, **kwargs)` {#Matcher-reject}
@@ -289,13 +264,11 @@ description: nonebot.matcher 模块
- **说明:** 最近使用 `got` / `receive` 接收的消息不符合预期, 发送一条消息给当前交互用户并将当前事件处理流程中断在当前位置,在接收用户新的一个事件后从头开始执行当前处理函数 - **说明:** 最近使用 `got` / `receive` 接收的消息不符合预期, 发送一条消息给当前交互用户并将当前事件处理流程中断在当前位置,在接收用户新的一个事件后从头开始执行当前处理函数
- **参数** - **参数**
- `prompt` (str | [Message](adapters/index.md#Message) | [MessageSegment](adapters/index.md#MessageSegment) | [MessageTemplate](adapters/index.md#MessageTemplate) | None): 消息内容 - `prompt` (str | [Message](adapters/index.md#Message) | [MessageSegment](adapters/index.md#MessageSegment) | [MessageTemplate](adapters/index.md#MessageTemplate) | None): 消息内容
- `**kwargs`: [Bot.send](adapters/index.md#Bot-send) 的参数, 请参考对应 adapter 的 bot 对象 api - `**kwargs`: [Bot.send](adapters/index.md#Bot-send) 的参数, 请参考对应 adapter 的 bot 对象 api
- **返回** - **返回**
- NoReturn - NoReturn
### _classmethod_ `reject_arg(key, prompt=None, **kwargs)` {#Matcher-reject-arg} ### _classmethod_ `reject_arg(key, prompt=None, **kwargs)` {#Matcher-reject-arg}
@@ -303,7 +276,6 @@ description: nonebot.matcher 模块
- **说明:** 最近使用 `got` 接收的消息不符合预期, 发送一条消息给当前交互用户并将当前事件处理流程中断在当前位置,在接收用户新的一条消息后从头开始执行当前处理函数 - **说明:** 最近使用 `got` 接收的消息不符合预期, 发送一条消息给当前交互用户并将当前事件处理流程中断在当前位置,在接收用户新的一条消息后从头开始执行当前处理函数
- **参数** - **参数**
- `key` (str): 参数名 - `key` (str): 参数名
- `prompt` (str | [Message](adapters/index.md#Message) | [MessageSegment](adapters/index.md#MessageSegment) | [MessageTemplate](adapters/index.md#MessageTemplate) | None): 消息内容 - `prompt` (str | [Message](adapters/index.md#Message) | [MessageSegment](adapters/index.md#MessageSegment) | [MessageTemplate](adapters/index.md#MessageTemplate) | None): 消息内容
@@ -311,7 +283,6 @@ description: nonebot.matcher 模块
- `**kwargs`: [Bot.send](adapters/index.md#Bot-send) 的参数, 请参考对应 adapter 的 bot 对象 api - `**kwargs`: [Bot.send](adapters/index.md#Bot-send) 的参数, 请参考对应 adapter 的 bot 对象 api
- **返回** - **返回**
- NoReturn - NoReturn
### _classmethod_ `reject_receive(id="", prompt=None, **kwargs)` {#Matcher-reject-receive} ### _classmethod_ `reject_receive(id="", prompt=None, **kwargs)` {#Matcher-reject-receive}
@@ -319,7 +290,6 @@ description: nonebot.matcher 模块
- **说明:** 最近使用 `receive` 接收的消息不符合预期, 发送一条消息给当前交互用户并将当前事件处理流程中断在当前位置,在接收用户新的一个事件后从头开始执行当前处理函数 - **说明:** 最近使用 `receive` 接收的消息不符合预期, 发送一条消息给当前交互用户并将当前事件处理流程中断在当前位置,在接收用户新的一个事件后从头开始执行当前处理函数
- **参数** - **参数**
- `id` (str): 消息 id - `id` (str): 消息 id
- `prompt` (str | [Message](adapters/index.md#Message) | [MessageSegment](adapters/index.md#MessageSegment) | [MessageTemplate](adapters/index.md#MessageTemplate) | None): 消息内容 - `prompt` (str | [Message](adapters/index.md#Message) | [MessageSegment](adapters/index.md#MessageSegment) | [MessageTemplate](adapters/index.md#MessageTemplate) | None): 消息内容
@@ -327,7 +297,6 @@ description: nonebot.matcher 模块
- `**kwargs`: [Bot.send](adapters/index.md#Bot-send) 的参数, 请参考对应 adapter 的 bot 对象 api - `**kwargs`: [Bot.send](adapters/index.md#Bot-send) 的参数, 请参考对应 adapter 的 bot 对象 api
- **返回** - **返回**
- NoReturn - NoReturn
### _classmethod_ `skip()` {#Matcher-skip} ### _classmethod_ `skip()` {#Matcher-skip}
@@ -343,7 +312,6 @@ description: nonebot.matcher 模块
empty empty
- **返回** - **返回**
- NoReturn - NoReturn
### _method_ `get_receive(id, default=None)` {#Matcher-get-receive} ### _method_ `get_receive(id, default=None)` {#Matcher-get-receive}
@@ -357,25 +325,19 @@ description: nonebot.matcher 模块
- **重载** - **重载**
**1.** `(id) -> Event | None` **1.** `(id) -> Event | None`
- **参数** - **参数**
- `id` (str) - `id` (str)
- **返回** - **返回**
- [Event](adapters/index.md#Event) | None - [Event](adapters/index.md#Event) | None
**2.** `(id, default) -> Event | T` **2.** `(id, default) -> Event | T`
- **参数** - **参数**
- `id` (str) - `id` (str)
- `default` (T) - `default` (T)
- **返回** - **返回**
- [Event](adapters/index.md#Event) | T - [Event](adapters/index.md#Event) | T
### _method_ `set_receive(id, event)` {#Matcher-set-receive} ### _method_ `set_receive(id, event)` {#Matcher-set-receive}
@@ -383,13 +345,11 @@ description: nonebot.matcher 模块
- **说明:** 设置一个 `receive` 事件 - **说明:** 设置一个 `receive` 事件
- **参数** - **参数**
- `id` (str) - `id` (str)
- `event` ([Event](adapters/index.md#Event)) - `event` ([Event](adapters/index.md#Event))
- **返回** - **返回**
- None - None
### _method_ `get_last_receive(default=None)` {#Matcher-get-last-receive} ### _method_ `get_last_receive(default=None)` {#Matcher-get-last-receive}
@@ -403,23 +363,18 @@ description: nonebot.matcher 模块
- **重载** - **重载**
**1.** `() -> Event | None` **1.** `() -> Event | None`
- **参数** - **参数**
empty empty
- **返回** - **返回**
- [Event](adapters/index.md#Event) | None - [Event](adapters/index.md#Event) | None
**2.** `(default) -> Event | T` **2.** `(default) -> Event | T`
- **参数** - **参数**
- `default` (T) - `default` (T)
- **返回** - **返回**
- [Event](adapters/index.md#Event) | T - [Event](adapters/index.md#Event) | T
### _method_ `get_arg(key, default=None)` {#Matcher-get-arg} ### _method_ `get_arg(key, default=None)` {#Matcher-get-arg}
@@ -433,25 +388,19 @@ description: nonebot.matcher 模块
- **重载** - **重载**
**1.** `(key) -> Message | None` **1.** `(key) -> Message | None`
- **参数** - **参数**
- `key` (str) - `key` (str)
- **返回** - **返回**
- [Message](adapters/index.md#Message) | None - [Message](adapters/index.md#Message) | None
**2.** `(key, default) -> Message | T` **2.** `(key, default) -> Message | T`
- **参数** - **参数**
- `key` (str) - `key` (str)
- `default` (T) - `default` (T)
- **返回** - **返回**
- [Message](adapters/index.md#Message) | T - [Message](adapters/index.md#Message) | T
### _method_ `set_arg(key, message)` {#Matcher-set-arg} ### _method_ `set_arg(key, message)` {#Matcher-set-arg}
@@ -459,25 +408,21 @@ description: nonebot.matcher 模块
- **说明:** 设置一个 `got` 消息 - **说明:** 设置一个 `got` 消息
- **参数** - **参数**
- `key` (str) - `key` (str)
- `message` ([Message](adapters/index.md#Message)) - `message` ([Message](adapters/index.md#Message))
- **返回** - **返回**
- None - None
### _method_ `set_target(target, cache=True)` {#Matcher-set-target} ### _method_ `set_target(target, cache=True)` {#Matcher-set-target}
- **参数** - **参数**
- `target` (str) - `target` (str)
- `cache` (bool) - `cache` (bool)
- **返回** - **返回**
- None - None
### _method_ `get_target(default=None)` {#Matcher-get-target} ### _method_ `get_target(default=None)` {#Matcher-get-target}
@@ -485,23 +430,18 @@ description: nonebot.matcher 模块
- **重载** - **重载**
**1.** `() -> str | None` **1.** `() -> str | None`
- **参数** - **参数**
empty empty
- **返回** - **返回**
- str | None - str | None
**2.** `(default) -> str | T` **2.** `(default) -> str | T`
- **参数** - **参数**
- `default` (T) - `default` (T)
- **返回** - **返回**
- str | T - str | T
### _method_ `stop_propagation()` {#Matcher-stop-propagation} ### _method_ `stop_propagation()` {#Matcher-stop-propagation}
@@ -513,13 +453,11 @@ description: nonebot.matcher 模块
empty empty
- **返回** - **返回**
- untyped - untyped
### _async method_ `update_type(bot, event, stack=None, dependency_cache=None)` {#Matcher-update-type} ### _async method_ `update_type(bot, event, stack=None, dependency_cache=None)` {#Matcher-update-type}
- **参数** - **参数**
- `bot` ([Bot](adapters/index.md#Bot)) - `bot` ([Bot](adapters/index.md#Bot))
- `event` ([Event](adapters/index.md#Event)) - `event` ([Event](adapters/index.md#Event))
@@ -529,13 +467,11 @@ description: nonebot.matcher 模块
- `dependency_cache` ([T_DependencyCache](typing.md#T-DependencyCache) | None) - `dependency_cache` ([T_DependencyCache](typing.md#T-DependencyCache) | None)
- **返回** - **返回**
- str - str
### _async method_ `update_permission(bot, event, stack=None, dependency_cache=None)` {#Matcher-update-permission} ### _async method_ `update_permission(bot, event, stack=None, dependency_cache=None)` {#Matcher-update-permission}
- **参数** - **参数**
- `bot` ([Bot](adapters/index.md#Bot)) - `bot` ([Bot](adapters/index.md#Bot))
- `event` ([Event](adapters/index.md#Event)) - `event` ([Event](adapters/index.md#Event))
@@ -545,7 +481,6 @@ description: nonebot.matcher 模块
- `dependency_cache` ([T_DependencyCache](typing.md#T-DependencyCache) | None) - `dependency_cache` ([T_DependencyCache](typing.md#T-DependencyCache) | None)
- **返回** - **返回**
- [Permission](permission.md#Permission) - [Permission](permission.md#Permission)
### _async method_ `resolve_reject()` {#Matcher-resolve-reject} ### _async method_ `resolve_reject()` {#Matcher-resolve-reject}
@@ -555,25 +490,21 @@ description: nonebot.matcher 模块
empty empty
- **返回** - **返回**
- untyped - untyped
### _method_ `ensure_context(bot, event)` {#Matcher-ensure-context} ### _method_ `ensure_context(bot, event)` {#Matcher-ensure-context}
- **参数** - **参数**
- `bot` ([Bot](adapters/index.md#Bot)) - `bot` ([Bot](adapters/index.md#Bot))
- `event` ([Event](adapters/index.md#Event)) - `event` ([Event](adapters/index.md#Event))
- **返回** - **返回**
- untyped - untyped
### _async method_ `simple_run(bot, event, state, stack=None, dependency_cache=None)` {#Matcher-simple-run} ### _async method_ `simple_run(bot, event, state, stack=None, dependency_cache=None)` {#Matcher-simple-run}
- **参数** - **参数**
- `bot` ([Bot](adapters/index.md#Bot)) - `bot` ([Bot](adapters/index.md#Bot))
- `event` ([Event](adapters/index.md#Event)) - `event` ([Event](adapters/index.md#Event))
@@ -585,13 +516,11 @@ description: nonebot.matcher 模块
- `dependency_cache` ([T_DependencyCache](typing.md#T-DependencyCache) | None) - `dependency_cache` ([T_DependencyCache](typing.md#T-DependencyCache) | None)
- **返回** - **返回**
- untyped - untyped
### _async method_ `run(bot, event, state, stack=None, dependency_cache=None)` {#Matcher-run} ### _async method_ `run(bot, event, state, stack=None, dependency_cache=None)` {#Matcher-run}
- **参数** - **参数**
- `bot` ([Bot](adapters/index.md#Bot)) - `bot` ([Bot](adapters/index.md#Bot))
- `event` ([Event](adapters/index.md#Event)) - `event` ([Event](adapters/index.md#Event))
@@ -603,7 +532,6 @@ description: nonebot.matcher 模块
- `dependency_cache` ([T_DependencyCache](typing.md#T-DependencyCache) | None) - `dependency_cache` ([T_DependencyCache](typing.md#T-DependencyCache) | None)
- **返回** - **返回**
- untyped - untyped
## _class_ `MatcherManager()` {#MatcherManager} ## _class_ `MatcherManager()` {#MatcherManager}
@@ -625,7 +553,6 @@ description: nonebot.matcher 模块
empty empty
- **返回** - **返回**
- KeysView[int] - KeysView[int]
### _method_ `values()` {#MatcherManager-values} ### _method_ `values()` {#MatcherManager-values}
@@ -635,7 +562,6 @@ description: nonebot.matcher 模块
empty empty
- **返回** - **返回**
- ValuesView[list[type[[Matcher](#Matcher)]]] - ValuesView[list[type[[Matcher](#Matcher)]]]
### _method_ `items()` {#MatcherManager-items} ### _method_ `items()` {#MatcherManager-items}
@@ -645,7 +571,6 @@ description: nonebot.matcher 模块
empty empty
- **返回** - **返回**
- ItemsView[int, list[type[[Matcher](#Matcher)]]] - ItemsView[int, list[type[[Matcher](#Matcher)]]]
### _method_ `get(key, default=None)` {#MatcherManager-get} ### _method_ `get(key, default=None)` {#MatcherManager-get}
@@ -653,35 +578,27 @@ description: nonebot.matcher 模块
- **重载** - **重载**
**1.** `(key) -> list[type[Matcher]] | None` **1.** `(key) -> list[type[Matcher]] | None`
- **参数** - **参数**
- `key` (int) - `key` (int)
- **返回** - **返回**
- list[type[[Matcher](#Matcher)]] | None - list[type[[Matcher](#Matcher)]] | None
**2.** `(key, default) -> list[type[Matcher]] | T` **2.** `(key, default) -> list[type[Matcher]] | T`
- **参数** - **参数**
- `key` (int) - `key` (int)
- `default` (T) - `default` (T)
- **返回** - **返回**
- list[type[[Matcher](#Matcher)]] | T - list[type[[Matcher](#Matcher)]] | T
### _method_ `pop(key)` {#MatcherManager-pop} ### _method_ `pop(key)` {#MatcherManager-pop}
- **参数** - **参数**
- `key` (int) - `key` (int)
- **返回** - **返回**
- list[type[[Matcher](#Matcher)]] - list[type[[Matcher](#Matcher)]]
### _method_ `popitem()` {#MatcherManager-popitem} ### _method_ `popitem()` {#MatcherManager-popitem}
@@ -691,7 +608,6 @@ description: nonebot.matcher 模块
empty empty
- **返回** - **返回**
- tuple[int, list[type[[Matcher](#Matcher)]]] - tuple[int, list[type[[Matcher](#Matcher)]]]
### _method_ `clear()` {#MatcherManager-clear} ### _method_ `clear()` {#MatcherManager-clear}
@@ -701,29 +617,24 @@ description: nonebot.matcher 模块
empty empty
- **返回** - **返回**
- None - None
### _method_ `update(m, /)` {#MatcherManager-update} ### _method_ `update(m, /)` {#MatcherManager-update}
- **参数** - **参数**
- `m` (MutableMapping[int, list[type[[Matcher](#Matcher)]]]) - `m` (MutableMapping[int, list[type[[Matcher](#Matcher)]]])
- **返回** - **返回**
- None - None
### _method_ `setdefault(key, default)` {#MatcherManager-setdefault} ### _method_ `setdefault(key, default)` {#MatcherManager-setdefault}
- **参数** - **参数**
- `key` (int) - `key` (int)
- `default` (list[type[[Matcher](#Matcher)]]) - `default` (list[type[[Matcher](#Matcher)]])
- **返回** - **返回**
- list[type[[Matcher](#Matcher)]] - list[type[[Matcher](#Matcher)]]
### _method_ `set_provider(provider_class)` {#MatcherManager-set-provider} ### _method_ `set_provider(provider_class)` {#MatcherManager-set-provider}
@@ -731,11 +642,9 @@ description: nonebot.matcher 模块
- **说明:** 设置事件响应器存储器 - **说明:** 设置事件响应器存储器
- **参数** - **参数**
- `provider_class` (type[[MatcherProvider](#MatcherProvider)]): 事件响应器存储器类 - `provider_class` (type[[MatcherProvider](#MatcherProvider)]): 事件响应器存储器类
- **返回** - **返回**
- None - None
## _abstract class_ `MatcherProvider(matchers)` {#MatcherProvider} ## _abstract class_ `MatcherProvider(matchers)` {#MatcherProvider}
@@ -743,7 +652,6 @@ description: nonebot.matcher 模块
- **说明:** 事件响应器存储器基类 - **说明:** 事件响应器存储器基类
- **参数** - **参数**
- `matchers` (Mapping[int, list[type[[Matcher](#Matcher)]]]): 当前存储器中已有的事件响应器 - `matchers` (Mapping[int, list[type[[Matcher](#Matcher)]]]): 当前存储器中已有的事件响应器
## _var_ `matchers` {#matchers} ## _var_ `matchers` {#matchers}

View File

@@ -20,11 +20,9 @@ NoneBot 内部处理并按优先级分发事件给所有事件响应器,提供
装饰一个函数,使它在每次接收到事件并分发给各响应器之前执行。 装饰一个函数,使它在每次接收到事件并分发给各响应器之前执行。
- **参数** - **参数**
- `func` ([T_EventPreProcessor](typing.md#T-EventPreProcessor)) - `func` ([T_EventPreProcessor](typing.md#T-EventPreProcessor))
- **返回** - **返回**
- [T_EventPreProcessor](typing.md#T-EventPreProcessor) - [T_EventPreProcessor](typing.md#T-EventPreProcessor)
## _def_ `event_postprocessor(func)` {#event-postprocessor} ## _def_ `event_postprocessor(func)` {#event-postprocessor}
@@ -36,11 +34,9 @@ NoneBot 内部处理并按优先级分发事件给所有事件响应器,提供
装饰一个函数,使它在每次接收到事件并分发给各响应器之后执行。 装饰一个函数,使它在每次接收到事件并分发给各响应器之后执行。
- **参数** - **参数**
- `func` ([T_EventPostProcessor](typing.md#T-EventPostProcessor)) - `func` ([T_EventPostProcessor](typing.md#T-EventPostProcessor))
- **返回** - **返回**
- [T_EventPostProcessor](typing.md#T-EventPostProcessor) - [T_EventPostProcessor](typing.md#T-EventPostProcessor)
## _def_ `run_preprocessor(func)` {#run-preprocessor} ## _def_ `run_preprocessor(func)` {#run-preprocessor}
@@ -52,11 +48,9 @@ NoneBot 内部处理并按优先级分发事件给所有事件响应器,提供
装饰一个函数,使它在每次事件响应器运行前执行。 装饰一个函数,使它在每次事件响应器运行前执行。
- **参数** - **参数**
- `func` ([T_RunPreProcessor](typing.md#T-RunPreProcessor)) - `func` ([T_RunPreProcessor](typing.md#T-RunPreProcessor))
- **返回** - **返回**
- [T_RunPreProcessor](typing.md#T-RunPreProcessor) - [T_RunPreProcessor](typing.md#T-RunPreProcessor)
## _def_ `run_postprocessor(func)` {#run-postprocessor} ## _def_ `run_postprocessor(func)` {#run-postprocessor}
@@ -68,11 +62,9 @@ NoneBot 内部处理并按优先级分发事件给所有事件响应器,提供
装饰一个函数,使它在每次事件响应器运行后执行。 装饰一个函数,使它在每次事件响应器运行后执行。
- **参数** - **参数**
- `func` ([T_RunPostProcessor](typing.md#T-RunPostProcessor)) - `func` ([T_RunPostProcessor](typing.md#T-RunPostProcessor))
- **返回** - **返回**
- [T_RunPostProcessor](typing.md#T-RunPostProcessor) - [T_RunPostProcessor](typing.md#T-RunPostProcessor)
## _async def_ `check_and_run_matcher(Matcher, bot, event, state, stack=None, dependency_cache=None)` {#check-and-run-matcher} ## _async def_ `check_and_run_matcher(Matcher, bot, event, state, stack=None, dependency_cache=None)` {#check-and-run-matcher}
@@ -80,7 +72,6 @@ NoneBot 内部处理并按优先级分发事件给所有事件响应器,提供
- **说明:** 检查并运行事件响应器。 - **说明:** 检查并运行事件响应器。
- **参数** - **参数**
- `Matcher` (type[[Matcher](matcher.md#Matcher)]): 事件响应器 - `Matcher` (type[[Matcher](matcher.md#Matcher)]): 事件响应器
- `bot` ([Bot](adapters/index.md#Bot)): Bot 对象 - `bot` ([Bot](adapters/index.md#Bot)): Bot 对象
@@ -94,7 +85,6 @@ NoneBot 内部处理并按优先级分发事件给所有事件响应器,提供
- `dependency_cache` ([T_DependencyCache](typing.md#T-DependencyCache) | None): 依赖缓存 - `dependency_cache` ([T_DependencyCache](typing.md#T-DependencyCache) | None): 依赖缓存
- **返回** - **返回**
- None - None
## _async def_ `handle_event(bot, event)` {#handle-event} ## _async def_ `handle_event(bot, event)` {#handle-event}
@@ -102,13 +92,11 @@ NoneBot 内部处理并按优先级分发事件给所有事件响应器,提供
- **说明:** 处理一个事件。调用该函数以实现分发事件。 - **说明:** 处理一个事件。调用该函数以实现分发事件。
- **参数** - **参数**
- `bot` ([Bot](adapters/index.md#Bot)): Bot 对象 - `bot` ([Bot](adapters/index.md#Bot)): Bot 对象
- `event` ([Event](adapters/index.md#Event)): Event 对象 - `event` ([Event](adapters/index.md#Event)): Event 对象
- **返回** - **返回**
- None - None
- **用法** - **用法**

View File

@@ -14,11 +14,9 @@ description: nonebot.params 模块
- **说明:** Arg 参数消息 - **说明:** Arg 参数消息
- **参数** - **参数**
- `key` (str | None) - `key` (str | None)
- **返回** - **返回**
- Any - Any
## _class_ `ArgParam(*args, key, type, **kwargs)` {#ArgParam} ## _class_ `ArgParam(*args, key, type, **kwargs)` {#ArgParam}
@@ -33,7 +31,6 @@ description: nonebot.params 模块
留空则会根据参数名称获取。 留空则会根据参数名称获取。
- **参数** - **参数**
- `*args` - `*args`
- `key` (str) - `key` (str)
@@ -47,11 +44,9 @@ description: nonebot.params 模块
- **说明:** Arg 参数消息纯文本 - **说明:** Arg 参数消息纯文本
- **参数** - **参数**
- `key` (str | None) - `key` (str | None)
- **返回** - **返回**
- str - str
## _def_ `ArgPromptResult(key=None)` {#ArgPromptResult} ## _def_ `ArgPromptResult(key=None)` {#ArgPromptResult}
@@ -59,11 +54,9 @@ description: nonebot.params 模块
- **说明:** `arg` prompt 发送结果 - **说明:** `arg` prompt 发送结果
- **参数** - **参数**
- `key` (str | None) - `key` (str | None)
- **返回** - **返回**
- Any - Any
## _def_ `ArgStr(key=None)` {#ArgStr} ## _def_ `ArgStr(key=None)` {#ArgStr}
@@ -71,11 +64,9 @@ description: nonebot.params 模块
- **说明:** Arg 参数消息文本 - **说明:** Arg 参数消息文本
- **参数** - **参数**
- `key` (str | None) - `key` (str | None)
- **返回** - **返回**
- str - str
## _class_ `BotParam(*args, checker=None, **kwargs)` {#BotParam} ## _class_ `BotParam(*args, checker=None, **kwargs)` {#BotParam}
@@ -89,7 +80,6 @@ description: nonebot.params 模块
为保证兼容性,本注入还会解析名为 `bot` 且没有类型注解的参数。 为保证兼容性,本注入还会解析名为 `bot` 且没有类型注解的参数。
- **参数** - **参数**
- `*args` - `*args`
- `checker` ([ModelField](compat.md#ModelField) | None) - `checker` ([ModelField](compat.md#ModelField) | None)
@@ -107,7 +97,6 @@ description: nonebot.params 模块
本注入参数应该具有最低优先级,因此应该在所有其他注入参数之后使用。 本注入参数应该具有最低优先级,因此应该在所有其他注入参数之后使用。
- **参数** - **参数**
- `*args` - `*args`
- `validate` (bool) - `validate` (bool)
@@ -125,7 +114,6 @@ description: nonebot.params 模块
本注入应该具有最高优先级,因此应该在其他参数之前检查。 本注入应该具有最高优先级,因此应该在其他参数之前检查。
- **参数** - **参数**
- `*args` - `*args`
- `dependent` ([Dependent](dependencies/index.md#Dependent)[Any]) - `dependent` ([Dependent](dependencies/index.md#Dependent)[Any])
@@ -139,7 +127,6 @@ description: nonebot.params 模块
- **说明:** 子依赖装饰器 - **说明:** 子依赖装饰器
- **参数** - **参数**
- `dependency` ([T_Handler](typing.md#T-Handler) | None): 依赖函数。默认为参数的类型注释。 - `dependency` ([T_Handler](typing.md#T-Handler) | None): 依赖函数。默认为参数的类型注释。
- `use_cache` (bool): 是否使用缓存。默认为 `True` - `use_cache` (bool): 是否使用缓存。默认为 `True`
@@ -147,7 +134,6 @@ description: nonebot.params 模块
- `validate` (bool | PydanticFieldInfo): 是否使用 Pydantic 类型校验。默认为 `False` - `validate` (bool | PydanticFieldInfo): 是否使用 Pydantic 类型校验。默认为 `False`
- **返回** - **返回**
- Any - Any
- **用法** - **用法**
@@ -180,7 +166,6 @@ description: nonebot.params 模块
为保证兼容性,本注入还会解析名为 `event` 且没有类型注解的参数。 为保证兼容性,本注入还会解析名为 `event` 且没有类型注解的参数。
- **参数** - **参数**
- `*args` - `*args`
- `checker` ([ModelField](compat.md#ModelField) | None) - `checker` ([ModelField](compat.md#ModelField) | None)
@@ -198,7 +183,6 @@ description: nonebot.params 模块
为保证兼容性,本注入还会解析名为 `exception` 且没有类型注解的参数。 为保证兼容性,本注入还会解析名为 `exception` 且没有类型注解的参数。
- **参数** - **参数**
- `*args` - `*args`
- `validate` (bool) - `validate` (bool)
@@ -216,7 +200,6 @@ description: nonebot.params 模块
为保证兼容性,本注入还会解析名为 `matcher` 且没有类型注解的参数。 为保证兼容性,本注入还会解析名为 `matcher` 且没有类型注解的参数。
- **参数** - **参数**
- `*args` - `*args`
- `checker` ([ModelField](compat.md#ModelField) | None) - `checker` ([ModelField](compat.md#ModelField) | None)
@@ -234,7 +217,6 @@ description: nonebot.params 模块
为保证兼容性,本注入还会解析名为 `state` 且没有类型注解的参数。 为保证兼容性,本注入还会解析名为 `state` 且没有类型注解的参数。
- **参数** - **参数**
- `*args` - `*args`
- `validate` (bool) - `validate` (bool)
@@ -250,7 +232,6 @@ description: nonebot.params 模块
empty empty
- **返回** - **返回**
- str - str
## _def_ `EventMessage()` {#EventMessage} ## _def_ `EventMessage()` {#EventMessage}
@@ -262,7 +243,6 @@ description: nonebot.params 模块
empty empty
- **返回** - **返回**
- Any - Any
## _def_ `EventPlainText()` {#EventPlainText} ## _def_ `EventPlainText()` {#EventPlainText}
@@ -274,7 +254,6 @@ description: nonebot.params 模块
empty empty
- **返回** - **返回**
- str - str
## _def_ `EventToMe()` {#EventToMe} ## _def_ `EventToMe()` {#EventToMe}
@@ -286,7 +265,6 @@ description: nonebot.params 模块
empty empty
- **返回** - **返回**
- bool - bool
## _def_ `Command()` {#Command} ## _def_ `Command()` {#Command}
@@ -298,7 +276,6 @@ description: nonebot.params 模块
empty empty
- **返回** - **返回**
- tuple[str, ...] - tuple[str, ...]
## _def_ `RawCommand()` {#RawCommand} ## _def_ `RawCommand()` {#RawCommand}
@@ -310,7 +287,6 @@ description: nonebot.params 模块
empty empty
- **返回** - **返回**
- str - str
## _def_ `CommandArg()` {#CommandArg} ## _def_ `CommandArg()` {#CommandArg}
@@ -322,7 +298,6 @@ description: nonebot.params 模块
empty empty
- **返回** - **返回**
- Any - Any
## _def_ `CommandStart()` {#CommandStart} ## _def_ `CommandStart()` {#CommandStart}
@@ -334,7 +309,6 @@ description: nonebot.params 模块
empty empty
- **返回** - **返回**
- str - str
## _def_ `CommandWhitespace()` {#CommandWhitespace} ## _def_ `CommandWhitespace()` {#CommandWhitespace}
@@ -346,7 +320,6 @@ description: nonebot.params 模块
empty empty
- **返回** - **返回**
- str - str
## _def_ `ShellCommandArgs()` {#ShellCommandArgs} ## _def_ `ShellCommandArgs()` {#ShellCommandArgs}
@@ -358,7 +331,6 @@ description: nonebot.params 模块
empty empty
- **返回** - **返回**
- Any - Any
## _def_ `ShellCommandArgv()` {#ShellCommandArgv} ## _def_ `ShellCommandArgv()` {#ShellCommandArgv}
@@ -370,7 +342,6 @@ description: nonebot.params 模块
empty empty
- **返回** - **返回**
- Any - Any
## _def_ `RegexMatched()` {#RegexMatched} ## _def_ `RegexMatched()` {#RegexMatched}
@@ -382,7 +353,6 @@ description: nonebot.params 模块
empty empty
- **返回** - **返回**
- Match[str] - Match[str]
## _def_ `RegexStr(*groups)` {#RegexStr} ## _def_ `RegexStr(*groups)` {#RegexStr}
@@ -392,29 +362,21 @@ description: nonebot.params 模块
- **重载** - **重载**
**1.** `(group, /) -> str` **1.** `(group, /) -> str`
- **参数** - **参数**
- `group` (Literal[0]) - `group` (Literal[0])
- **返回** - **返回**
- str - str
**2.** `(group, /) -> str | Any` **2.** `(group, /) -> str | Any`
- **参数** - **参数**
- `group` (str | int) - `group` (str | int)
- **返回** - **返回**
- str | Any - str | Any
**3.** `(group1, group2, /, *groups) -> tuple[str | Any, ...]` **3.** `(group1, group2, /, *groups) -> tuple[str | Any, ...]`
- **参数** - **参数**
- `group1` (str | int) - `group1` (str | int)
- `group2` (str | int) - `group2` (str | int)
@@ -422,7 +384,6 @@ description: nonebot.params 模块
- `*groups` (str | int) - `*groups` (str | int)
- **返回** - **返回**
- tuple[str | Any, ...] - tuple[str | Any, ...]
## _def_ `RegexGroup()` {#RegexGroup} ## _def_ `RegexGroup()` {#RegexGroup}
@@ -434,7 +395,6 @@ description: nonebot.params 模块
empty empty
- **返回** - **返回**
- tuple[Any, ...] - tuple[Any, ...]
## _def_ `RegexDict()` {#RegexDict} ## _def_ `RegexDict()` {#RegexDict}
@@ -446,7 +406,6 @@ description: nonebot.params 模块
empty empty
- **返回** - **返回**
- dict[str, Any] - dict[str, Any]
## _def_ `Startswith()` {#Startswith} ## _def_ `Startswith()` {#Startswith}
@@ -458,7 +417,6 @@ description: nonebot.params 模块
empty empty
- **返回** - **返回**
- str - str
## _def_ `Endswith()` {#Endswith} ## _def_ `Endswith()` {#Endswith}
@@ -470,7 +428,6 @@ description: nonebot.params 模块
empty empty
- **返回** - **返回**
- str - str
## _def_ `Fullmatch()` {#Fullmatch} ## _def_ `Fullmatch()` {#Fullmatch}
@@ -482,7 +439,6 @@ description: nonebot.params 模块
empty empty
- **返回** - **返回**
- str - str
## _def_ `Keyword()` {#Keyword} ## _def_ `Keyword()` {#Keyword}
@@ -494,7 +450,6 @@ description: nonebot.params 模块
empty empty
- **返回** - **返回**
- str - str
## _def_ `Received(id=None, default=None)` {#Received} ## _def_ `Received(id=None, default=None)` {#Received}
@@ -502,13 +457,11 @@ description: nonebot.params 模块
- **说明:** `receive` 事件参数 - **说明:** `receive` 事件参数
- **参数** - **参数**
- `id` (str | None) - `id` (str | None)
- `default` (Any) - `default` (Any)
- **返回** - **返回**
- Any - Any
## _def_ `LastReceived(default=None)` {#LastReceived} ## _def_ `LastReceived(default=None)` {#LastReceived}
@@ -516,11 +469,9 @@ description: nonebot.params 模块
- **说明:** `last_receive` 事件参数 - **说明:** `last_receive` 事件参数
- **参数** - **参数**
- `default` (Any) - `default` (Any)
- **返回** - **返回**
- Any - Any
## _def_ `ReceivePromptResult(id=None)` {#ReceivePromptResult} ## _def_ `ReceivePromptResult(id=None)` {#ReceivePromptResult}
@@ -528,11 +479,9 @@ description: nonebot.params 模块
- **说明:** `receive` prompt 发送结果 - **说明:** `receive` prompt 发送结果
- **参数** - **参数**
- `id` (str | None) - `id` (str | None)
- **返回** - **返回**
- Any - Any
## _def_ `PausePromptResult()` {#PausePromptResult} ## _def_ `PausePromptResult()` {#PausePromptResult}
@@ -544,5 +493,4 @@ description: nonebot.params 模块
empty empty
- **返回** - **返回**
- Any - Any

View File

@@ -22,7 +22,6 @@ description: nonebot.permission 模块
如果 `perm` 中仅有 `User` 类型的权限检查函数,则会去除原有检查函数的会话 ID 限制。 如果 `perm` 中仅有 `User` 类型的权限检查函数,则会去除原有检查函数的会话 ID 限制。
- **参数** - **参数**
- `*users` (str) - `*users` (str)
- `perm` (Permission | None): 需要同时满足的权限 - `perm` (Permission | None): 需要同时满足的权限
@@ -30,7 +29,6 @@ description: nonebot.permission 模块
- `user`: 会话白名单 - `user`: 会话白名单
- **返回** - **返回**
- untyped - untyped
## _class_ `Permission(*checkers)` {#Permission} ## _class_ `Permission(*checkers)` {#Permission}
@@ -42,7 +40,6 @@ description: nonebot.permission 模块
当事件传递时,在 [Matcher](matcher.md#Matcher) 运行前进行检查。 当事件传递时,在 [Matcher](matcher.md#Matcher) 运行前进行检查。
- **参数** - **参数**
- `*checkers` ([T_PermissionChecker](typing.md#T-PermissionChecker) | [Dependent](dependencies/index.md#Dependent)[bool]): PermissionChecker - `*checkers` ([T_PermissionChecker](typing.md#T-PermissionChecker) | [Dependent](dependencies/index.md#Dependent)[bool]): PermissionChecker
- **用法** - **用法**
@@ -64,7 +61,6 @@ description: nonebot.permission 模块
- **说明:** 检查是否满足某个权限。 - **说明:** 检查是否满足某个权限。
- **参数** - **参数**
- `bot` ([Bot](adapters/index.md#Bot)): Bot 对象 - `bot` ([Bot](adapters/index.md#Bot)): Bot 对象
- `event` ([Event](adapters/index.md#Event)): Event 对象 - `event` ([Event](adapters/index.md#Event)): Event 对象
@@ -74,7 +70,6 @@ description: nonebot.permission 模块
- `dependency_cache` ([T_DependencyCache](typing.md#T-DependencyCache) | None): 依赖缓存 - `dependency_cache` ([T_DependencyCache](typing.md#T-DependencyCache) | None): 依赖缓存
- **返回** - **返回**
- bool - bool
## _class_ `User(users, perm=None)` {#User} ## _class_ `User(users, perm=None)` {#User}
@@ -82,7 +77,6 @@ description: nonebot.permission 模块
- **说明:** 检查当前事件是否属于指定会话。 - **说明:** 检查当前事件是否属于指定会话。
- **参数** - **参数**
- `users` (tuple[str, ...]): 会话 ID 元组 - `users` (tuple[str, ...]): 会话 ID 元组
- `perm` (Permission | None): 需同时满足的权限 - `perm` (Permission | None): 需同时满足的权限
@@ -96,13 +90,11 @@ description: nonebot.permission 模块
如果 `perm` 中仅有 `User` 类型的权限检查函数,则会去除原有的会话 ID 限制。 如果 `perm` 中仅有 `User` 类型的权限检查函数,则会去除原有的会话 ID 限制。
- **参数** - **参数**
- `event` ([Event](adapters/index.md#Event)): Event 对象 - `event` ([Event](adapters/index.md#Event)): Event 对象
- `perm` (Permission | None): 需同时满足的权限 - `perm` (Permission | None): 需同时满足的权限
- **返回** - **返回**
- Self - Self
### _classmethod_ `from_permission(*users, perm=None)` {#User-from-permission} ### _classmethod_ `from_permission(*users, perm=None)` {#User-from-permission}
@@ -114,13 +106,11 @@ description: nonebot.permission 模块
如果 `perm` 中仅有 `User` 类型的权限检查函数,则会去除原有的会话 ID 限制。 如果 `perm` 中仅有 `User` 类型的权限检查函数,则会去除原有的会话 ID 限制。
- **参数** - **参数**
- `*users` (str): 会话白名单 - `*users` (str): 会话白名单
- `perm` (Permission | None): 需同时满足的权限 - `perm` (Permission | None): 需同时满足的权限
- **返回** - **返回**
- Self - Self
## _class_ `Message(<auto>)` {#Message} ## _class_ `Message(<auto>)` {#Message}

View File

@@ -51,11 +51,9 @@ description: nonebot.plugin 模块
如果为嵌套的子插件,标识符为 `父插件标识符:子插件文件(夹)名` 如果为嵌套的子插件,标识符为 `父插件标识符:子插件文件(夹)名`
- **参数** - **参数**
- `plugin_id` (str): 插件标识符,即 [Plugin.id\_](model.md#Plugin-id-)。 - `plugin_id` (str): 插件标识符,即 [Plugin.id\_](model.md#Plugin-id-)。
- **返回** - **返回**
- [Plugin](model.md#Plugin) | None - [Plugin](model.md#Plugin) | None
## _def_ `get_plugin_by_module_name(module_name)` {#get-plugin-by-module-name} ## _def_ `get_plugin_by_module_name(module_name)` {#get-plugin-by-module-name}
@@ -67,11 +65,9 @@ description: nonebot.plugin 模块
如果提供的模块名为某个插件的子模块,同样会返回该插件。 如果提供的模块名为某个插件的子模块,同样会返回该插件。
- **参数** - **参数**
- `module_name` (str): 模块名,即 [Plugin.module_name](model.md#Plugin-module-name)。 - `module_name` (str): 模块名,即 [Plugin.module_name](model.md#Plugin-module-name)。
- **返回** - **返回**
- [Plugin](model.md#Plugin) | None - [Plugin](model.md#Plugin) | None
## _def_ `get_loaded_plugins()` {#get-loaded-plugins} ## _def_ `get_loaded_plugins()` {#get-loaded-plugins}
@@ -83,7 +79,6 @@ description: nonebot.plugin 模块
empty empty
- **返回** - **返回**
- set[[Plugin](model.md#Plugin)] - set[[Plugin](model.md#Plugin)]
## _def_ `get_available_plugin_names()` {#get-available-plugin-names} ## _def_ `get_available_plugin_names()` {#get-available-plugin-names}
@@ -95,7 +90,6 @@ description: nonebot.plugin 模块
empty empty
- **返回** - **返回**
- set[str] - set[str]
## _def_ `get_plugin_config(config)` {#get-plugin-config} ## _def_ `get_plugin_config(config)` {#get-plugin-config}
@@ -103,9 +97,7 @@ description: nonebot.plugin 模块
- **说明:** 从全局配置获取当前插件需要的配置项。 - **说明:** 从全局配置获取当前插件需要的配置项。
- **参数** - **参数**
- `config` (type[C]) - `config` (type[C])
- **返回** - **返回**
- C - C

View File

@@ -14,11 +14,9 @@ description: nonebot.plugin.load 模块
- **说明:** 加载单个插件,可以是本地插件或是通过 `pip` 安装的插件。 - **说明:** 加载单个插件,可以是本地插件或是通过 `pip` 安装的插件。
- **参数** - **参数**
- `module_path` (str | Path): 插件名称 `path.to.your.plugin` 或插件路径 `pathlib.Path(path/to/your/plugin)` - `module_path` (str | Path): 插件名称 `path.to.your.plugin` 或插件路径 `pathlib.Path(path/to/your/plugin)`
- **返回** - **返回**
- [Plugin](model.md#Plugin) | None - [Plugin](model.md#Plugin) | None
## _def_ `load_plugins(*plugin_dir)` {#load-plugins} ## _def_ `load_plugins(*plugin_dir)` {#load-plugins}
@@ -26,11 +24,9 @@ description: nonebot.plugin.load 模块
- **说明:** 导入文件夹下多个插件,以 `_` 开头的插件不会被导入! - **说明:** 导入文件夹下多个插件,以 `_` 开头的插件不会被导入!
- **参数** - **参数**
- `*plugin_dir` (str): 文件夹路径 - `*plugin_dir` (str): 文件夹路径
- **返回** - **返回**
- set[[Plugin](model.md#Plugin)] - set[[Plugin](model.md#Plugin)]
## _def_ `load_all_plugins(module_path, plugin_dir)` {#load-all-plugins} ## _def_ `load_all_plugins(module_path, plugin_dir)` {#load-all-plugins}
@@ -38,13 +34,11 @@ description: nonebot.plugin.load 模块
- **说明:** 导入指定列表中的插件以及指定目录下多个插件,以 `_` 开头的插件不会被导入! - **说明:** 导入指定列表中的插件以及指定目录下多个插件,以 `_` 开头的插件不会被导入!
- **参数** - **参数**
- `module_path` (Iterable[str]): 指定插件集合 - `module_path` (Iterable[str]): 指定插件集合
- `plugin_dir` (Iterable[str]): 指定文件夹路径集合 - `plugin_dir` (Iterable[str]): 指定文件夹路径集合
- **返回** - **返回**
- set[[Plugin](model.md#Plugin)] - set[[Plugin](model.md#Plugin)]
## _def_ `load_from_json(file_path, encoding="utf-8")` {#load-from-json} ## _def_ `load_from_json(file_path, encoding="utf-8")` {#load-from-json}
@@ -52,13 +46,11 @@ description: nonebot.plugin.load 模块
- **说明:** 导入指定 json 文件中的 `plugins` 以及 `plugin_dirs` 下多个插件。 以 `_` 开头的插件不会被导入! - **说明:** 导入指定 json 文件中的 `plugins` 以及 `plugin_dirs` 下多个插件。 以 `_` 开头的插件不会被导入!
- **参数** - **参数**
- `file_path` (str): 指定 json 文件路径 - `file_path` (str): 指定 json 文件路径
- `encoding` (str): 指定 json 文件编码 - `encoding` (str): 指定 json 文件编码
- **返回** - **返回**
- set[[Plugin](model.md#Plugin)] - set[[Plugin](model.md#Plugin)]
- **用法** - **用法**
@@ -79,13 +71,11 @@ description: nonebot.plugin.load 模块
- **说明:** 导入指定 toml 文件 `[tool.nonebot]` 中的 `plugins` 以及 `plugin_dirs` 下多个插件。 以 `_` 开头的插件不会被导入! - **说明:** 导入指定 toml 文件 `[tool.nonebot]` 中的 `plugins` 以及 `plugin_dirs` 下多个插件。 以 `_` 开头的插件不会被导入!
- **参数** - **参数**
- `file_path` (str): 指定 toml 文件路径 - `file_path` (str): 指定 toml 文件路径
- `encoding` (str): 指定 toml 文件编码 - `encoding` (str): 指定 toml 文件编码
- **返回** - **返回**
- set[[Plugin](model.md#Plugin)] - set[[Plugin](model.md#Plugin)]
- **用法** - **用法**
@@ -105,11 +95,9 @@ description: nonebot.plugin.load 模块
- **说明:** 导入 NoneBot 内置插件。 - **说明:** 导入 NoneBot 内置插件。
- **参数** - **参数**
- `name` (str): 插件名称 - `name` (str): 插件名称
- **返回** - **返回**
- [Plugin](model.md#Plugin) | None - [Plugin](model.md#Plugin) | None
## _def_ `load_builtin_plugins(*plugins)` {#load-builtin-plugins} ## _def_ `load_builtin_plugins(*plugins)` {#load-builtin-plugins}
@@ -117,11 +105,9 @@ description: nonebot.plugin.load 模块
- **说明:** 导入多个 NoneBot 内置插件。 - **说明:** 导入多个 NoneBot 内置插件。
- **参数** - **参数**
- `*plugins` (str): 插件名称列表 - `*plugins` (str): 插件名称列表
- **返回** - **返回**
- set[[Plugin](model.md#Plugin)] - set[[Plugin](model.md#Plugin)]
## _def_ `require(name)` {#require} ## _def_ `require(name)` {#require}
@@ -129,15 +115,12 @@ description: nonebot.plugin.load 模块
- **说明:** 声明依赖插件。 - **说明:** 声明依赖插件。
- **参数** - **参数**
- `name` (str): 插件模块名或插件标识符,仅在已声明插件的情况下可使用标识符。 - `name` (str): 插件模块名或插件标识符,仅在已声明插件的情况下可使用标识符。
- **返回** - **返回**
- ModuleType - ModuleType
- **异常** - **异常**
- RuntimeError: 插件无法加载 - RuntimeError: 插件无法加载
## _def_ `inherit_supported_adapters(*names)` {#inherit-supported-adapters} ## _def_ `inherit_supported_adapters(*names)` {#inherit-supported-adapters}
@@ -149,15 +132,12 @@ description: nonebot.plugin.load 模块
如果传入了多个插件名称,返回值会自动取交集。 如果传入了多个插件名称,返回值会自动取交集。
- **参数** - **参数**
- `*names` (str): 插件名称列表。 - `*names` (str): 插件名称列表。
- **返回** - **返回**
- set[str] | None - set[str] | None
- **异常** - **异常**
- RuntimeError: 插件未加载 - RuntimeError: 插件未加载
- ValueError: 插件缺少元数据 - ValueError: 插件缺少元数据

View File

@@ -16,7 +16,6 @@ description: nonebot.plugin.manager 模块
- **说明:** 插件管理器。 - **说明:** 插件管理器。
- **参数** - **参数**
- `plugins` (Iterable[str] | None): 独立插件模块名集合。 - `plugins` (Iterable[str] | None): 独立插件模块名集合。
- `search_path` (Iterable[str] | None): 插件搜索路径(文件夹),相对于当前工作目录。 - `search_path` (Iterable[str] | None): 插件搜索路径(文件夹),相对于当前工作目录。
@@ -54,11 +53,9 @@ description: nonebot.plugin.manager 模块
可以使用完整插件模块名或者插件标识符加载。 可以使用完整插件模块名或者插件标识符加载。
- **参数** - **参数**
- `name` (str): 插件名称或插件标识符。 - `name` (str): 插件名称或插件标识符。
- **返回** - **返回**
- [Plugin](model.md#Plugin) | None - [Plugin](model.md#Plugin) | None
### _method_ `load_all_plugins()` {#PluginManager-load-all-plugins} ### _method_ `load_all_plugins()` {#PluginManager-load-all-plugins}
@@ -70,7 +67,6 @@ description: nonebot.plugin.manager 模块
empty empty
- **返回** - **返回**
- set[[Plugin](model.md#Plugin)] - set[[Plugin](model.md#Plugin)]
## _class_ `PluginFinder(<auto>)` {#PluginFinder} ## _class_ `PluginFinder(<auto>)` {#PluginFinder}
@@ -82,7 +78,6 @@ description: nonebot.plugin.manager 模块
### _method_ `find_spec(fullname, path, target=None)` {#PluginFinder-find-spec} ### _method_ `find_spec(fullname, path, target=None)` {#PluginFinder-find-spec}
- **参数** - **参数**
- `fullname` (str) - `fullname` (str)
- `path` (Sequence[str] | None) - `path` (Sequence[str] | None)
@@ -90,13 +85,11 @@ description: nonebot.plugin.manager 模块
- `target` (ModuleType | None) - `target` (ModuleType | None)
- **返回** - **返回**
- untyped - untyped
## _class_ `PluginLoader(manager, fullname, path)` {#PluginLoader} ## _class_ `PluginLoader(manager, fullname, path)` {#PluginLoader}
- **参数** - **参数**
- `manager` (PluginManager) - `manager` (PluginManager)
- `fullname` (str) - `fullname` (str)
@@ -106,19 +99,15 @@ description: nonebot.plugin.manager 模块
### _method_ `create_module(spec)` {#PluginLoader-create-module} ### _method_ `create_module(spec)` {#PluginLoader-create-module}
- **参数** - **参数**
- `spec` - `spec`
- **返回** - **返回**
- ModuleType | None - ModuleType | None
### _method_ `exec_module(module)` {#PluginLoader-exec-module} ### _method_ `exec_module(module)` {#PluginLoader-exec-module}
- **参数** - **参数**
- `module` (ModuleType) - `module` (ModuleType)
- **返回** - **返回**
- None - None

View File

@@ -80,7 +80,6 @@ description: nonebot.plugin.model 模块
empty empty
- **返回** - **返回**
- set[type[[Adapter](../adapters/index.md#Adapter)]] | None - set[type[[Adapter](../adapters/index.md#Adapter)]] | None
## _class_ `Plugin(<auto>)` {#Plugin} ## _class_ `Plugin(<auto>)` {#Plugin}

View File

@@ -14,11 +14,9 @@ description: nonebot.plugin.on 模块
- **说明:** 存储一个事件响应器到插件。 - **说明:** 存储一个事件响应器到插件。
- **参数** - **参数**
- `matcher` (type[[Matcher](../matcher.md#Matcher)]): 事件响应器 - `matcher` (type[[Matcher](../matcher.md#Matcher)]): 事件响应器
- **返回** - **返回**
- None - None
## _def_ `get_matcher_plugin(depth=...)` {#get-matcher-plugin} ## _def_ `get_matcher_plugin(depth=...)` {#get-matcher-plugin}
@@ -30,11 +28,9 @@ description: nonebot.plugin.on 模块
**Deprecated**, 请使用 [get_matcher_source](#get-matcher-source) 获取信息。 **Deprecated**, 请使用 [get_matcher_source](#get-matcher-source) 获取信息。
- **参数** - **参数**
- `depth` (int): 调用栈深度 - `depth` (int): 调用栈深度
- **返回** - **返回**
- [Plugin](model.md#Plugin) | None - [Plugin](model.md#Plugin) | None
## _def_ `get_matcher_module(depth=...)` {#get-matcher-module} ## _def_ `get_matcher_module(depth=...)` {#get-matcher-module}
@@ -46,11 +42,9 @@ description: nonebot.plugin.on 模块
**Deprecated**, 请使用 [get_matcher_source](#get-matcher-source) 获取信息。 **Deprecated**, 请使用 [get_matcher_source](#get-matcher-source) 获取信息。
- **参数** - **参数**
- `depth` (int): 调用栈深度 - `depth` (int): 调用栈深度
- **返回** - **返回**
- ModuleType | None - ModuleType | None
## _def_ `get_matcher_source(depth=...)` {#get-matcher-source} ## _def_ `get_matcher_source(depth=...)` {#get-matcher-source}
@@ -58,11 +52,9 @@ description: nonebot.plugin.on 模块
- **说明:** 获取事件响应器定义所在源码信息。 - **说明:** 获取事件响应器定义所在源码信息。
- **参数** - **参数**
- `depth` (int): 调用栈深度 - `depth` (int): 调用栈深度
- **返回** - **返回**
- MatcherSource | None - MatcherSource | None
## _def_ `on(type="", rule=..., permission=..., *, handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#on} ## _def_ `on(type="", rule=..., permission=..., *, handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#on}
@@ -70,7 +62,6 @@ description: nonebot.plugin.on 模块
- **说明:** 注册一个基础事件响应器,可自定义类型。 - **说明:** 注册一个基础事件响应器,可自定义类型。
- **参数** - **参数**
- `type` (str): 事件响应器类型 - `type` (str): 事件响应器类型
- `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则 - `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则
@@ -90,7 +81,6 @@ description: nonebot.plugin.on 模块
- `state` ([T_State](../typing.md#T-State) | None): 默认 state - `state` ([T_State](../typing.md#T-State) | None): 默认 state
- **返回** - **返回**
- type[[Matcher](../matcher.md#Matcher)] - type[[Matcher](../matcher.md#Matcher)]
## _def_ `on_metaevent(rule=..., permission=..., *, handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#on-metaevent} ## _def_ `on_metaevent(rule=..., permission=..., *, handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#on-metaevent}
@@ -98,7 +88,6 @@ description: nonebot.plugin.on 模块
- **说明:** 注册一个元事件响应器。 - **说明:** 注册一个元事件响应器。
- **参数** - **参数**
- `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则 - `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则
- `permission` ([Permission](../permission.md#Permission) | [T_PermissionChecker](../typing.md#T-PermissionChecker) | None): 事件响应权限 - `permission` ([Permission](../permission.md#Permission) | [T_PermissionChecker](../typing.md#T-PermissionChecker) | None): 事件响应权限
@@ -116,7 +105,6 @@ description: nonebot.plugin.on 模块
- `state` ([T_State](../typing.md#T-State) | None): 默认 state - `state` ([T_State](../typing.md#T-State) | None): 默认 state
- **返回** - **返回**
- type[[Matcher](../matcher.md#Matcher)] - type[[Matcher](../matcher.md#Matcher)]
## _def_ `on_message(rule=..., permission=..., *, handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#on-message} ## _def_ `on_message(rule=..., permission=..., *, handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#on-message}
@@ -124,7 +112,6 @@ description: nonebot.plugin.on 模块
- **说明:** 注册一个消息事件响应器。 - **说明:** 注册一个消息事件响应器。
- **参数** - **参数**
- `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则 - `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则
- `permission` ([Permission](../permission.md#Permission) | [T_PermissionChecker](../typing.md#T-PermissionChecker) | None): 事件响应权限 - `permission` ([Permission](../permission.md#Permission) | [T_PermissionChecker](../typing.md#T-PermissionChecker) | None): 事件响应权限
@@ -142,7 +129,6 @@ description: nonebot.plugin.on 模块
- `state` ([T_State](../typing.md#T-State) | None): 默认 state - `state` ([T_State](../typing.md#T-State) | None): 默认 state
- **返回** - **返回**
- type[[Matcher](../matcher.md#Matcher)] - type[[Matcher](../matcher.md#Matcher)]
## _def_ `on_notice(rule=..., permission=..., *, handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#on-notice} ## _def_ `on_notice(rule=..., permission=..., *, handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#on-notice}
@@ -150,7 +136,6 @@ description: nonebot.plugin.on 模块
- **说明:** 注册一个通知事件响应器。 - **说明:** 注册一个通知事件响应器。
- **参数** - **参数**
- `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则 - `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则
- `permission` ([Permission](../permission.md#Permission) | [T_PermissionChecker](../typing.md#T-PermissionChecker) | None): 事件响应权限 - `permission` ([Permission](../permission.md#Permission) | [T_PermissionChecker](../typing.md#T-PermissionChecker) | None): 事件响应权限
@@ -168,7 +153,6 @@ description: nonebot.plugin.on 模块
- `state` ([T_State](../typing.md#T-State) | None): 默认 state - `state` ([T_State](../typing.md#T-State) | None): 默认 state
- **返回** - **返回**
- type[[Matcher](../matcher.md#Matcher)] - type[[Matcher](../matcher.md#Matcher)]
## _def_ `on_request(rule=..., permission=..., *, handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#on-request} ## _def_ `on_request(rule=..., permission=..., *, handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#on-request}
@@ -176,7 +160,6 @@ description: nonebot.plugin.on 模块
- **说明:** 注册一个请求事件响应器。 - **说明:** 注册一个请求事件响应器。
- **参数** - **参数**
- `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则 - `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则
- `permission` ([Permission](../permission.md#Permission) | [T_PermissionChecker](../typing.md#T-PermissionChecker) | None): 事件响应权限 - `permission` ([Permission](../permission.md#Permission) | [T_PermissionChecker](../typing.md#T-PermissionChecker) | None): 事件响应权限
@@ -194,7 +177,6 @@ description: nonebot.plugin.on 模块
- `state` ([T_State](../typing.md#T-State) | None): 默认 state - `state` ([T_State](../typing.md#T-State) | None): 默认 state
- **返回** - **返回**
- type[[Matcher](../matcher.md#Matcher)] - type[[Matcher](../matcher.md#Matcher)]
## _def_ `on_startswith(msg, rule=..., ignorecase=..., *, permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#on-startswith} ## _def_ `on_startswith(msg, rule=..., ignorecase=..., *, permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#on-startswith}
@@ -202,7 +184,6 @@ description: nonebot.plugin.on 模块
- **说明:** 注册一个消息事件响应器,并且当消息的**文本部分**以指定内容开头时响应。 - **说明:** 注册一个消息事件响应器,并且当消息的**文本部分**以指定内容开头时响应。
- **参数** - **参数**
- `msg` (str | tuple[str, ...]): 指定消息开头内容 - `msg` (str | tuple[str, ...]): 指定消息开头内容
- `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则 - `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则
@@ -224,7 +205,6 @@ description: nonebot.plugin.on 模块
- `state` ([T_State](../typing.md#T-State) | None): 默认 state - `state` ([T_State](../typing.md#T-State) | None): 默认 state
- **返回** - **返回**
- type[[Matcher](../matcher.md#Matcher)] - type[[Matcher](../matcher.md#Matcher)]
## _def_ `on_endswith(msg, rule=..., ignorecase=..., *, permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#on-endswith} ## _def_ `on_endswith(msg, rule=..., ignorecase=..., *, permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#on-endswith}
@@ -232,7 +212,6 @@ description: nonebot.plugin.on 模块
- **说明:** 注册一个消息事件响应器,并且当消息的**文本部分**以指定内容结尾时响应。 - **说明:** 注册一个消息事件响应器,并且当消息的**文本部分**以指定内容结尾时响应。
- **参数** - **参数**
- `msg` (str | tuple[str, ...]): 指定消息结尾内容 - `msg` (str | tuple[str, ...]): 指定消息结尾内容
- `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则 - `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则
@@ -254,7 +233,6 @@ description: nonebot.plugin.on 模块
- `state` ([T_State](../typing.md#T-State) | None): 默认 state - `state` ([T_State](../typing.md#T-State) | None): 默认 state
- **返回** - **返回**
- type[[Matcher](../matcher.md#Matcher)] - type[[Matcher](../matcher.md#Matcher)]
## _def_ `on_fullmatch(msg, rule=..., ignorecase=..., *, permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#on-fullmatch} ## _def_ `on_fullmatch(msg, rule=..., ignorecase=..., *, permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#on-fullmatch}
@@ -262,7 +240,6 @@ description: nonebot.plugin.on 模块
- **说明:** 注册一个消息事件响应器,并且当消息的**文本部分**与指定内容完全一致时响应。 - **说明:** 注册一个消息事件响应器,并且当消息的**文本部分**与指定内容完全一致时响应。
- **参数** - **参数**
- `msg` (str | tuple[str, ...]): 指定消息全匹配内容 - `msg` (str | tuple[str, ...]): 指定消息全匹配内容
- `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则 - `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则
@@ -284,7 +261,6 @@ description: nonebot.plugin.on 模块
- `state` ([T_State](../typing.md#T-State) | None): 默认 state - `state` ([T_State](../typing.md#T-State) | None): 默认 state
- **返回** - **返回**
- type[[Matcher](../matcher.md#Matcher)] - type[[Matcher](../matcher.md#Matcher)]
## _def_ `on_keyword(keywords, rule=..., *, permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#on-keyword} ## _def_ `on_keyword(keywords, rule=..., *, permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#on-keyword}
@@ -292,7 +268,6 @@ description: nonebot.plugin.on 模块
- **说明:** 注册一个消息事件响应器,并且当消息纯文本部分包含关键词时响应。 - **说明:** 注册一个消息事件响应器,并且当消息纯文本部分包含关键词时响应。
- **参数** - **参数**
- `keywords` (set[str]): 关键词列表 - `keywords` (set[str]): 关键词列表
- `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则 - `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则
@@ -312,7 +287,6 @@ description: nonebot.plugin.on 模块
- `state` ([T_State](../typing.md#T-State) | None): 默认 state - `state` ([T_State](../typing.md#T-State) | None): 默认 state
- **返回** - **返回**
- type[[Matcher](../matcher.md#Matcher)] - type[[Matcher](../matcher.md#Matcher)]
## _def_ `on_command(cmd, rule=..., aliases=..., force_whitespace=..., *, permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#on-command} ## _def_ `on_command(cmd, rule=..., aliases=..., force_whitespace=..., *, permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#on-command}
@@ -324,7 +298,6 @@ description: nonebot.plugin.on 模块
命令匹配规则参考: `命令形式匹配 <rule.md#command-command>`\_ 命令匹配规则参考: `命令形式匹配 <rule.md#command-command>`\_
- **参数** - **参数**
- `cmd` (str | tuple[str, ...]): 指定命令内容 - `cmd` (str | tuple[str, ...]): 指定命令内容
- `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则 - `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则
@@ -348,7 +321,6 @@ description: nonebot.plugin.on 模块
- `state` ([T_State](../typing.md#T-State) | None): 默认 state - `state` ([T_State](../typing.md#T-State) | None): 默认 state
- **返回** - **返回**
- type[[Matcher](../matcher.md#Matcher)] - type[[Matcher](../matcher.md#Matcher)]
## _def_ `on_shell_command(cmd, rule=..., aliases=..., parser=..., *, permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#on-shell-command} ## _def_ `on_shell_command(cmd, rule=..., aliases=..., parser=..., *, permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#on-shell-command}
@@ -363,7 +335,6 @@ description: nonebot.plugin.on 模块
通过 [ShellCommandArgs](../params.md#ShellCommandArgs) 获取解析后的参数字典。 通过 [ShellCommandArgs](../params.md#ShellCommandArgs) 获取解析后的参数字典。
- **参数** - **参数**
- `cmd` (str | tuple[str, ...]): 指定命令内容 - `cmd` (str | tuple[str, ...]): 指定命令内容
- `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则 - `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则
@@ -387,7 +358,6 @@ description: nonebot.plugin.on 模块
- `state` ([T_State](../typing.md#T-State) | None): 默认 state - `state` ([T_State](../typing.md#T-State) | None): 默认 state
- **返回** - **返回**
- type[[Matcher](../matcher.md#Matcher)] - type[[Matcher](../matcher.md#Matcher)]
## _def_ `on_regex(pattern, flags=..., rule=..., *, permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#on-regex} ## _def_ `on_regex(pattern, flags=..., rule=..., *, permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#on-regex}
@@ -399,7 +369,6 @@ description: nonebot.plugin.on 模块
命令匹配规则参考: `正则匹配 <rule.md#regex-regex-flags-0>`\_ 命令匹配规则参考: `正则匹配 <rule.md#regex-regex-flags-0>`\_
- **参数** - **参数**
- `pattern` (str): 正则表达式 - `pattern` (str): 正则表达式
- `flags` (int | re.RegexFlag): 正则匹配标志 - `flags` (int | re.RegexFlag): 正则匹配标志
@@ -421,7 +390,6 @@ description: nonebot.plugin.on 模块
- `state` ([T_State](../typing.md#T-State) | None): 默认 state - `state` ([T_State](../typing.md#T-State) | None): 默认 state
- **返回** - **返回**
- type[[Matcher](../matcher.md#Matcher)] - type[[Matcher](../matcher.md#Matcher)]
## _def_ `on_type(types, rule=..., *, permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#on-type} ## _def_ `on_type(types, rule=..., *, permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#on-type}
@@ -429,7 +397,6 @@ description: nonebot.plugin.on 模块
- **说明:** 注册一个事件响应器,并且当事件为指定类型时响应。 - **说明:** 注册一个事件响应器,并且当事件为指定类型时响应。
- **参数** - **参数**
- `types` (type[[Event](../adapters/index.md#Event)] | tuple[type[[Event](../adapters/index.md#Event)], ...]): 事件类型 - `types` (type[[Event](../adapters/index.md#Event)] | tuple[type[[Event](../adapters/index.md#Event)], ...]): 事件类型
- `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则 - `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则
@@ -449,13 +416,11 @@ description: nonebot.plugin.on 模块
- `state` ([T_State](../typing.md#T-State) | None): 默认 state - `state` ([T_State](../typing.md#T-State) | None): 默认 state
- **返回** - **返回**
- type[[Matcher](../matcher.md#Matcher)] - type[[Matcher](../matcher.md#Matcher)]
## _class_ `CommandGroup(cmd, prefix_aliases=..., *, rule=..., permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#CommandGroup} ## _class_ `CommandGroup(cmd, prefix_aliases=..., *, rule=..., permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#CommandGroup}
- **参数** - **参数**
- `cmd` (str | tuple[str, ...]) - `cmd` (str | tuple[str, ...])
- `prefix_aliases` (bool) - `prefix_aliases` (bool)
@@ -481,7 +446,6 @@ description: nonebot.plugin.on 模块
- **说明:** 注册一个新的命令。新参数将会覆盖命令组默认值 - **说明:** 注册一个新的命令。新参数将会覆盖命令组默认值
- **参数** - **参数**
- `cmd` (str | tuple[str, ...]): 指定命令内容 - `cmd` (str | tuple[str, ...]): 指定命令内容
- `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则 - `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则
@@ -505,7 +469,6 @@ description: nonebot.plugin.on 模块
- `state` ([T_State](../typing.md#T-State) | None): 默认 state - `state` ([T_State](../typing.md#T-State) | None): 默认 state
- **返回** - **返回**
- type[[Matcher](../matcher.md#Matcher)] - type[[Matcher](../matcher.md#Matcher)]
### _method_ `shell_command(cmd, *, rule=..., aliases=..., parser=..., permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#CommandGroup-shell-command} ### _method_ `shell_command(cmd, *, rule=..., aliases=..., parser=..., permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#CommandGroup-shell-command}
@@ -513,7 +476,6 @@ description: nonebot.plugin.on 模块
- **说明:** 注册一个新的 `shell_like` 命令。新参数将会覆盖命令组默认值 - **说明:** 注册一个新的 `shell_like` 命令。新参数将会覆盖命令组默认值
- **参数** - **参数**
- `cmd` (str | tuple[str, ...]): 指定命令内容 - `cmd` (str | tuple[str, ...]): 指定命令内容
- `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则 - `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则
@@ -537,13 +499,11 @@ description: nonebot.plugin.on 模块
- `state` ([T_State](../typing.md#T-State) | None): 默认 state - `state` ([T_State](../typing.md#T-State) | None): 默认 state
- **返回** - **返回**
- type[[Matcher](../matcher.md#Matcher)] - type[[Matcher](../matcher.md#Matcher)]
## _class_ `MatcherGroup(*, type=..., rule=..., permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#MatcherGroup} ## _class_ `MatcherGroup(*, type=..., rule=..., permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#MatcherGroup}
- **参数** - **参数**
- `type` (str) - `type` (str)
- `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None) - `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None)
@@ -567,7 +527,6 @@ description: nonebot.plugin.on 模块
- **说明:** 注册一个基础事件响应器,可自定义类型。 - **说明:** 注册一个基础事件响应器,可自定义类型。
- **参数** - **参数**
- `type` (str): 事件响应器类型 - `type` (str): 事件响应器类型
- `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则 - `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则
@@ -587,7 +546,6 @@ description: nonebot.plugin.on 模块
- `state` ([T_State](../typing.md#T-State) | None): 默认 state - `state` ([T_State](../typing.md#T-State) | None): 默认 state
- **返回** - **返回**
- type[[Matcher](../matcher.md#Matcher)] - type[[Matcher](../matcher.md#Matcher)]
### _method_ `on_metaevent(*, rule=..., permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#MatcherGroup-on-metaevent} ### _method_ `on_metaevent(*, rule=..., permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#MatcherGroup-on-metaevent}
@@ -595,7 +553,6 @@ description: nonebot.plugin.on 模块
- **说明:** 注册一个元事件响应器。 - **说明:** 注册一个元事件响应器。
- **参数** - **参数**
- `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则 - `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则
- `permission` ([Permission](../permission.md#Permission) | [T_PermissionChecker](../typing.md#T-PermissionChecker) | None): 事件响应权限 - `permission` ([Permission](../permission.md#Permission) | [T_PermissionChecker](../typing.md#T-PermissionChecker) | None): 事件响应权限
@@ -613,7 +570,6 @@ description: nonebot.plugin.on 模块
- `state` ([T_State](../typing.md#T-State) | None): 默认 state - `state` ([T_State](../typing.md#T-State) | None): 默认 state
- **返回** - **返回**
- type[[Matcher](../matcher.md#Matcher)] - type[[Matcher](../matcher.md#Matcher)]
### _method_ `on_message(*, rule=..., permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#MatcherGroup-on-message} ### _method_ `on_message(*, rule=..., permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#MatcherGroup-on-message}
@@ -621,7 +577,6 @@ description: nonebot.plugin.on 模块
- **说明:** 注册一个消息事件响应器。 - **说明:** 注册一个消息事件响应器。
- **参数** - **参数**
- `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则 - `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则
- `permission` ([Permission](../permission.md#Permission) | [T_PermissionChecker](../typing.md#T-PermissionChecker) | None): 事件响应权限 - `permission` ([Permission](../permission.md#Permission) | [T_PermissionChecker](../typing.md#T-PermissionChecker) | None): 事件响应权限
@@ -639,7 +594,6 @@ description: nonebot.plugin.on 模块
- `state` ([T_State](../typing.md#T-State) | None): 默认 state - `state` ([T_State](../typing.md#T-State) | None): 默认 state
- **返回** - **返回**
- type[[Matcher](../matcher.md#Matcher)] - type[[Matcher](../matcher.md#Matcher)]
### _method_ `on_notice(*, rule=..., permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#MatcherGroup-on-notice} ### _method_ `on_notice(*, rule=..., permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#MatcherGroup-on-notice}
@@ -647,7 +601,6 @@ description: nonebot.plugin.on 模块
- **说明:** 注册一个通知事件响应器。 - **说明:** 注册一个通知事件响应器。
- **参数** - **参数**
- `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则 - `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则
- `permission` ([Permission](../permission.md#Permission) | [T_PermissionChecker](../typing.md#T-PermissionChecker) | None): 事件响应权限 - `permission` ([Permission](../permission.md#Permission) | [T_PermissionChecker](../typing.md#T-PermissionChecker) | None): 事件响应权限
@@ -665,7 +618,6 @@ description: nonebot.plugin.on 模块
- `state` ([T_State](../typing.md#T-State) | None): 默认 state - `state` ([T_State](../typing.md#T-State) | None): 默认 state
- **返回** - **返回**
- type[[Matcher](../matcher.md#Matcher)] - type[[Matcher](../matcher.md#Matcher)]
### _method_ `on_request(*, rule=..., permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#MatcherGroup-on-request} ### _method_ `on_request(*, rule=..., permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#MatcherGroup-on-request}
@@ -673,7 +625,6 @@ description: nonebot.plugin.on 模块
- **说明:** 注册一个请求事件响应器。 - **说明:** 注册一个请求事件响应器。
- **参数** - **参数**
- `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则 - `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则
- `permission` ([Permission](../permission.md#Permission) | [T_PermissionChecker](../typing.md#T-PermissionChecker) | None): 事件响应权限 - `permission` ([Permission](../permission.md#Permission) | [T_PermissionChecker](../typing.md#T-PermissionChecker) | None): 事件响应权限
@@ -691,7 +642,6 @@ description: nonebot.plugin.on 模块
- `state` ([T_State](../typing.md#T-State) | None): 默认 state - `state` ([T_State](../typing.md#T-State) | None): 默认 state
- **返回** - **返回**
- type[[Matcher](../matcher.md#Matcher)] - type[[Matcher](../matcher.md#Matcher)]
### _method_ `on_startswith(msg, *, ignorecase=..., rule=..., permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#MatcherGroup-on-startswith} ### _method_ `on_startswith(msg, *, ignorecase=..., rule=..., permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#MatcherGroup-on-startswith}
@@ -699,7 +649,6 @@ description: nonebot.plugin.on 模块
- **说明:** 注册一个消息事件响应器,并且当消息的**文本部分**以指定内容开头时响应。 - **说明:** 注册一个消息事件响应器,并且当消息的**文本部分**以指定内容开头时响应。
- **参数** - **参数**
- `msg` (str | tuple[str, ...]): 指定消息开头内容 - `msg` (str | tuple[str, ...]): 指定消息开头内容
- `ignorecase` (bool): 是否忽略大小写 - `ignorecase` (bool): 是否忽略大小写
@@ -721,7 +670,6 @@ description: nonebot.plugin.on 模块
- `state` ([T_State](../typing.md#T-State) | None): 默认 state - `state` ([T_State](../typing.md#T-State) | None): 默认 state
- **返回** - **返回**
- type[[Matcher](../matcher.md#Matcher)] - type[[Matcher](../matcher.md#Matcher)]
### _method_ `on_endswith(msg, *, ignorecase=..., rule=..., permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#MatcherGroup-on-endswith} ### _method_ `on_endswith(msg, *, ignorecase=..., rule=..., permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#MatcherGroup-on-endswith}
@@ -729,7 +677,6 @@ description: nonebot.plugin.on 模块
- **说明:** 注册一个消息事件响应器,并且当消息的**文本部分**以指定内容结尾时响应。 - **说明:** 注册一个消息事件响应器,并且当消息的**文本部分**以指定内容结尾时响应。
- **参数** - **参数**
- `msg` (str | tuple[str, ...]): 指定消息结尾内容 - `msg` (str | tuple[str, ...]): 指定消息结尾内容
- `ignorecase` (bool): 是否忽略大小写 - `ignorecase` (bool): 是否忽略大小写
@@ -751,7 +698,6 @@ description: nonebot.plugin.on 模块
- `state` ([T_State](../typing.md#T-State) | None): 默认 state - `state` ([T_State](../typing.md#T-State) | None): 默认 state
- **返回** - **返回**
- type[[Matcher](../matcher.md#Matcher)] - type[[Matcher](../matcher.md#Matcher)]
### _method_ `on_fullmatch(msg, *, ignorecase=..., rule=..., permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#MatcherGroup-on-fullmatch} ### _method_ `on_fullmatch(msg, *, ignorecase=..., rule=..., permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#MatcherGroup-on-fullmatch}
@@ -759,7 +705,6 @@ description: nonebot.plugin.on 模块
- **说明:** 注册一个消息事件响应器,并且当消息的**文本部分**与指定内容完全一致时响应。 - **说明:** 注册一个消息事件响应器,并且当消息的**文本部分**与指定内容完全一致时响应。
- **参数** - **参数**
- `msg` (str | tuple[str, ...]): 指定消息全匹配内容 - `msg` (str | tuple[str, ...]): 指定消息全匹配内容
- `ignorecase` (bool): 是否忽略大小写 - `ignorecase` (bool): 是否忽略大小写
@@ -781,7 +726,6 @@ description: nonebot.plugin.on 模块
- `state` ([T_State](../typing.md#T-State) | None): 默认 state - `state` ([T_State](../typing.md#T-State) | None): 默认 state
- **返回** - **返回**
- type[[Matcher](../matcher.md#Matcher)] - type[[Matcher](../matcher.md#Matcher)]
### _method_ `on_keyword(keywords, *, rule=..., permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#MatcherGroup-on-keyword} ### _method_ `on_keyword(keywords, *, rule=..., permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#MatcherGroup-on-keyword}
@@ -789,7 +733,6 @@ description: nonebot.plugin.on 模块
- **说明:** 注册一个消息事件响应器,并且当消息纯文本部分包含关键词时响应。 - **说明:** 注册一个消息事件响应器,并且当消息纯文本部分包含关键词时响应。
- **参数** - **参数**
- `keywords` (set[str]): 关键词列表 - `keywords` (set[str]): 关键词列表
- `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则 - `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则
@@ -809,7 +752,6 @@ description: nonebot.plugin.on 模块
- `state` ([T_State](../typing.md#T-State) | None): 默认 state - `state` ([T_State](../typing.md#T-State) | None): 默认 state
- **返回** - **返回**
- type[[Matcher](../matcher.md#Matcher)] - type[[Matcher](../matcher.md#Matcher)]
### _method_ `on_command(cmd, aliases=..., force_whitespace=..., *, rule=..., permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#MatcherGroup-on-command} ### _method_ `on_command(cmd, aliases=..., force_whitespace=..., *, rule=..., permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#MatcherGroup-on-command}
@@ -821,7 +763,6 @@ description: nonebot.plugin.on 模块
命令匹配规则参考: `命令形式匹配 <rule.md#command-command>`\_ 命令匹配规则参考: `命令形式匹配 <rule.md#command-command>`\_
- **参数** - **参数**
- `cmd` (str | tuple[str, ...]): 指定命令内容 - `cmd` (str | tuple[str, ...]): 指定命令内容
- `aliases` (set[str | tuple[str, ...]] | None): 命令别名 - `aliases` (set[str | tuple[str, ...]] | None): 命令别名
@@ -845,7 +786,6 @@ description: nonebot.plugin.on 模块
- `state` ([T_State](../typing.md#T-State) | None): 默认 state - `state` ([T_State](../typing.md#T-State) | None): 默认 state
- **返回** - **返回**
- type[[Matcher](../matcher.md#Matcher)] - type[[Matcher](../matcher.md#Matcher)]
### _method_ `on_shell_command(cmd, aliases=..., parser=..., *, rule=..., permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#MatcherGroup-on-shell-command} ### _method_ `on_shell_command(cmd, aliases=..., parser=..., *, rule=..., permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#MatcherGroup-on-shell-command}
@@ -860,7 +800,6 @@ description: nonebot.plugin.on 模块
通过 [ShellCommandArgs](../params.md#ShellCommandArgs) 获取解析后的参数字典。 通过 [ShellCommandArgs](../params.md#ShellCommandArgs) 获取解析后的参数字典。
- **参数** - **参数**
- `cmd` (str | tuple[str, ...]): 指定命令内容 - `cmd` (str | tuple[str, ...]): 指定命令内容
- `aliases` (set[str | tuple[str, ...]] | None): 命令别名 - `aliases` (set[str | tuple[str, ...]] | None): 命令别名
@@ -884,7 +823,6 @@ description: nonebot.plugin.on 模块
- `state` ([T_State](../typing.md#T-State) | None): 默认 state - `state` ([T_State](../typing.md#T-State) | None): 默认 state
- **返回** - **返回**
- type[[Matcher](../matcher.md#Matcher)] - type[[Matcher](../matcher.md#Matcher)]
### _method_ `on_regex(pattern, flags=..., *, rule=..., permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#MatcherGroup-on-regex} ### _method_ `on_regex(pattern, flags=..., *, rule=..., permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#MatcherGroup-on-regex}
@@ -896,7 +834,6 @@ description: nonebot.plugin.on 模块
命令匹配规则参考: `正则匹配 <rule.md#regex-regex-flags-0>`\_ 命令匹配规则参考: `正则匹配 <rule.md#regex-regex-flags-0>`\_
- **参数** - **参数**
- `pattern` (str): 正则表达式 - `pattern` (str): 正则表达式
- `flags` (int | re.RegexFlag): 正则匹配标志 - `flags` (int | re.RegexFlag): 正则匹配标志
@@ -918,7 +855,6 @@ description: nonebot.plugin.on 模块
- `state` ([T_State](../typing.md#T-State) | None): 默认 state - `state` ([T_State](../typing.md#T-State) | None): 默认 state
- **返回** - **返回**
- type[[Matcher](../matcher.md#Matcher)] - type[[Matcher](../matcher.md#Matcher)]
### _method_ `on_type(types, *, rule=..., permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#MatcherGroup-on-type} ### _method_ `on_type(types, *, rule=..., permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#MatcherGroup-on-type}
@@ -926,7 +862,6 @@ description: nonebot.plugin.on 模块
- **说明:** 注册一个事件响应器,并且当事件为指定类型时响应。 - **说明:** 注册一个事件响应器,并且当事件为指定类型时响应。
- **参数** - **参数**
- `types` (type[[Event](../adapters/index.md#Event)] | tuple[type[[Event](../adapters/index.md#Event)]]): 事件类型 - `types` (type[[Event](../adapters/index.md#Event)] | tuple[type[[Event](../adapters/index.md#Event)]]): 事件类型
- `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则 - `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则
@@ -946,5 +881,4 @@ description: nonebot.plugin.on 模块
- `state` ([T_State](../typing.md#T-State) | None): 默认 state - `state` ([T_State](../typing.md#T-State) | None): 默认 state
- **返回** - **返回**
- type[[Matcher](../matcher.md#Matcher)] - type[[Matcher](../matcher.md#Matcher)]

View File

@@ -22,7 +22,6 @@ description: nonebot.rule 模块
当事件传递时,在 [Matcher](matcher.md#Matcher) 运行前进行检查。 当事件传递时,在 [Matcher](matcher.md#Matcher) 运行前进行检查。
- **参数** - **参数**
- `*checkers` ([T_RuleChecker](typing.md#T-RuleChecker) | [Dependent](dependencies/index.md#Dependent)[bool]): RuleChecker - `*checkers` ([T_RuleChecker](typing.md#T-RuleChecker) | [Dependent](dependencies/index.md#Dependent)[bool]): RuleChecker
- **用法** - **用法**
@@ -44,7 +43,6 @@ description: nonebot.rule 模块
- **说明:** 检查是否符合所有规则 - **说明:** 检查是否符合所有规则
- **参数** - **参数**
- `bot` ([Bot](adapters/index.md#Bot)): Bot 对象 - `bot` ([Bot](adapters/index.md#Bot)): Bot 对象
- `event` ([Event](adapters/index.md#Event)): Event 对象 - `event` ([Event](adapters/index.md#Event)): Event 对象
@@ -56,7 +54,6 @@ description: nonebot.rule 模块
- `dependency_cache` ([T_DependencyCache](typing.md#T-DependencyCache) | None): 依赖缓存 - `dependency_cache` ([T_DependencyCache](typing.md#T-DependencyCache) | None): 依赖缓存
- **返回** - **返回**
- bool - bool
## _class_ `CMD_RESULT(<auto>)` {#CMD-RESULT} ## _class_ `CMD_RESULT(<auto>)` {#CMD-RESULT}
@@ -78,7 +75,6 @@ description: nonebot.rule 模块
- **说明:** 检查消息纯文本是否以指定字符串开头。 - **说明:** 检查消息纯文本是否以指定字符串开头。
- **参数** - **参数**
- `msg` (tuple[str, ...]): 指定消息开头字符串元组 - `msg` (tuple[str, ...]): 指定消息开头字符串元组
- `ignorecase` (bool): 是否忽略大小写 - `ignorecase` (bool): 是否忽略大小写
@@ -88,13 +84,11 @@ description: nonebot.rule 模块
- **说明:** 匹配消息纯文本开头。 - **说明:** 匹配消息纯文本开头。
- **参数** - **参数**
- `msg` (str | tuple[str, ...]): 指定消息开头字符串元组 - `msg` (str | tuple[str, ...]): 指定消息开头字符串元组
- `ignorecase` (bool): 是否忽略大小写 - `ignorecase` (bool): 是否忽略大小写
- **返回** - **返回**
- [Rule](#Rule) - [Rule](#Rule)
## _class_ `EndswithRule(msg, ignorecase=False)` {#EndswithRule} ## _class_ `EndswithRule(msg, ignorecase=False)` {#EndswithRule}
@@ -102,7 +96,6 @@ description: nonebot.rule 模块
- **说明:** 检查消息纯文本是否以指定字符串结尾。 - **说明:** 检查消息纯文本是否以指定字符串结尾。
- **参数** - **参数**
- `msg` (tuple[str, ...]): 指定消息结尾字符串元组 - `msg` (tuple[str, ...]): 指定消息结尾字符串元组
- `ignorecase` (bool): 是否忽略大小写 - `ignorecase` (bool): 是否忽略大小写
@@ -112,13 +105,11 @@ description: nonebot.rule 模块
- **说明:** 匹配消息纯文本结尾。 - **说明:** 匹配消息纯文本结尾。
- **参数** - **参数**
- `msg` (str | tuple[str, ...]): 指定消息开头字符串元组 - `msg` (str | tuple[str, ...]): 指定消息开头字符串元组
- `ignorecase` (bool): 是否忽略大小写 - `ignorecase` (bool): 是否忽略大小写
- **返回** - **返回**
- [Rule](#Rule) - [Rule](#Rule)
## _class_ `FullmatchRule(msg, ignorecase=False)` {#FullmatchRule} ## _class_ `FullmatchRule(msg, ignorecase=False)` {#FullmatchRule}
@@ -126,7 +117,6 @@ description: nonebot.rule 模块
- **说明:** 检查消息纯文本是否与指定字符串全匹配。 - **说明:** 检查消息纯文本是否与指定字符串全匹配。
- **参数** - **参数**
- `msg` (tuple[str, ...]): 指定消息全匹配字符串元组 - `msg` (tuple[str, ...]): 指定消息全匹配字符串元组
- `ignorecase` (bool): 是否忽略大小写 - `ignorecase` (bool): 是否忽略大小写
@@ -136,13 +126,11 @@ description: nonebot.rule 模块
- **说明:** 完全匹配消息。 - **说明:** 完全匹配消息。
- **参数** - **参数**
- `msg` (str | tuple[str, ...]): 指定消息全匹配字符串元组 - `msg` (str | tuple[str, ...]): 指定消息全匹配字符串元组
- `ignorecase` (bool): 是否忽略大小写 - `ignorecase` (bool): 是否忽略大小写
- **返回** - **返回**
- [Rule](#Rule) - [Rule](#Rule)
## _class_ `KeywordsRule(*keywords)` {#KeywordsRule} ## _class_ `KeywordsRule(*keywords)` {#KeywordsRule}
@@ -150,7 +138,6 @@ description: nonebot.rule 模块
- **说明:** 检查消息纯文本是否包含指定关键字。 - **说明:** 检查消息纯文本是否包含指定关键字。
- **参数** - **参数**
- `*keywords` (str): 指定关键字元组 - `*keywords` (str): 指定关键字元组
## _def_ `keyword(*keywords)` {#keyword} ## _def_ `keyword(*keywords)` {#keyword}
@@ -158,11 +145,9 @@ description: nonebot.rule 模块
- **说明:** 匹配消息纯文本关键词。 - **说明:** 匹配消息纯文本关键词。
- **参数** - **参数**
- `*keywords` (str): 指定关键字元组 - `*keywords` (str): 指定关键字元组
- **返回** - **返回**
- [Rule](#Rule) - [Rule](#Rule)
## _class_ `CommandRule(cmds, force_whitespace=None)` {#CommandRule} ## _class_ `CommandRule(cmds, force_whitespace=None)` {#CommandRule}
@@ -170,7 +155,6 @@ description: nonebot.rule 模块
- **说明:** 检查消息是否为指定命令。 - **说明:** 检查消息是否为指定命令。
- **参数** - **参数**
- `cmds` (list[tuple[str, ...]]): 指定命令元组列表 - `cmds` (list[tuple[str, ...]]): 指定命令元组列表
- `force_whitespace` (str | bool | None): 是否强制命令后必须有指定空白符 - `force_whitespace` (str | bool | None): 是否强制命令后必须有指定空白符
@@ -189,13 +173,11 @@ description: nonebot.rule 模块
通过 [CommandArg](params.md#CommandArg) 获取匹配成功的命令参数。 通过 [CommandArg](params.md#CommandArg) 获取匹配成功的命令参数。
- **参数** - **参数**
- `*cmds` (str | tuple[str, ...]): 命令文本或命令元组 - `*cmds` (str | tuple[str, ...]): 命令文本或命令元组
- `force_whitespace` (str | bool | None): 是否强制命令后必须有指定空白符 - `force_whitespace` (str | bool | None): 是否强制命令后必须有指定空白符
- **返回** - **返回**
- [Rule](#Rule) - [Rule](#Rule)
- **用法** - **用法**
@@ -231,37 +213,28 @@ description: nonebot.rule 模块
- **重载** - **重载**
**1.** `(args=None, namespace=None) -> tuple[Namespace, list[str | MessageSegment]]` **1.** `(args=None, namespace=None) -> tuple[Namespace, list[str | MessageSegment]]`
- **参数** - **参数**
- `args` (Sequence[str | [MessageSegment](adapters/index.md#MessageSegment)] | None) - `args` (Sequence[str | [MessageSegment](adapters/index.md#MessageSegment)] | None)
- `namespace` (None) - `namespace` (None)
- **返回** - **返回**
- tuple[Namespace, list[str | [MessageSegment](adapters/index.md#MessageSegment)]] - tuple[Namespace, list[str | [MessageSegment](adapters/index.md#MessageSegment)]]
**2.** `(args, namespace) -> tuple[T, list[str | MessageSegment]]` **2.** `(args, namespace) -> tuple[T, list[str | MessageSegment]]`
- **参数** - **参数**
- `args` (Sequence[str | [MessageSegment](adapters/index.md#MessageSegment)] | None) - `args` (Sequence[str | [MessageSegment](adapters/index.md#MessageSegment)] | None)
- `namespace` (T) - `namespace` (T)
- **返回** - **返回**
- tuple[T, list[str | [MessageSegment](adapters/index.md#MessageSegment)]] - tuple[T, list[str | [MessageSegment](adapters/index.md#MessageSegment)]]
**3.** `(*, namespace) -> tuple[T, list[str | MessageSegment]]` **3.** `(*, namespace) -> tuple[T, list[str | MessageSegment]]`
- **参数** - **参数**
- `namespace` (T) - `namespace` (T)
- **返回** - **返回**
- tuple[T, list[str | [MessageSegment](adapters/index.md#MessageSegment)]] - tuple[T, list[str | [MessageSegment](adapters/index.md#MessageSegment)]]
## _class_ `ShellCommandRule(cmds, parser)` {#ShellCommandRule} ## _class_ `ShellCommandRule(cmds, parser)` {#ShellCommandRule}
@@ -269,7 +242,6 @@ description: nonebot.rule 模块
- **说明:** 检查消息是否为指定 shell 命令。 - **说明:** 检查消息是否为指定 shell 命令。
- **参数** - **参数**
- `cmds` (list[tuple[str, ...]]): 指定命令元组列表 - `cmds` (list[tuple[str, ...]]): 指定命令元组列表
- `parser` (ArgumentParser | None): 可选参数解析器 - `parser` (ArgumentParser | None): 可选参数解析器
@@ -298,13 +270,11 @@ description: nonebot.rule 模块
::: :::
- **参数** - **参数**
- `*cmds` (str | tuple[str, ...]): 命令文本或命令元组 - `*cmds` (str | tuple[str, ...]): 命令文本或命令元组
- `parser` (ArgumentParser | None): [ArgumentParser](#ArgumentParser) 对象 - `parser` (ArgumentParser | None): [ArgumentParser](#ArgumentParser) 对象
- **返回** - **返回**
- [Rule](#Rule) - [Rule](#Rule)
- **用法** - **用法**
@@ -330,7 +300,6 @@ description: nonebot.rule 模块
- **说明:** 检查消息字符串是否符合指定正则表达式。 - **说明:** 检查消息字符串是否符合指定正则表达式。
- **参数** - **参数**
- `regex` (str): 正则表达式 - `regex` (str): 正则表达式
- `flags` (int): 正则表达式标记 - `flags` (int): 正则表达式标记
@@ -346,13 +315,11 @@ description: nonebot.rule 模块
通过 [RegexDict](params.md#RegexDict) 获取匹配成功的 group 字典。 通过 [RegexDict](params.md#RegexDict) 获取匹配成功的 group 字典。
- **参数** - **参数**
- `regex` (str): 正则表达式 - `regex` (str): 正则表达式
- `flags` (int | re.RegexFlag): 正则表达式标记 - `flags` (int | re.RegexFlag): 正则表达式标记
- **返回** - **返回**
- [Rule](#Rule) - [Rule](#Rule)
:::tip 提示 :::tip 提示
@@ -380,7 +347,6 @@ description: nonebot.rule 模块
empty empty
- **返回** - **返回**
- [Rule](#Rule) - [Rule](#Rule)
## _class_ `IsTypeRule(*types)` {#IsTypeRule} ## _class_ `IsTypeRule(*types)` {#IsTypeRule}
@@ -388,7 +354,6 @@ description: nonebot.rule 模块
- **说明:** 检查事件类型是否为指定类型。 - **说明:** 检查事件类型是否为指定类型。
- **参数** - **参数**
- `*types` (type[[Event](adapters/index.md#Event)]) - `*types` (type[[Event](adapters/index.md#Event)])
## _def_ `is_type(*types)` {#is-type} ## _def_ `is_type(*types)` {#is-type}
@@ -396,9 +361,7 @@ description: nonebot.rule 模块
- **说明:** 匹配事件类型。 - **说明:** 匹配事件类型。
- **参数** - **参数**
- `*types` (type[[Event](adapters/index.md#Event)]): 事件类型 - `*types` (type[[Event](adapters/index.md#Event)]): 事件类型
- **返回** - **返回**
- [Rule](#Rule) - [Rule](#Rule)

View File

@@ -19,31 +19,25 @@ description: nonebot.typing 模块
- **说明:** 标记一个方法为父类 interface 的 implement - **说明:** 标记一个方法为父类 interface 的 implement
- **参数** - **参数**
- `InterfaceClass` (object) - `InterfaceClass` (object)
- **返回** - **返回**
- untyped - untyped
## _def_ `type_has_args(type_)` {#type-has-args} ## _def_ `type_has_args(type_)` {#type-has-args}
- **参数** - **参数**
- `type_` (type[Any]) - `type_` (type[Any])
- **返回** - **返回**
- bool - bool
## _def_ `origin_is_union(origin)` {#origin-is-union} ## _def_ `origin_is_union(origin)` {#origin-is-union}
- **参数** - **参数**
- `origin` (type[Any] | None) - `origin` (type[Any] | None)
- **返回** - **返回**
- bool - bool
## _def_ `origin_is_literal(origin)` {#origin-is-literal} ## _def_ `origin_is_literal(origin)` {#origin-is-literal}
@@ -51,11 +45,9 @@ description: nonebot.typing 模块
- **说明:** 判断是否是 Literal 类型 - **说明:** 判断是否是 Literal 类型
- **参数** - **参数**
- `origin` (type[Any] | None) - `origin` (type[Any] | None)
- **返回** - **返回**
- bool - bool
## _def_ `all_literal_values(type_)` {#all-literal-values} ## _def_ `all_literal_values(type_)` {#all-literal-values}
@@ -63,11 +55,9 @@ description: nonebot.typing 模块
- **说明:** 获取 Literal 类型包含的所有值 - **说明:** 获取 Literal 类型包含的所有值
- **参数** - **参数**
- `type_` (type[Any]) - `type_` (type[Any])
- **返回** - **返回**
- list[Any] - list[Any]
## _def_ `origin_is_annotated(origin)` {#origin-is-annotated} ## _def_ `origin_is_annotated(origin)` {#origin-is-annotated}
@@ -75,11 +65,9 @@ description: nonebot.typing 模块
- **说明:** 判断是否是 Annotated 类型 - **说明:** 判断是否是 Annotated 类型
- **参数** - **参数**
- `origin` (type[Any] | None) - `origin` (type[Any] | None)
- **返回** - **返回**
- bool - bool
## _def_ `is_none_type(type_)` {#is-none-type} ## _def_ `is_none_type(type_)` {#is-none-type}
@@ -87,17 +75,14 @@ description: nonebot.typing 模块
- **说明:** 判断是否是 None 类型 - **说明:** 判断是否是 None 类型
- **参数** - **参数**
- `type_` (type[Any]) - `type_` (type[Any])
- **返回** - **返回**
- bool - bool
## _def_ `evaluate_forwardref(ref, globalns, localns)` {#evaluate-forwardref} ## _def_ `evaluate_forwardref(ref, globalns, localns)` {#evaluate-forwardref}
- **参数** - **参数**
- `ref` (ForwardRef) - `ref` (ForwardRef)
- `globalns` (dict[str, Any]) - `globalns` (dict[str, Any])
@@ -105,7 +90,6 @@ description: nonebot.typing 模块
- `localns` (dict[str, Any]) - `localns` (dict[str, Any])
- **返回** - **返回**
- Any - Any
## _class_ `StateFlag(<auto>)` {#StateFlag} ## _class_ `StateFlag(<auto>)` {#StateFlag}
@@ -129,7 +113,6 @@ description: nonebot.typing 模块
Bot 连接建立时钩子函数 Bot 连接建立时钩子函数
依赖参数: 依赖参数:
- DependParam: 子依赖参数 - DependParam: 子依赖参数
- BotParam: Bot 对象 - BotParam: Bot 对象
- DefaultParam: 带有默认值的参数 - DefaultParam: 带有默认值的参数
@@ -143,7 +126,6 @@ description: nonebot.typing 模块
Bot 连接断开时钩子函数 Bot 连接断开时钩子函数
依赖参数: 依赖参数:
- DependParam: 子依赖参数 - DependParam: 子依赖参数
- BotParam: Bot 对象 - BotParam: Bot 对象
- DefaultParam: 带有默认值的参数 - DefaultParam: 带有默认值的参数
@@ -169,7 +151,6 @@ description: nonebot.typing 模块
事件预处理函数 EventPreProcessor 类型 事件预处理函数 EventPreProcessor 类型
依赖参数: 依赖参数:
- DependParam: 子依赖参数 - DependParam: 子依赖参数
- BotParam: Bot 对象 - BotParam: Bot 对象
- EventParam: Event 对象 - EventParam: Event 对象
@@ -185,7 +166,6 @@ description: nonebot.typing 模块
事件后处理函数 EventPostProcessor 类型 事件后处理函数 EventPostProcessor 类型
依赖参数: 依赖参数:
- DependParam: 子依赖参数 - DependParam: 子依赖参数
- BotParam: Bot 对象 - BotParam: Bot 对象
- EventParam: Event 对象 - EventParam: Event 对象
@@ -201,7 +181,6 @@ description: nonebot.typing 模块
事件响应器运行前预处理函数 RunPreProcessor 类型 事件响应器运行前预处理函数 RunPreProcessor 类型
依赖参数: 依赖参数:
- DependParam: 子依赖参数 - DependParam: 子依赖参数
- BotParam: Bot 对象 - BotParam: Bot 对象
- EventParam: Event 对象 - EventParam: Event 对象
@@ -218,7 +197,6 @@ description: nonebot.typing 模块
事件响应器运行后后处理函数 RunPostProcessor 类型 事件响应器运行后后处理函数 RunPostProcessor 类型
依赖参数: 依赖参数:
- DependParam: 子依赖参数 - DependParam: 子依赖参数
- BotParam: Bot 对象 - BotParam: Bot 对象
- EventParam: Event 对象 - EventParam: Event 对象
@@ -236,7 +214,6 @@ description: nonebot.typing 模块
RuleChecker 即判断是否响应事件的处理函数。 RuleChecker 即判断是否响应事件的处理函数。
依赖参数: 依赖参数:
- DependParam: 子依赖参数 - DependParam: 子依赖参数
- BotParam: Bot 对象 - BotParam: Bot 对象
- EventParam: Event 对象 - EventParam: Event 对象
@@ -252,7 +229,6 @@ description: nonebot.typing 模块
PermissionChecker 即判断事件是否满足权限的处理函数。 PermissionChecker 即判断事件是否满足权限的处理函数。
依赖参数: 依赖参数:
- DependParam: 子依赖参数 - DependParam: 子依赖参数
- BotParam: Bot 对象 - BotParam: Bot 对象
- EventParam: Event 对象 - EventParam: Event 对象
@@ -273,7 +249,6 @@ description: nonebot.typing 模块
TypeUpdater 在 Matcher.pause, Matcher.reject 时被运行,用于更新响应的事件类型。 默认会更新为 `message` TypeUpdater 在 Matcher.pause, Matcher.reject 时被运行,用于更新响应的事件类型。 默认会更新为 `message`
依赖参数: 依赖参数:
- DependParam: 子依赖参数 - DependParam: 子依赖参数
- BotParam: Bot 对象 - BotParam: Bot 对象
- EventParam: Event 对象 - EventParam: Event 对象
@@ -290,7 +265,6 @@ description: nonebot.typing 模块
PermissionUpdater 在 Matcher.pause, Matcher.reject 时被运行,用于更新会话对象权限。 默认会更新为当前事件的触发对象。 PermissionUpdater 在 Matcher.pause, Matcher.reject 时被运行,用于更新会话对象权限。 默认会更新为当前事件的触发对象。
依赖参数: 依赖参数:
- DependParam: 子依赖参数 - DependParam: 子依赖参数
- BotParam: Bot 对象 - BotParam: Bot 对象
- EventParam: Event 对象 - EventParam: Event 对象

View File

@@ -18,11 +18,9 @@ description: nonebot.utils 模块
参考: [loguru color 标签](https://loguru.readthedocs.io/en/stable/api/logger.html#color) 参考: [loguru color 标签](https://loguru.readthedocs.io/en/stable/api/logger.html#color)
- **参数** - **参数**
- `s` (str): 需要转义的字符串 - `s` (str): 需要转义的字符串
- **返回** - **返回**
- str - str
## _def_ `deep_update(mapping, *updating_mappings)` {#deep-update} ## _def_ `deep_update(mapping, *updating_mappings)` {#deep-update}
@@ -30,13 +28,11 @@ description: nonebot.utils 模块
- **说明:** 深度更新合并字典 - **说明:** 深度更新合并字典
- **参数** - **参数**
- `mapping` (dict[K, Any]) - `mapping` (dict[K, Any])
- `*updating_mappings` (dict[K, Any]) - `*updating_mappings` (dict[K, Any])
- **返回** - **返回**
- dict[K, Any] - dict[K, Any]
## _def_ `lenient_issubclass(cls, class_or_tuple)` {#lenient-issubclass} ## _def_ `lenient_issubclass(cls, class_or_tuple)` {#lenient-issubclass}
@@ -44,13 +40,11 @@ description: nonebot.utils 模块
- **说明:** 检查 cls 是否是 class_or_tuple 中的一个类型子类并忽略类型错误。 - **说明:** 检查 cls 是否是 class_or_tuple 中的一个类型子类并忽略类型错误。
- **参数** - **参数**
- `cls` (Any) - `cls` (Any)
- `class_or_tuple` (type[Any] | tuple[type[Any], ...]) - `class_or_tuple` (type[Any] | tuple[type[Any], ...])
- **返回** - **返回**
- bool - bool
## _def_ `generic_check_issubclass(cls, class_or_tuple)` {#generic-check-issubclass} ## _def_ `generic_check_issubclass(cls, class_or_tuple)` {#generic-check-issubclass}
@@ -60,7 +54,6 @@ description: nonebot.utils 模块
检查 cls 是否是 class_or_tuple 中的一个类型子类。 检查 cls 是否是 class_or_tuple 中的一个类型子类。
特别的: 特别的:
- 如果 cls 是 `typing.Union``types.UnionType` 类型, - 如果 cls 是 `typing.Union``types.UnionType` 类型,
则会检查其中的所有类型是否是 class_or_tuple 中一个类型的子类或 None。 则会检查其中的所有类型是否是 class_or_tuple 中一个类型的子类或 None。
- 如果 cls 是 `typing.Literal` 类型, - 如果 cls 是 `typing.Literal` 类型,
@@ -70,13 +63,11 @@ description: nonebot.utils 模块
是否是 class_or_tuple 中一个类型的子类或 None。 是否是 class_or_tuple 中一个类型的子类或 None。
- **参数** - **参数**
- `cls` (Any) - `cls` (Any)
- `class_or_tuple` (type[Any] | tuple[type[Any], ...]) - `class_or_tuple` (type[Any] | tuple[type[Any], ...])
- **返回** - **返回**
- bool - bool
## _def_ `type_is_complex(type_)` {#type-is-complex} ## _def_ `type_is_complex(type_)` {#type-is-complex}
@@ -84,11 +75,9 @@ description: nonebot.utils 模块
- **说明:** 检查 type\_ 是否是复杂类型 - **说明:** 检查 type\_ 是否是复杂类型
- **参数** - **参数**
- `type_` (type[Any]) - `type_` (type[Any])
- **返回** - **返回**
- bool - bool
## _def_ `is_coroutine_callable(call)` {#is-coroutine-callable} ## _def_ `is_coroutine_callable(call)` {#is-coroutine-callable}
@@ -96,11 +85,9 @@ description: nonebot.utils 模块
- **说明:** 检查 call 是否是一个 callable 协程函数 - **说明:** 检查 call 是否是一个 callable 协程函数
- **参数** - **参数**
- `call` ((...) -> Any) - `call` ((...) -> Any)
- **返回** - **返回**
- bool - bool
## _def_ `is_gen_callable(call)` {#is-gen-callable} ## _def_ `is_gen_callable(call)` {#is-gen-callable}
@@ -108,11 +95,9 @@ description: nonebot.utils 模块
- **说明:** 检查 call 是否是一个生成器函数 - **说明:** 检查 call 是否是一个生成器函数
- **参数** - **参数**
- `call` ((...) -> Any) - `call` ((...) -> Any)
- **返回** - **返回**
- bool - bool
## _def_ `is_async_gen_callable(call)` {#is-async-gen-callable} ## _def_ `is_async_gen_callable(call)` {#is-async-gen-callable}
@@ -120,11 +105,9 @@ description: nonebot.utils 模块
- **说明:** 检查 call 是否是一个异步生成器函数 - **说明:** 检查 call 是否是一个异步生成器函数
- **参数** - **参数**
- `call` ((...) -> Any) - `call` ((...) -> Any)
- **返回** - **返回**
- bool - bool
## _def_ `run_sync(call)` {#run-sync} ## _def_ `run_sync(call)` {#run-sync}
@@ -132,11 +115,9 @@ description: nonebot.utils 模块
- **说明:** 一个用于包装 sync function 为 async function 的装饰器 - **说明:** 一个用于包装 sync function 为 async function 的装饰器
- **参数** - **参数**
- `call` ((P) -> R): 被装饰的同步函数 - `call` ((P) -> R): 被装饰的同步函数
- **返回** - **返回**
- (P) -> Coroutine[None, None, R] - (P) -> Coroutine[None, None, R]
## _def_ `run_sync_ctx_manager(cm)` {#run-sync-ctx-manager} ## _def_ `run_sync_ctx_manager(cm)` {#run-sync-ctx-manager}
@@ -144,11 +125,9 @@ description: nonebot.utils 模块
- **说明:** 一个用于包装 sync context manager 为 async context manager 的执行函数 - **说明:** 一个用于包装 sync context manager 为 async context manager 的执行函数
- **参数** - **参数**
- `cm` (AbstractContextManager[T]) - `cm` (AbstractContextManager[T])
- **返回** - **返回**
- AsyncGenerator[T, None] - AsyncGenerator[T, None]
## _async def_ `run_coro_with_catch(coro, exc, return_on_err=None)` {#run-coro-with-catch} ## _async def_ `run_coro_with_catch(coro, exc, return_on_err=None)` {#run-coro-with-catch}
@@ -158,9 +137,7 @@ description: nonebot.utils 模块
- **重载** - **重载**
**1.** `(coro, exc, return_on_err=None) -> T | None` **1.** `(coro, exc, return_on_err=None) -> T | None`
- **参数** - **参数**
- `coro` (Coroutine[Any, Any, T]) - `coro` (Coroutine[Any, Any, T])
- `exc` (tuple[type[Exception], ...]) - `exc` (tuple[type[Exception], ...])
@@ -168,13 +145,10 @@ description: nonebot.utils 模块
- `return_on_err` (None) - `return_on_err` (None)
- **返回** - **返回**
- T | None - T | None
**2.** `(coro, exc, return_on_err) -> T | R` **2.** `(coro, exc, return_on_err) -> T | R`
- **参数** - **参数**
- `coro` (Coroutine[Any, Any, T]) - `coro` (Coroutine[Any, Any, T])
- `exc` (tuple[type[Exception], ...]) - `exc` (tuple[type[Exception], ...])
@@ -182,11 +156,9 @@ description: nonebot.utils 模块
- `return_on_err` (R) - `return_on_err` (R)
- **返回** - **返回**
- T | R - T | R
- **参数** - **参数**
- `coro`: 要运行的协程 - `coro`: 要运行的协程
- `exc`: 要捕获的异常 - `exc`: 要捕获的异常
@@ -202,21 +174,17 @@ description: nonebot.utils 模块
- **说明:** 运行协程并在取消时屏蔽取消异常。 - **说明:** 运行协程并在取消时屏蔽取消异常。
- **参数** - **参数**
- `coro` (Coroutine[Any, Any, T]): 要运行的协程 - `coro` (Coroutine[Any, Any, T]): 要运行的协程
- **返回** - **返回**
- T: 协程的返回值 - T: 协程的返回值
## _def_ `flatten_exception_group(exc_group)` {#flatten-exception-group} ## _def_ `flatten_exception_group(exc_group)` {#flatten-exception-group}
- **参数** - **参数**
- `exc_group` (BaseExceptionGroup[E]) - `exc_group` (BaseExceptionGroup[E])
- **返回** - **返回**
- Generator[E, None, None] - Generator[E, None, None]
## _def_ `get_name(obj)` {#get-name} ## _def_ `get_name(obj)` {#get-name}
@@ -224,11 +192,9 @@ description: nonebot.utils 模块
- **说明:** 获取对象的名称 - **说明:** 获取对象的名称
- **参数** - **参数**
- `obj` (Any) - `obj` (Any)
- **返回** - **返回**
- str - str
## _def_ `path_to_module_name(path)` {#path-to-module-name} ## _def_ `path_to_module_name(path)` {#path-to-module-name}
@@ -236,11 +202,9 @@ description: nonebot.utils 模块
- **说明:** 转换路径为模块名 - **说明:** 转换路径为模块名
- **参数** - **参数**
- `path` (Path) - `path` (Path)
- **返回** - **返回**
- str - str
## _def_ `resolve_dot_notation(obj_str, default_attr, default_prefix=None)` {#resolve-dot-notation} ## _def_ `resolve_dot_notation(obj_str, default_attr, default_prefix=None)` {#resolve-dot-notation}
@@ -248,7 +212,6 @@ description: nonebot.utils 模块
- **说明:** 解析并导入点分表示法的对象 - **说明:** 解析并导入点分表示法的对象
- **参数** - **参数**
- `obj_str` (str) - `obj_str` (str)
- `default_attr` (str) - `default_attr` (str)
@@ -256,7 +219,6 @@ description: nonebot.utils 模块
- `default_prefix` (str | None) - `default_prefix` (str | None)
- **返回** - **返回**
- Any - Any
## _class_ `classproperty(func)` {#classproperty} ## _class_ `classproperty(func)` {#classproperty}
@@ -264,7 +226,6 @@ description: nonebot.utils 模块
- **说明:** 类属性装饰器 - **说明:** 类属性装饰器
- **参数** - **参数**
- `func` ((Any) -> T) - `func` ((Any) -> T)
## _class_ `DataclassEncoder(<auto>)` {#DataclassEncoder} ## _class_ `DataclassEncoder(<auto>)` {#DataclassEncoder}
@@ -278,11 +239,9 @@ description: nonebot.utils 模块
### _method_ `default(o)` {#DataclassEncoder-default} ### _method_ `default(o)` {#DataclassEncoder-default}
- **参数** - **参数**
- `o` - `o`
- **返回** - **返回**
- untyped - untyped
## _def_ `logger_wrapper(logger_name)` {#logger-wrapper} ## _def_ `logger_wrapper(logger_name)` {#logger-wrapper}
@@ -290,15 +249,12 @@ description: nonebot.utils 模块
- **说明:** 用于打印 adapter 的日志。 - **说明:** 用于打印 adapter 的日志。
- **参数** - **参数**
- `logger_name` (str): adapter 的名称 - `logger_name` (str): adapter 的名称
- **返回** - **返回**
- untyped: 日志记录函数 - untyped: 日志记录函数
日志记录函数的参数: 日志记录函数的参数:
- level: 日志等级 - level: 日志等级
- message: 日志信息 - message: 日志信息
- exception: 异常信息 - exception: 异常信息

View File

@@ -278,7 +278,6 @@ opt2 = Option("--foo", default=OptionResult(value=False, args={"bar": 1}))
`Arparma` 有如下属性: `Arparma` 有如下属性:
- 调试类 - 调试类
- matched: 是否匹配成功 - matched: 是否匹配成功
- error_data: 解析失败时剩余的数据 - error_data: 解析失败时剩余的数据
- error_info: 解析失败时的异常内容 - error_info: 解析失败时的异常内容

View File

@@ -0,0 +1,229 @@
---
sidebar_position: 8
description: 轻量化 HTML 绘图
---
# 轻量化 HTML 绘图
图片是机器人交互中不可或缺的一部分,对于信息展示的直观性、美观性有很大的作用。
基于 PIL 直接绘制图片具有良好的性能和存储开销,但是难以调试、维护过程式的绘图代码。
使用浏览器渲染类插件可以方便地绘制网页,且能够直接通过 JS 对网页效果进行编程,但是它占用的存储和内存空间相对可观。
NoneBot 提供的 `nonebot-plugin-htmlkit` 提供了另一种基于 HTML 和 CSS 语法的轻量化绘图选择:它基于 `litehtml` 解析库,无须安装额外的依赖即可使用,没有进程间通信带来的额外开销,且在支持 `webp` `avif` 等丰富图片格式的前提下,安装用的 wheel 文件大小仅有约 10 MB。
作为粗略的性能参考,在一台 Ryzen 7 9700X 的 Windows 电脑上,渲染 [PEP 7](https://peps.python.org/pep-0007/) 的 HTML 页面(分辨率为 800x5788大小约 1.4MB,从本地文件系统读取 CSS大约需要 100ms每个渲染任务内存最高占用约为 40MB.
## 安装插件
在使用前请先安装 `nonebot-plugin-htmlkit` 插件至项目环境中,可参考[获取商店插件](../tutorial/store.mdx#安装插件)来了解并选择安装插件的方式。如:
在**项目目录**下执行以下命令:
```bash
nb plugin install nonebot-plugin-htmlkit
```
`nonebot-plugin-htmlkit` 插件目前兼容以下系统架构:
- Windows x64
- macOS arm64M-系列芯片)
- Linux x64 (非 Alpine 等 musl 系发行版)
- Linux arm64 (非 Alpine 等 musl 系发行版)
:::caution 访问网络内容
如果需要访问网络资源(如 http(s) 网页内容NoneBot 需要客户端型驱动器Forward。内置的驱动器有 `~httpx``~aiohttp`
详见[选择驱动器](../advanced/driver.md)。
:::
## 使用插件
### 加载插件
在使用本插件前同样需要使用 `require` 方法进行**加载**并**导入**需要使用的方法,可参考 [跨插件访问](../advanced/requiring.md) 一节进行了解,如:
```python
from nonebot import require
require("nonebot_plugin_htmlkit")
from nonebot_plugin_htmlkit import html_to_pic, md_to_pic, template_to_pic, text_to_pic
```
插件会自动使用[配置中的参数](#配置-fontconfig)初始化 `fontconfig` 以提供字体查找功能。
### 渲染 API
`nonebot-plugin-htmlkit` 主要提供以下**异步**渲染函数:
#### html_to_pic
```python
async def html_to_pic(
html: str,
*,
base_url: str = "",
dpi: float = 144.0,
max_width: float = 800.0,
device_height: float = 600.0,
default_font_size: float = 12.0,
font_name: str = "sans-serif",
allow_refit: bool = True,
image_format: Literal["png", "jpeg"] = "png",
jpeg_quality: int = 100,
lang: str = "zh",
culture: str = "CN",
img_fetch_fn: ImgFetchFn = combined_img_fetcher,
css_fetch_fn: CSSFetchFn = combined_css_fetcher,
urljoin_fn: Callable[[str, str], str] = urllib3.parse.urljoin,
) -> bytes:
...
```
最核心的渲染函数。
`base_url``urljoin_fn` 控制着传入 `image_fetch_fn``css_fetch_fn` 回调的 url 内容。
`allow_refit` 如果为真,渲染时会自动缩小产出图片的宽度到最适合的宽度,否则必定产出 `max_width` 宽度的图片。
`max_width``device_height` 会在 `@media` 判断中被使用。
`img_fetch_fn` 预期为一个异步可调用对象(函数),接收图片 url 并返回对应 url 的 jpeg 或 png 二进制数据(`bytes`),可在拒绝加载时返回 `None`.
`css_fetch_fn` 预期为一个异步可调用对象(函数),接收目标 CSS url 并返回对应 url 的 CSS 文本(`str`),可在拒绝加载时返回 `None`.
以下为辅助的封装函数,关键字参数若未特殊说明均与 `html_to_pic` 含义相同。
#### text_to_pic
```python
async def text_to_pic(
text: str,
css_path: str = "",
*,
max_width: int = 500,
allow_refit: bool = True,
image_format: Literal["png", "jpeg"] = "png",
jpeg_quality: int = 100,
) -> bytes:
...
```
可用于渲染多行文本。
`text` 会被放置于 `<div id="main" class="main-box"> <div class="text">` 中,可据此编写 CSS 来改变文本表现。
#### md_to_pic
```python
async def md_to_pic(
md: str = "",
md_path: str = "",
css_path: str = "",
*,
max_width: int = 500,
img_fetch_fn: ImgFetchFn = combined_img_fetcher,
allow_refit: bool = True,
image_format: Literal["png", "jpeg"] = "png",
jpeg_quality: int = 100,
) -> bytes:
...
```
可用于渲染 Markdown 文本。默认为 GitHub Markdown Light 风格,支持基于 `pygments` 的代码高亮。
`md``md_path` 二选一,前者设置时应为 Markdown 的文本,后者设置时应为指向 Markdown 文本文件的路径。
#### template_to_pic
```python
async def template_to_pic(
template_path: str | PathLike[str] | Sequence[str | PathLike[str]],
template_name: str,
templates: Mapping[Any, Any],
filters: None | Mapping[str, Any] = None,
*,
max_width: int = 500,
device_height: int = 600,
base_url: str | None = None,
img_fetch_fn: ImgFetchFn = combined_img_fetcher,
css_fetch_fn: CSSFetchFn = combined_css_fetcher,
allow_refit: bool = True,
image_format: Literal["png", "jpeg"] = "png",
jpeg_quality: int = 100,
) -> bytes:
...
```
渲染 jinja2 模板。
`template_path` 为 jinja2 环境的路径,`template_name` 是环境中要加载模板的名字,`templates` 为传入模板的参数,`filters` 为过滤器名 -> 自定义过滤器的映射。
### 控制外部资源获取
通过传入 `img_fetch_fn``css_fetch_fn`,我们可以在实际访问资源前进行审查,修改资源的来源,或是对 IO 操作进行缓存。
`img_fetch_fn` 预期为一个异步可调用对象(函数),接收图片 url 并返回对应 url 的 jpeg 或 png 二进制数据(`bytes`),可在拒绝加载时返回 `None`.
`css_fetch_fn` 预期为一个异步可调用对象(函数),接收目标 CSS url 并返回对应 url 的 CSS 文本(`str`),可在拒绝加载时返回 `None`.
如果你想要禁用外部资源加载/只从文件系统加载/只从网络加载,可以使用 `none_fetcher` `filesystem_***_fetcher` `network_***_fetcher`
默认的 fetcher 行为(对于 `file://` 从文件系统加载,其余从网络加载)位于 `combined_***_fetcher`,可以通过对其封装实现缓存等操作。
## 配置项
### 配置 fontconfig
`htmlkit` 使用 `fontconfig` 查找字体,请参阅 [`fontconfig 用户手册`](https://fontconfig.pages.freedesktop.org/fontconfig/fontconfig-user) 了解环境变量的具体含义、如何通过编写配置文件修改字体配置等。
#### fontconfig_file
- **类型**: `str | None`
- **默认值**: `None`
覆盖默认的配置文件路径。
#### fontconfig_path
- **类型**: `str | None`
- **默认值**: `None`
覆盖默认的配置目录。
#### fontconfig_sysroot
- **类型**: `str | None`
- **默认值**: `None`
覆盖默认的 sysroot。
#### fc_debug
- **类型**: `str | None`
- **默认值**: `None`
设置 Fontconfig 的 debug 级别。
#### fc_dbg_match_filter
- **类型**: `str | None`
- **默认值**: `None`
`FC_DEBUG` 设置为 `MATCH2` 时,过滤 debug 输出。
#### fc_lang
- **类型**: `str | None`
- **默认值**: `None`
设置默认语言,否则从 `LOCALE` 环境变量获取。
#### fontconfig_use_mmap
- **类型**: `str | None`
- **默认值**: `None`
是否使用 `mmap(2)` 读取字体缓存。

View File

@@ -40,7 +40,7 @@ async def handle_function():
### 处理近似事件 ### 处理近似事件
对于一系列**差异不大**的事件,我们往往具有相同的处理逻辑。这时,我们不希望将相同的逻辑编写两遍,而应该复用代码,以实现在同一个事件处理函数中处理多个近似事件。我们可以使用[事件重载](../advanced/dependency.mdx#Event)的特性来实现这一功能。例如: 对于一系列**差异不大**的事件,我们往往具有相同的处理逻辑。这时,我们不希望将相同的逻辑编写两遍,而应该复用代码,以实现在同一个事件处理函数中处理多个近似事件。我们可以使用[事件重载](../advanced/dependency.mdx#event)的特性来实现这一功能。例如:
<Tabs groupId="python"> <Tabs groupId="python">
<TabItem value="3.10" label="Python 3.10+" default> <TabItem value="3.10" label="Python 3.10+" default>

View File

@@ -155,7 +155,6 @@ async def test_example(app: App):
1. `should_call_send` 1. `should_call_send`
定义事件响应器预期发送的消息,即通过[事件响应器操作 send](../../appendices/session-control.mdx#send)进行的操作。`should_call_send` 有四个参数: 定义事件响应器预期发送的消息,即通过[事件响应器操作 send](../../appendices/session-control.mdx#send)进行的操作。`should_call_send` 有四个参数:
- `event`:回复的目标事件。 - `event`:回复的目标事件。
- `message`:预期的消息对象,可以是 `str`、`Message` 或 `MessageSegment`。 - `message`:预期的消息对象,可以是 `str`、`Message` 或 `MessageSegment`。
- `result`send 的返回值,将会返回给插件。 - `result`send 的返回值,将会返回给插件。
@@ -163,8 +162,7 @@ async def test_example(app: App):
- `**kwargs`send 方法的额外参数。 - `**kwargs`send 方法的额外参数。
2. `should_call_api` 2. `should_call_api`
定义事件响应器预期调用的平台 API 接口,即通过[调用平台 API](../../appendices/api-calling.mdx#调用平台-API)进行的操作。`should_call_api` 有四个参数: 定义事件响应器预期调用的平台 API 接口,即通过[调用平台 API](../../appendices/api-calling.mdx#调用平台-api)进行的操作。`should_call_api` 有四个参数:
- `api`API 名称。 - `api`API 名称。
- `data`:预期的请求数据。 - `data`:预期的请求数据。
- `result`call_api 的返回值,将会返回给插件。 - `result`call_api 的返回值,将会返回给插件。

View File

@@ -20,7 +20,6 @@ description: nonebot.adapters 模块
通常,在 Adapter 中编写协议通信相关代码,如: 建立通信连接、处理接收与发送 data 等。 通常,在 Adapter 中编写协议通信相关代码,如: 建立通信连接、处理接收与发送 data 等。
- **参数** - **参数**
- `driver` ([Driver](../drivers/index.md#Driver)): [Driver](../drivers/index.md#Driver) 实例 - `driver` ([Driver](../drivers/index.md#Driver)): [Driver](../drivers/index.md#Driver) 实例
- `**kwargs` (Any): 其他由 [Driver.register_adapter](../drivers/index.md#Driver-register-adapter) 传入的额外参数 - `**kwargs` (Any): 其他由 [Driver.register_adapter](../drivers/index.md#Driver-register-adapter) 传入的额外参数
@@ -46,7 +45,6 @@ description: nonebot.adapters 模块
empty empty
- **返回** - **返回**
- str - str
### _property_ `config` {#Adapter-config} ### _property_ `config` {#Adapter-config}
@@ -64,11 +62,9 @@ description: nonebot.adapters 模块
当有新的 [Bot](#Bot) 实例连接建立成功时调用。 当有新的 [Bot](#Bot) 实例连接建立成功时调用。
- **参数** - **参数**
- `bot` ([Bot](#Bot)): [Bot](#Bot) 实例 - `bot` ([Bot](#Bot)): [Bot](#Bot) 实例
- **返回** - **返回**
- None - None
### _method_ `bot_disconnect(bot)` {#Adapter-bot-disconnect} ### _method_ `bot_disconnect(bot)` {#Adapter-bot-disconnect}
@@ -80,11 +76,9 @@ description: nonebot.adapters 模块
当有 [Bot](#Bot) 实例连接断开时调用。 当有 [Bot](#Bot) 实例连接断开时调用。
- **参数** - **参数**
- `bot` ([Bot](#Bot)): [Bot](#Bot) 实例 - `bot` ([Bot](#Bot)): [Bot](#Bot) 实例
- **返回** - **返回**
- None - None
### _method_ `setup_http_server(setup)` {#Adapter-setup-http-server} ### _method_ `setup_http_server(setup)` {#Adapter-setup-http-server}
@@ -92,11 +86,9 @@ description: nonebot.adapters 模块
- **说明:** 设置一个 HTTP 服务器路由配置 - **说明:** 设置一个 HTTP 服务器路由配置
- **参数** - **参数**
- `setup` ([HTTPServerSetup](../drivers/index.md#HTTPServerSetup)) - `setup` ([HTTPServerSetup](../drivers/index.md#HTTPServerSetup))
- **返回** - **返回**
- untyped - untyped
### _method_ `setup_websocket_server(setup)` {#Adapter-setup-websocket-server} ### _method_ `setup_websocket_server(setup)` {#Adapter-setup-websocket-server}
@@ -104,11 +96,9 @@ description: nonebot.adapters 模块
- **说明:** 设置一个 WebSocket 服务器路由配置 - **说明:** 设置一个 WebSocket 服务器路由配置
- **参数** - **参数**
- `setup` ([WebSocketServerSetup](../drivers/index.md#WebSocketServerSetup)) - `setup` ([WebSocketServerSetup](../drivers/index.md#WebSocketServerSetup))
- **返回** - **返回**
- untyped - untyped
### _async method_ `request(setup)` {#Adapter-request} ### _async method_ `request(setup)` {#Adapter-request}
@@ -116,11 +106,9 @@ description: nonebot.adapters 模块
- **说明:** 进行一个 HTTP 客户端请求 - **说明:** 进行一个 HTTP 客户端请求
- **参数** - **参数**
- `setup` ([Request](../drivers/index.md#Request)) - `setup` ([Request](../drivers/index.md#Request))
- **返回** - **返回**
- [Response](../drivers/index.md#Response) - [Response](../drivers/index.md#Response)
### _method_ `websocket(setup)` {#Adapter-websocket} ### _method_ `websocket(setup)` {#Adapter-websocket}
@@ -128,21 +116,17 @@ description: nonebot.adapters 模块
- **说明:** 建立一个 WebSocket 客户端连接请求 - **说明:** 建立一个 WebSocket 客户端连接请求
- **参数** - **参数**
- `setup` ([Request](../drivers/index.md#Request)) - `setup` ([Request](../drivers/index.md#Request))
- **返回** - **返回**
- AsyncGenerator[[WebSocket](../drivers/index.md#WebSocket), None] - AsyncGenerator[[WebSocket](../drivers/index.md#WebSocket), None]
### _method_ `on_ready(func)` {#Adapter-on-ready} ### _method_ `on_ready(func)` {#Adapter-on-ready}
- **参数** - **参数**
- `func` (LIFESPAN_FUNC) - `func` (LIFESPAN_FUNC)
- **返回** - **返回**
- LIFESPAN_FUNC - LIFESPAN_FUNC
## _abstract class_ `Bot(adapter, self_id)` {#Bot} ## _abstract class_ `Bot(adapter, self_id)` {#Bot}
@@ -154,7 +138,6 @@ description: nonebot.adapters 模块
用于处理上报消息,并提供 API 调用接口。 用于处理上报消息,并提供 API 调用接口。
- **参数** - **参数**
- `adapter` ([Adapter](#Adapter)): 协议适配器实例 - `adapter` ([Adapter](#Adapter)): 协议适配器实例
- `self_id` (str): 机器人 ID - `self_id` (str): 机器人 ID
@@ -188,13 +171,11 @@ description: nonebot.adapters 模块
- **说明:** 调用机器人 API 接口,可以通过该函数或直接通过 bot 属性进行调用 - **说明:** 调用机器人 API 接口,可以通过该函数或直接通过 bot 属性进行调用
- **参数** - **参数**
- `api` (str): API 名称 - `api` (str): API 名称
- `**data` (Any): API 数据 - `**data` (Any): API 数据
- **返回** - **返回**
- Any - Any
- **用法** - **用法**
@@ -209,7 +190,6 @@ description: nonebot.adapters 模块
- **说明:** 调用机器人基础发送消息接口 - **说明:** 调用机器人基础发送消息接口
- **参数** - **参数**
- `event` ([Event](#Event)): 上报事件 - `event` ([Event](#Event)): 上报事件
- `message` (str | [Message](#Message) | [MessageSegment](#MessageSegment)): 要发送的消息 - `message` (str | [Message](#Message) | [MessageSegment](#MessageSegment)): 要发送的消息
@@ -217,7 +197,6 @@ description: nonebot.adapters 模块
- `**kwargs` (Any): 任意额外参数 - `**kwargs` (Any): 任意额外参数
- **返回** - **返回**
- Any - Any
### _classmethod_ `on_calling_api(func)` {#Bot-on-calling-api} ### _classmethod_ `on_calling_api(func)` {#Bot-on-calling-api}
@@ -227,17 +206,14 @@ description: nonebot.adapters 模块
调用 api 预处理。 调用 api 预处理。
钩子函数参数: 钩子函数参数:
- bot: 当前 bot 对象 - bot: 当前 bot 对象
- api: 调用的 api 名称 - api: 调用的 api 名称
- data: api 调用的参数字典 - data: api 调用的参数字典
- **参数** - **参数**
- `func` ([T_CallingAPIHook](../typing.md#T-CallingAPIHook)) - `func` ([T_CallingAPIHook](../typing.md#T-CallingAPIHook))
- **返回** - **返回**
- [T_CallingAPIHook](../typing.md#T-CallingAPIHook) - [T_CallingAPIHook](../typing.md#T-CallingAPIHook)
### _classmethod_ `on_called_api(func)` {#Bot-on-called-api} ### _classmethod_ `on_called_api(func)` {#Bot-on-called-api}
@@ -247,7 +223,6 @@ description: nonebot.adapters 模块
调用 api 后处理。 调用 api 后处理。
钩子函数参数: 钩子函数参数:
- bot: 当前 bot 对象 - bot: 当前 bot 对象
- exception: 调用 api 时发生的错误 - exception: 调用 api 时发生的错误
- api: 调用的 api 名称 - api: 调用的 api 名称
@@ -255,11 +230,9 @@ description: nonebot.adapters 模块
- result: api 调用的返回 - result: api 调用的返回
- **参数** - **参数**
- `func` ([T_CalledAPIHook](../typing.md#T-CalledAPIHook)) - `func` ([T_CalledAPIHook](../typing.md#T-CalledAPIHook))
- **返回** - **返回**
- [T_CalledAPIHook](../typing.md#T-CalledAPIHook) - [T_CalledAPIHook](../typing.md#T-CalledAPIHook)
## _abstract class_ `Event(<auto>)` {#Event} ## _abstract class_ `Event(<auto>)` {#Event}
@@ -279,7 +252,6 @@ description: nonebot.adapters 模块
empty empty
- **返回** - **返回**
- str - str
### _abstract method_ `get_event_name()` {#Event-get-event-name} ### _abstract method_ `get_event_name()` {#Event-get-event-name}
@@ -291,7 +263,6 @@ description: nonebot.adapters 模块
empty empty
- **返回** - **返回**
- str - str
### _abstract method_ `get_event_description()` {#Event-get-event-description} ### _abstract method_ `get_event_description()` {#Event-get-event-description}
@@ -303,7 +274,6 @@ description: nonebot.adapters 模块
empty empty
- **返回** - **返回**
- str - str
### _method_ `get_log_string()` {#Event-get-log-string} ### _method_ `get_log_string()` {#Event-get-log-string}
@@ -320,11 +290,9 @@ description: nonebot.adapters 模块
empty empty
- **返回** - **返回**
- str - str
- **异常** - **异常**
- NoLogException: 希望 NoneBot 隐藏该事件日志 - NoLogException: 希望 NoneBot 隐藏该事件日志
### _abstract method_ `get_user_id()` {#Event-get-user-id} ### _abstract method_ `get_user_id()` {#Event-get-user-id}
@@ -336,7 +304,6 @@ description: nonebot.adapters 模块
empty empty
- **返回** - **返回**
- str - str
### _abstract method_ `get_session_id()` {#Event-get-session-id} ### _abstract method_ `get_session_id()` {#Event-get-session-id}
@@ -348,7 +315,6 @@ description: nonebot.adapters 模块
empty empty
- **返回** - **返回**
- str - str
### _abstract method_ `get_message()` {#Event-get-message} ### _abstract method_ `get_message()` {#Event-get-message}
@@ -360,7 +326,6 @@ description: nonebot.adapters 模块
empty empty
- **返回** - **返回**
- [Message](#Message) - [Message](#Message)
### _method_ `get_plaintext()` {#Event-get-plaintext} ### _method_ `get_plaintext()` {#Event-get-plaintext}
@@ -376,7 +341,6 @@ description: nonebot.adapters 模块
empty empty
- **返回** - **返回**
- str - str
### _abstract method_ `is_tome()` {#Event-is-tome} ### _abstract method_ `is_tome()` {#Event-is-tome}
@@ -388,7 +352,6 @@ description: nonebot.adapters 模块
empty empty
- **返回** - **返回**
- bool - bool
## _abstract class_ `Message(<auto>)` {#Message} ## _abstract class_ `Message(<auto>)` {#Message}
@@ -396,7 +359,6 @@ description: nonebot.adapters 模块
- **说明:** 消息序列 - **说明:** 消息序列
- **参数** - **参数**
- `message`: 消息内容 - `message`: 消息内容
### _classmethod_ `template(format_string)` {#Message-template} ### _classmethod_ `template(format_string)` {#Message-template}
@@ -410,11 +372,9 @@ description: nonebot.adapters 模块
可以通过该消息类型的 `MessageSegment` 工厂方法创建消息。 可以通过该消息类型的 `MessageSegment` 工厂方法创建消息。
- **参数** - **参数**
- `format_string` (str | TM): 格式化模板 - `format_string` (str | TM): 格式化模板
- **返回** - **返回**
- [MessageTemplate](#MessageTemplate)[Self]: 消息格式化器 - [MessageTemplate](#MessageTemplate)[Self]: 消息格式化器
### _abstract classmethod_ `get_segment_class()` {#Message-get-segment-class} ### _abstract classmethod_ `get_segment_class()` {#Message-get-segment-class}
@@ -426,7 +386,6 @@ description: nonebot.adapters 模块
empty empty
- **返回** - **返回**
- type[TMS] - type[TMS]
### _abstract staticmethod_ `_construct(msg)` {#Message--construct} ### _abstract staticmethod_ `_construct(msg)` {#Message--construct}
@@ -434,11 +393,9 @@ description: nonebot.adapters 模块
- **说明:** 构造消息数组 - **说明:** 构造消息数组
- **参数** - **参数**
- `msg` (str) - `msg` (str)
- **返回** - **返回**
- Iterable[TMS] - Iterable[TMS]
### _method_ `__getitem__(args)` {#Message---getitem--} ### _method_ `__getitem__(args)` {#Message---getitem--}
@@ -446,53 +403,38 @@ description: nonebot.adapters 模块
- **重载** - **重载**
**1.** `(args) -> Self` **1.** `(args) -> Self`
- **参数** - **参数**
- `args` (str): 消息段类型 - `args` (str): 消息段类型
- **返回** - **返回**
- Self: 所有类型为 `args` 的消息段 - Self: 所有类型为 `args` 的消息段
**2.** `(args) -> TMS` **2.** `(args) -> TMS`
- **参数** - **参数**
- `args` (tuple[str, int]): 消息段类型和索引 - `args` (tuple[str, int]): 消息段类型和索引
- **返回** - **返回**
- TMS: 类型为 `args[0]` 的消息段第 `args[1]` 个 - TMS: 类型为 `args[0]` 的消息段第 `args[1]` 个
**3.** `(args) -> Self` **3.** `(args) -> Self`
- **参数** - **参数**
- `args` (tuple[str, slice]): 消息段类型和切片 - `args` (tuple[str, slice]): 消息段类型和切片
- **返回** - **返回**
- Self: 类型为 `args[0]` 的消息段切片 `args[1]` - Self: 类型为 `args[0]` 的消息段切片 `args[1]`
**4.** `(args) -> TMS` **4.** `(args) -> TMS`
- **参数** - **参数**
- `args` (int): 索引 - `args` (int): 索引
- **返回** - **返回**
- TMS: 第 `args` 个消息段 - TMS: 第 `args` 个消息段
**5.** `(args) -> Self` **5.** `(args) -> Self`
- **参数** - **参数**
- `args` (slice): 切片 - `args` (slice): 切片
- **返回** - **返回**
- Self: 消息切片 `args` - Self: 消息切片 `args`
### _method_ `__contains__(value)` {#Message---contains--} ### _method_ `__contains__(value)` {#Message---contains--}
@@ -500,11 +442,9 @@ description: nonebot.adapters 模块
- **说明:** 检查消息段是否存在 - **说明:** 检查消息段是否存在
- **参数** - **参数**
- `value` (TMS | str): 消息段或消息段类型 - `value` (TMS | str): 消息段或消息段类型
- **返回** - **返回**
- bool: 消息内是否存在给定消息段或给定类型的消息段 - bool: 消息内是否存在给定消息段或给定类型的消息段
### _method_ `has(value)` {#Message-has} ### _method_ `has(value)` {#Message-has}
@@ -512,11 +452,9 @@ description: nonebot.adapters 模块
- **说明:** 与 [`__contains__`](#Message---contains--) 相同 - **说明:** 与 [`__contains__`](#Message---contains--) 相同
- **参数** - **参数**
- `value` (TMS | str) - `value` (TMS | str)
- **返回** - **返回**
- bool - bool
### _method_ `index(value, *args)` {#Message-index} ### _method_ `index(value, *args)` {#Message-index}
@@ -524,7 +462,6 @@ description: nonebot.adapters 模块
- **说明:** 索引消息段 - **说明:** 索引消息段
- **参数** - **参数**
- `value` (TMS | str): 消息段或者消息段类型 - `value` (TMS | str): 消息段或者消息段类型
- `*args` (SupportsIndex) - `*args` (SupportsIndex)
@@ -532,11 +469,9 @@ description: nonebot.adapters 模块
- `arg`: start 与 end - `arg`: start 与 end
- **返回** - **返回**
- int: 索引 index - int: 索引 index
- **异常** - **异常**
- ValueError: 消息段不存在 - ValueError: 消息段不存在
### _method_ `get(type_, count=None)` {#Message-get} ### _method_ `get(type_, count=None)` {#Message-get}
@@ -544,13 +479,11 @@ description: nonebot.adapters 模块
- **说明:** 获取指定类型的消息段 - **说明:** 获取指定类型的消息段
- **参数** - **参数**
- `type_` (str): 消息段类型 - `type_` (str): 消息段类型
- `count` (int | None): 获取个数 - `count` (int | None): 获取个数
- **返回** - **返回**
- Self: 构建的新消息 - Self: 构建的新消息
### _method_ `count(value)` {#Message-count} ### _method_ `count(value)` {#Message-count}
@@ -558,11 +491,9 @@ description: nonebot.adapters 模块
- **说明:** 计算指定消息段的个数 - **说明:** 计算指定消息段的个数
- **参数** - **参数**
- `value` (TMS | str): 消息段或消息段类型 - `value` (TMS | str): 消息段或消息段类型
- **返回** - **返回**
- int: 个数 - int: 个数
### _method_ `only(value)` {#Message-only} ### _method_ `only(value)` {#Message-only}
@@ -570,11 +501,9 @@ description: nonebot.adapters 模块
- **说明:** 检查消息中是否仅包含指定消息段 - **说明:** 检查消息中是否仅包含指定消息段
- **参数** - **参数**
- `value` (TMS | str): 指定消息段或消息段类型 - `value` (TMS | str): 指定消息段或消息段类型
- **返回** - **返回**
- bool: 是否仅包含指定消息段 - bool: 是否仅包含指定消息段
### _method_ `append(obj)` {#Message-append} ### _method_ `append(obj)` {#Message-append}
@@ -582,11 +511,9 @@ description: nonebot.adapters 模块
- **说明:** 添加一个消息段到消息数组末尾。 - **说明:** 添加一个消息段到消息数组末尾。
- **参数** - **参数**
- `obj` (str | TMS): 要添加的消息段 - `obj` (str | TMS): 要添加的消息段
- **返回** - **返回**
- Self - Self
### _method_ `extend(obj)` {#Message-extend} ### _method_ `extend(obj)` {#Message-extend}
@@ -594,11 +521,9 @@ description: nonebot.adapters 模块
- **说明:** 拼接一个消息数组或多个消息段到消息数组末尾。 - **说明:** 拼接一个消息数组或多个消息段到消息数组末尾。
- **参数** - **参数**
- `obj` (Self | Iterable[TMS]): 要添加的消息数组 - `obj` (Self | Iterable[TMS]): 要添加的消息数组
- **返回** - **返回**
- Self - Self
### _method_ `join(iterable)` {#Message-join} ### _method_ `join(iterable)` {#Message-join}
@@ -606,11 +531,9 @@ description: nonebot.adapters 模块
- **说明:** 将多个消息连接并将自身作为分割 - **说明:** 将多个消息连接并将自身作为分割
- **参数** - **参数**
- `iterable` (Iterable[TMS | Self]): 要连接的消息 - `iterable` (Iterable[TMS | Self]): 要连接的消息
- **返回** - **返回**
- Self: 连接后的消息 - Self: 连接后的消息
### _method_ `copy()` {#Message-copy} ### _method_ `copy()` {#Message-copy}
@@ -622,7 +545,6 @@ description: nonebot.adapters 模块
empty empty
- **返回** - **返回**
- Self - Self
### _method_ `include(*types)` {#Message-include} ### _method_ `include(*types)` {#Message-include}
@@ -630,11 +552,9 @@ description: nonebot.adapters 模块
- **说明:** 过滤消息 - **说明:** 过滤消息
- **参数** - **参数**
- `*types` (str): 包含的消息段类型 - `*types` (str): 包含的消息段类型
- **返回** - **返回**
- Self: 新构造的消息 - Self: 新构造的消息
### _method_ `exclude(*types)` {#Message-exclude} ### _method_ `exclude(*types)` {#Message-exclude}
@@ -642,11 +562,9 @@ description: nonebot.adapters 模块
- **说明:** 过滤消息 - **说明:** 过滤消息
- **参数** - **参数**
- `*types` (str): 不包含的消息段类型 - `*types` (str): 不包含的消息段类型
- **返回** - **返回**
- Self: 新构造的消息 - Self: 新构造的消息
### _method_ `extract_plain_text()` {#Message-extract-plain-text} ### _method_ `extract_plain_text()` {#Message-extract-plain-text}
@@ -658,7 +576,6 @@ description: nonebot.adapters 模块
empty empty
- **返回** - **返回**
- str - str
## _abstract class_ `MessageSegment(<auto>)` {#MessageSegment} ## _abstract class_ `MessageSegment(<auto>)` {#MessageSegment}
@@ -690,7 +607,6 @@ description: nonebot.adapters 模块
empty empty
- **返回** - **返回**
- type[TM] - type[TM]
### _abstract method_ `__str__()` {#MessageSegment---str--} ### _abstract method_ `__str__()` {#MessageSegment---str--}
@@ -702,29 +618,24 @@ description: nonebot.adapters 模块
empty empty
- **返回** - **返回**
- str - str
### _method_ `__add__(other)` {#MessageSegment---add--} ### _method_ `__add__(other)` {#MessageSegment---add--}
- **参数** - **参数**
- `other` (str | TMS | Iterable[TMS]) - `other` (str | TMS | Iterable[TMS])
- **返回** - **返回**
- TM - TM
### _method_ `get(key, default=None)` {#MessageSegment-get} ### _method_ `get(key, default=None)` {#MessageSegment-get}
- **参数** - **参数**
- `key` (str) - `key` (str)
- `default` (Any) - `default` (Any)
- **返回** - **返回**
- untyped - untyped
### _method_ `keys()` {#MessageSegment-keys} ### _method_ `keys()` {#MessageSegment-keys}
@@ -734,7 +645,6 @@ description: nonebot.adapters 模块
empty empty
- **返回** - **返回**
- untyped - untyped
### _method_ `values()` {#MessageSegment-values} ### _method_ `values()` {#MessageSegment-values}
@@ -744,7 +654,6 @@ description: nonebot.adapters 模块
empty empty
- **返回** - **返回**
- untyped - untyped
### _method_ `items()` {#MessageSegment-items} ### _method_ `items()` {#MessageSegment-items}
@@ -754,17 +663,14 @@ description: nonebot.adapters 模块
empty empty
- **返回** - **返回**
- untyped - untyped
### _method_ `join(iterable)` {#MessageSegment-join} ### _method_ `join(iterable)` {#MessageSegment-join}
- **参数** - **参数**
- `iterable` (Iterable[TMS | TM]) - `iterable` (Iterable[TMS | TM])
- **返回** - **返回**
- TM - TM
### _method_ `copy()` {#MessageSegment-copy} ### _method_ `copy()` {#MessageSegment-copy}
@@ -774,7 +680,6 @@ description: nonebot.adapters 模块
empty empty
- **返回** - **返回**
- Self - Self
### _abstract method_ `is_text()` {#MessageSegment-is-text} ### _abstract method_ `is_text()` {#MessageSegment-is-text}
@@ -786,7 +691,6 @@ description: nonebot.adapters 模块
empty empty
- **返回** - **返回**
- bool - bool
## _class_ `MessageTemplate(template, factory=str, private_getattr=False)` {#MessageTemplate} ## _class_ `MessageTemplate(template, factory=str, private_getattr=False)` {#MessageTemplate}
@@ -794,7 +698,6 @@ description: nonebot.adapters 模块
- **说明:** 消息模板格式化实现类。 - **说明:** 消息模板格式化实现类。
- **参数** - **参数**
- `template` (str | TM): 模板 - `template` (str | TM): 模板
- `factory` (type[str] | type[TM]): 消息类型工厂,默认为 `str` - `factory` (type[str] | type[TM]): 消息类型工厂,默认为 `str`
@@ -804,13 +707,11 @@ description: nonebot.adapters 模块
### _method_ `add_format_spec(spec, name=None)` {#MessageTemplate-add-format-spec} ### _method_ `add_format_spec(spec, name=None)` {#MessageTemplate-add-format-spec}
- **参数** - **参数**
- `spec` (FormatSpecFunc_T) - `spec` (FormatSpecFunc_T)
- `name` (str | None) - `name` (str | None)
- **返回** - **返回**
- FormatSpecFunc_T - FormatSpecFunc_T
### _method_ `format(*args, **kwargs)` {#MessageTemplate-format} ### _method_ `format(*args, **kwargs)` {#MessageTemplate-format}
@@ -818,13 +719,11 @@ description: nonebot.adapters 模块
- **说明:** 根据传入参数和模板生成消息对象 - **说明:** 根据传入参数和模板生成消息对象
- **参数** - **参数**
- `*args` - `*args`
- `**kwargs` - `**kwargs`
- **返回** - **返回**
- TF - TF
### _method_ `format_map(mapping)` {#MessageTemplate-format-map} ### _method_ `format_map(mapping)` {#MessageTemplate-format-map}
@@ -832,17 +731,14 @@ description: nonebot.adapters 模块
- **说明:** 根据传入字典和模板生成消息对象, 在传入字段名不是有效标识符时有用 - **说明:** 根据传入字典和模板生成消息对象, 在传入字段名不是有效标识符时有用
- **参数** - **参数**
- `mapping` (Mapping[str, Any]) - `mapping` (Mapping[str, Any])
- **返回** - **返回**
- TF - TF
### _method_ `vformat(format_string, args, kwargs)` {#MessageTemplate-vformat} ### _method_ `vformat(format_string, args, kwargs)` {#MessageTemplate-vformat}
- **参数** - **参数**
- `format_string` (str) - `format_string` (str)
- `args` (Sequence[Any]) - `args` (Sequence[Any])
@@ -850,13 +746,11 @@ description: nonebot.adapters 模块
- `kwargs` (Mapping[str, Any]) - `kwargs` (Mapping[str, Any])
- **返回** - **返回**
- TF - TF
### _method_ `get_field(field_name, args, kwargs)` {#MessageTemplate-get-field} ### _method_ `get_field(field_name, args, kwargs)` {#MessageTemplate-get-field}
- **参数** - **参数**
- `field_name` (str) - `field_name` (str)
- `args` (Sequence[Any]) - `args` (Sequence[Any])
@@ -864,17 +758,14 @@ description: nonebot.adapters 模块
- `kwargs` (Mapping[str, Any]) - `kwargs` (Mapping[str, Any])
- **返回** - **返回**
- tuple[Any, int | str] - tuple[Any, int | str]
### _method_ `format_field(value, format_spec)` {#MessageTemplate-format-field} ### _method_ `format_field(value, format_spec)` {#MessageTemplate-format-field}
- **参数** - **参数**
- `value` (Any) - `value` (Any)
- `format_spec` (str) - `format_spec` (str)
- **返回** - **返回**
- Any - Any

View File

@@ -36,7 +36,6 @@ description: nonebot.compat 模块
- **说明:** FieldInfo class with extra property for compatibility with pydantic v1 - **说明:** FieldInfo class with extra property for compatibility with pydantic v1
- **参数** - **参数**
- `default` (Any) - `default` (Any)
- `**kwargs` (Any) - `**kwargs` (Any)
@@ -82,7 +81,6 @@ description: nonebot.compat 模块
- **说明:** Construct a ModelField from given infos. - **说明:** Construct a ModelField from given infos.
- **参数** - **参数**
- `name` (str) - `name` (str)
- `annotation` (Any) - `annotation` (Any)
@@ -90,7 +88,6 @@ description: nonebot.compat 模块
- `field_info` (FieldInfo | None) - `field_info` (FieldInfo | None)
- **返回** - **返回**
- Self - Self
### _method_ `get_default()` {#ModelField-get-default} ### _method_ `get_default()` {#ModelField-get-default}
@@ -102,7 +99,6 @@ description: nonebot.compat 模块
empty empty
- **返回** - **返回**
- Any - Any
### _method_ `validate_value(value)` {#ModelField-validate-value} ### _method_ `validate_value(value)` {#ModelField-validate-value}
@@ -110,11 +106,9 @@ description: nonebot.compat 模块
- **说明:** Validate the value pass to the field. - **说明:** Validate the value pass to the field.
- **参数** - **参数**
- `value` (Any) - `value` (Any)
- **返回** - **返回**
- Any - Any
## _def_ `extract_field_info(field_info)` {#extract-field-info} ## _def_ `extract_field_info(field_info)` {#extract-field-info}
@@ -122,11 +116,9 @@ description: nonebot.compat 模块
- **说明:** Get FieldInfo init kwargs from a FieldInfo instance. - **说明:** Get FieldInfo init kwargs from a FieldInfo instance.
- **参数** - **参数**
- `field_info` (BaseFieldInfo) - `field_info` (BaseFieldInfo)
- **返回** - **返回**
- dict[str, Any] - dict[str, Any]
## _def_ `model_fields(model)` {#model-fields} ## _def_ `model_fields(model)` {#model-fields}
@@ -134,11 +126,9 @@ description: nonebot.compat 模块
- **说明:** Get field list of a model. - **说明:** Get field list of a model.
- **参数** - **参数**
- `model` (type[BaseModel]) - `model` (type[BaseModel])
- **返回** - **返回**
- list[ModelField] - list[ModelField]
## _def_ `model_config(model)` {#model-config} ## _def_ `model_config(model)` {#model-config}
@@ -146,17 +136,14 @@ description: nonebot.compat 模块
- **说明:** Get config of a model. - **说明:** Get config of a model.
- **参数** - **参数**
- `model` (type[BaseModel]) - `model` (type[BaseModel])
- **返回** - **返回**
- Any - Any
## _def_ `model_dump(model, include=None, exclude=None, by_alias=False, exclude_unset=False, exclude_defaults=False, exclude_none=False)` {#model-dump} ## _def_ `model_dump(model, include=None, exclude=None, by_alias=False, exclude_unset=False, exclude_defaults=False, exclude_none=False)` {#model-dump}
- **参数** - **参数**
- `model` (BaseModel) - `model` (BaseModel)
- `include` (set[str] | None) - `include` (set[str] | None)
@@ -172,7 +159,6 @@ description: nonebot.compat 模块
- `exclude_none` (bool) - `exclude_none` (bool)
- **返回** - **返回**
- dict[str, Any] - dict[str, Any]
## _def_ `type_validate_python(type_, data)` {#type-validate-python} ## _def_ `type_validate_python(type_, data)` {#type-validate-python}
@@ -180,13 +166,11 @@ description: nonebot.compat 模块
- **说明:** Validate data with given type. - **说明:** Validate data with given type.
- **参数** - **参数**
- `type_` (type[T]) - `type_` (type[T])
- `data` (Any) - `data` (Any)
- **返回** - **返回**
- T - T
## _def_ `type_validate_json(type_, data)` {#type-validate-json} ## _def_ `type_validate_json(type_, data)` {#type-validate-json}
@@ -194,13 +178,11 @@ description: nonebot.compat 模块
- **说明:** Validate JSON with given type. - **说明:** Validate JSON with given type.
- **参数** - **参数**
- `type_` (type[T]) - `type_` (type[T])
- `data` (str | bytes) - `data` (str | bytes)
- **返回** - **返回**
- T - T
## _def_ `custom_validation(class_)` {#custom-validation} ## _def_ `custom_validation(class_)` {#custom-validation}
@@ -208,9 +190,7 @@ description: nonebot.compat 模块
- **说明:** Use pydantic v1 like validator generator in pydantic v2 - **说明:** Use pydantic v1 like validator generator in pydantic v2
- **参数** - **参数**
- `class_` (type[CVC]) - `class_` (type[CVC])
- **返回** - **返回**
- type[CVC] - type[CVC]

View File

@@ -24,7 +24,6 @@ NoneBot 使用 [`pydantic`](https://pydantic-docs.helpmanual.io/) 以及
将会从 **环境变量** > **dotenv 配置文件** 的优先级读取环境信息。 将会从 **环境变量** > **dotenv 配置文件** 的优先级读取环境信息。
- **参数** - **参数**
- `_env_file` (DOTENV_TYPE | None) - `_env_file` (DOTENV_TYPE | None)
- `_env_file_encoding` (str | None) - `_env_file_encoding` (str | None)
@@ -55,7 +54,6 @@ NoneBot 使用 [`pydantic`](https://pydantic-docs.helpmanual.io/) 以及
配置方法参考: [配置](https://nonebot.dev/docs/appendices/config) 配置方法参考: [配置](https://nonebot.dev/docs/appendices/config)
- **参数** - **参数**
- `_env_file` (DOTENV_TYPE | None) - `_env_file` (DOTENV_TYPE | None)
- `_env_file_encoding` (str | None) - `_env_file_encoding` (str | None)

View File

@@ -18,7 +18,6 @@ description: nonebot.dependencies 模块
继承自 `pydantic.fields.FieldInfo`,用于描述参数信息(不包括参数名)。 继承自 `pydantic.fields.FieldInfo`,用于描述参数信息(不包括参数名)。
- **参数** - **参数**
- `*args` - `*args`
- `validate` (bool) - `validate` (bool)
@@ -30,7 +29,6 @@ description: nonebot.dependencies 模块
- **说明:** 依赖注入容器 - **说明:** 依赖注入容器
- **参数** - **参数**
- `call`: 依赖注入的可调用对象,可以是任何 Callable 对象 - `call`: 依赖注入的可调用对象,可以是任何 Callable 对象
- `pre_checkers`: 依赖注入解析前的参数检查 - `pre_checkers`: 依赖注入解析前的参数检查
@@ -44,31 +42,26 @@ description: nonebot.dependencies 模块
### _staticmethod_ `parse_params(call, allow_types)` {#Dependent-parse-params} ### _staticmethod_ `parse_params(call, allow_types)` {#Dependent-parse-params}
- **参数** - **参数**
- `call` (\_DependentCallable[R]) - `call` (\_DependentCallable[R])
- `allow_types` (tuple[type[Param], ...]) - `allow_types` (tuple[type[Param], ...])
- **返回** - **返回**
- tuple[[ModelField](../compat.md#ModelField), ...] - tuple[[ModelField](../compat.md#ModelField), ...]
### _staticmethod_ `parse_parameterless(parameterless, allow_types)` {#Dependent-parse-parameterless} ### _staticmethod_ `parse_parameterless(parameterless, allow_types)` {#Dependent-parse-parameterless}
- **参数** - **参数**
- `parameterless` (tuple[Any, ...]) - `parameterless` (tuple[Any, ...])
- `allow_types` (tuple[type[Param], ...]) - `allow_types` (tuple[type[Param], ...])
- **返回** - **返回**
- tuple[Param, ...] - tuple[Param, ...]
### _classmethod_ `parse(*, call, parameterless=None, allow_types)` {#Dependent-parse} ### _classmethod_ `parse(*, call, parameterless=None, allow_types)` {#Dependent-parse}
- **参数** - **参数**
- `call` (\_DependentCallable[R]) - `call` (\_DependentCallable[R])
- `parameterless` (Iterable[Any] | None) - `parameterless` (Iterable[Any] | None)
@@ -76,25 +69,20 @@ description: nonebot.dependencies 模块
- `allow_types` (Iterable[type[Param]]) - `allow_types` (Iterable[type[Param]])
- **返回** - **返回**
- Dependent[R] - Dependent[R]
### _async method_ `check(**params)` {#Dependent-check} ### _async method_ `check(**params)` {#Dependent-check}
- **参数** - **参数**
- `**params` (Any) - `**params` (Any)
- **返回** - **返回**
- None - None
### _async method_ `solve(**params)` {#Dependent-solve} ### _async method_ `solve(**params)` {#Dependent-solve}
- **参数** - **参数**
- `**params` (Any) - `**params` (Any)
- **返回** - **返回**
- dict[str, Any] - dict[str, Any]

View File

@@ -12,11 +12,9 @@ description: nonebot.dependencies.utils 模块
- **说明:** 获取可调用对象签名 - **说明:** 获取可调用对象签名
- **参数** - **参数**
- `call` ((...) -> Any) - `call` ((...) -> Any)
- **返回** - **返回**
- inspect.Signature - inspect.Signature
## _def_ `get_typed_annotation(param, globalns)` {#get-typed-annotation} ## _def_ `get_typed_annotation(param, globalns)` {#get-typed-annotation}
@@ -24,13 +22,11 @@ description: nonebot.dependencies.utils 模块
- **说明:** 获取参数的类型注解 - **说明:** 获取参数的类型注解
- **参数** - **参数**
- `param` (inspect.Parameter) - `param` (inspect.Parameter)
- `globalns` (dict[str, Any]) - `globalns` (dict[str, Any])
- **返回** - **返回**
- Any - Any
## _def_ `check_field_type(field, value)` {#check-field-type} ## _def_ `check_field_type(field, value)` {#check-field-type}
@@ -38,11 +34,9 @@ description: nonebot.dependencies.utils 模块
- **说明:** 检查字段类型是否匹配 - **说明:** 检查字段类型是否匹配
- **参数** - **参数**
- `field` ([ModelField](../compat.md#ModelField)) - `field` ([ModelField](../compat.md#ModelField))
- `value` (Any) - `value` (Any)
- **返回** - **返回**
- Any - Any

View File

@@ -22,7 +22,6 @@ pip install nonebot2[aiohttp]
## _class_ `Session(params=None, headers=None, cookies=None, version=HTTPVersion.H11, timeout=None, proxy=None)` {#Session} ## _class_ `Session(params=None, headers=None, cookies=None, version=HTTPVersion.H11, timeout=None, proxy=None)` {#Session}
- **参数** - **参数**
- `params` (QueryTypes) - `params` (QueryTypes)
- `headers` (HeaderTypes) - `headers` (HeaderTypes)
@@ -38,11 +37,9 @@ pip install nonebot2[aiohttp]
### _async method_ `request(setup)` {#Session-request} ### _async method_ `request(setup)` {#Session-request}
- **参数** - **参数**
- `setup` ([Request](index.md#Request)) - `setup` ([Request](index.md#Request))
- **返回** - **返回**
- [Response](index.md#Response) - [Response](index.md#Response)
### _async method_ `setup()` {#Session-setup} ### _async method_ `setup()` {#Session-setup}
@@ -52,7 +49,6 @@ pip install nonebot2[aiohttp]
empty empty
- **返回** - **返回**
- None - None
### _async method_ `close()` {#Session-close} ### _async method_ `close()` {#Session-close}
@@ -62,7 +58,6 @@ pip install nonebot2[aiohttp]
empty empty
- **返回** - **返回**
- None - None
## _class_ `Mixin(<auto>)` {#Mixin} ## _class_ `Mixin(<auto>)` {#Mixin}
@@ -76,27 +71,22 @@ pip install nonebot2[aiohttp]
### _async method_ `request(setup)` {#Mixin-request} ### _async method_ `request(setup)` {#Mixin-request}
- **参数** - **参数**
- `setup` ([Request](index.md#Request)) - `setup` ([Request](index.md#Request))
- **返回** - **返回**
- [Response](index.md#Response) - [Response](index.md#Response)
### _method_ `websocket(setup)` {#Mixin-websocket} ### _method_ `websocket(setup)` {#Mixin-websocket}
- **参数** - **参数**
- `setup` ([Request](index.md#Request)) - `setup` ([Request](index.md#Request))
- **返回** - **返回**
- AsyncGenerator[[WebSocket](index.md#WebSocket), None] - AsyncGenerator[[WebSocket](index.md#WebSocket), None]
### _method_ `get_session(params=None, headers=None, cookies=None, version=HTTPVersion.H11, timeout=None, proxy=None)` {#Mixin-get-session} ### _method_ `get_session(params=None, headers=None, cookies=None, version=HTTPVersion.H11, timeout=None, proxy=None)` {#Mixin-get-session}
- **参数** - **参数**
- `params` (QueryTypes) - `params` (QueryTypes)
- `headers` (HeaderTypes) - `headers` (HeaderTypes)
@@ -110,7 +100,6 @@ pip install nonebot2[aiohttp]
- `proxy` (str | None) - `proxy` (str | None)
- **返回** - **返回**
- Session - Session
## _class_ `WebSocket(*, request, session, websocket)` {#WebSocket} ## _class_ `WebSocket(*, request, session, websocket)` {#WebSocket}
@@ -118,7 +107,6 @@ pip install nonebot2[aiohttp]
- **说明:** AIOHTTP Websocket Wrapper - **说明:** AIOHTTP Websocket Wrapper
- **参数** - **参数**
- `request` ([Request](index.md#Request)) - `request` ([Request](index.md#Request))
- `session` (aiohttp.ClientSession) - `session` (aiohttp.ClientSession)
@@ -132,19 +120,16 @@ pip install nonebot2[aiohttp]
empty empty
- **返回** - **返回**
- untyped - untyped
### _async method_ `close(code=1000, reason="")` {#WebSocket-close} ### _async method_ `close(code=1000, reason="")` {#WebSocket-close}
- **参数** - **参数**
- `code` (int) - `code` (int)
- `reason` (str) - `reason` (str)
- **返回** - **返回**
- untyped - untyped
### _async method_ `receive()` {#WebSocket-receive} ### _async method_ `receive()` {#WebSocket-receive}
@@ -154,7 +139,6 @@ pip install nonebot2[aiohttp]
empty empty
- **返回** - **返回**
- str - str
### _async method_ `receive_text()` {#WebSocket-receive-text} ### _async method_ `receive_text()` {#WebSocket-receive-text}
@@ -164,7 +148,6 @@ pip install nonebot2[aiohttp]
empty empty
- **返回** - **返回**
- str - str
### _async method_ `receive_bytes()` {#WebSocket-receive-bytes} ### _async method_ `receive_bytes()` {#WebSocket-receive-bytes}
@@ -174,33 +157,27 @@ pip install nonebot2[aiohttp]
empty empty
- **返回** - **返回**
- bytes - bytes
### _async method_ `send_text(data)` {#WebSocket-send-text} ### _async method_ `send_text(data)` {#WebSocket-send-text}
- **参数** - **参数**
- `data` (str) - `data` (str)
- **返回** - **返回**
- None - None
### _async method_ `send_bytes(data)` {#WebSocket-send-bytes} ### _async method_ `send_bytes(data)` {#WebSocket-send-bytes}
- **参数** - **参数**
- `data` (bytes) - `data` (bytes)
- **返回** - **返回**
- None - None
## _class_ `Driver(env, config)` {#Driver} ## _class_ `Driver(env, config)` {#Driver}
- **参数** - **参数**
- `env` ([Env](../config.md#Env)) - `env` ([Env](../config.md#Env))
- `config` ([Config](../config.md#Config)) - `config` ([Config](../config.md#Config))

View File

@@ -92,7 +92,6 @@ pip install nonebot2[fastapi]
- **说明:** FastAPI 驱动框架。 - **说明:** FastAPI 驱动框架。
- **参数** - **参数**
- `env` ([Env](../config.md#Env)) - `env` ([Env](../config.md#Env))
- `config` (NoneBotConfig) - `config` (NoneBotConfig)
@@ -124,21 +123,17 @@ pip install nonebot2[fastapi]
### _method_ `setup_http_server(setup)` {#Driver-setup-http-server} ### _method_ `setup_http_server(setup)` {#Driver-setup-http-server}
- **参数** - **参数**
- `setup` ([HTTPServerSetup](index.md#HTTPServerSetup)) - `setup` ([HTTPServerSetup](index.md#HTTPServerSetup))
- **返回** - **返回**
- untyped - untyped
### _method_ `setup_websocket_server(setup)` {#Driver-setup-websocket-server} ### _method_ `setup_websocket_server(setup)` {#Driver-setup-websocket-server}
- **参数** - **参数**
- `setup` ([WebSocketServerSetup](index.md#WebSocketServerSetup)) - `setup` ([WebSocketServerSetup](index.md#WebSocketServerSetup))
- **返回** - **返回**
- None - None
### _method_ `run(host=None, port=None, *args, app=None, **kwargs)` {#Driver-run} ### _method_ `run(host=None, port=None, *args, app=None, **kwargs)` {#Driver-run}
@@ -146,7 +141,6 @@ pip install nonebot2[fastapi]
- **说明:** 使用 `uvicorn` 启动 FastAPI - **说明:** 使用 `uvicorn` 启动 FastAPI
- **参数** - **参数**
- `host` (str | None) - `host` (str | None)
- `port` (int | None) - `port` (int | None)
@@ -158,7 +152,6 @@ pip install nonebot2[fastapi]
- `**kwargs` - `**kwargs`
- **返回** - **返回**
- untyped - untyped
## _class_ `FastAPIWebSocket(*, request, websocket)` {#FastAPIWebSocket} ## _class_ `FastAPIWebSocket(*, request, websocket)` {#FastAPIWebSocket}
@@ -166,7 +159,6 @@ pip install nonebot2[fastapi]
- **说明:** FastAPI WebSocket Wrapper - **说明:** FastAPI WebSocket Wrapper
- **参数** - **参数**
- `request` (BaseRequest) - `request` (BaseRequest)
- `websocket` ([WebSocket](index.md#WebSocket)) - `websocket` ([WebSocket](index.md#WebSocket))
@@ -178,19 +170,16 @@ pip install nonebot2[fastapi]
empty empty
- **返回** - **返回**
- None - None
### _async method_ `close(code=status.WS_1000_NORMAL_CLOSURE, reason="")` {#FastAPIWebSocket-close} ### _async method_ `close(code=status.WS_1000_NORMAL_CLOSURE, reason="")` {#FastAPIWebSocket-close}
- **参数** - **参数**
- `code` (int) - `code` (int)
- `reason` (str) - `reason` (str)
- **返回** - **返回**
- None - None
### _async method_ `receive()` {#FastAPIWebSocket-receive} ### _async method_ `receive()` {#FastAPIWebSocket-receive}
@@ -200,7 +189,6 @@ pip install nonebot2[fastapi]
empty empty
- **返回** - **返回**
- str | bytes - str | bytes
### _async method_ `receive_text()` {#FastAPIWebSocket-receive-text} ### _async method_ `receive_text()` {#FastAPIWebSocket-receive-text}
@@ -210,7 +198,6 @@ pip install nonebot2[fastapi]
empty empty
- **返回** - **返回**
- str - str
### _async method_ `receive_bytes()` {#FastAPIWebSocket-receive-bytes} ### _async method_ `receive_bytes()` {#FastAPIWebSocket-receive-bytes}
@@ -220,25 +207,20 @@ pip install nonebot2[fastapi]
empty empty
- **返回** - **返回**
- bytes - bytes
### _async method_ `send_text(data)` {#FastAPIWebSocket-send-text} ### _async method_ `send_text(data)` {#FastAPIWebSocket-send-text}
- **参数** - **参数**
- `data` (str) - `data` (str)
- **返回** - **返回**
- None - None
### _async method_ `send_bytes(data)` {#FastAPIWebSocket-send-bytes} ### _async method_ `send_bytes(data)` {#FastAPIWebSocket-send-bytes}
- **参数** - **参数**
- `data` (bytes) - `data` (bytes)
- **返回** - **返回**
- None - None

View File

@@ -22,7 +22,6 @@ pip install nonebot2[httpx]
## _class_ `Session(params=None, headers=None, cookies=None, version=HTTPVersion.H11, timeout=None, proxy=None)` {#Session} ## _class_ `Session(params=None, headers=None, cookies=None, version=HTTPVersion.H11, timeout=None, proxy=None)` {#Session}
- **参数** - **参数**
- `params` (QueryTypes) - `params` (QueryTypes)
- `headers` (HeaderTypes) - `headers` (HeaderTypes)
@@ -38,11 +37,9 @@ pip install nonebot2[httpx]
### _async method_ `request(setup)` {#Session-request} ### _async method_ `request(setup)` {#Session-request}
- **参数** - **参数**
- `setup` ([Request](index.md#Request)) - `setup` ([Request](index.md#Request))
- **返回** - **返回**
- [Response](index.md#Response) - [Response](index.md#Response)
### _async method_ `setup()` {#Session-setup} ### _async method_ `setup()` {#Session-setup}
@@ -52,7 +49,6 @@ pip install nonebot2[httpx]
empty empty
- **返回** - **返回**
- None - None
### _async method_ `close()` {#Session-close} ### _async method_ `close()` {#Session-close}
@@ -62,7 +58,6 @@ pip install nonebot2[httpx]
empty empty
- **返回** - **返回**
- None - None
## _class_ `Mixin(<auto>)` {#Mixin} ## _class_ `Mixin(<auto>)` {#Mixin}
@@ -76,17 +71,14 @@ pip install nonebot2[httpx]
### _async method_ `request(setup)` {#Mixin-request} ### _async method_ `request(setup)` {#Mixin-request}
- **参数** - **参数**
- `setup` ([Request](index.md#Request)) - `setup` ([Request](index.md#Request))
- **返回** - **返回**
- [Response](index.md#Response) - [Response](index.md#Response)
### _method_ `get_session(params=None, headers=None, cookies=None, version=HTTPVersion.H11, timeout=None, proxy=None)` {#Mixin-get-session} ### _method_ `get_session(params=None, headers=None, cookies=None, version=HTTPVersion.H11, timeout=None, proxy=None)` {#Mixin-get-session}
- **参数** - **参数**
- `params` (QueryTypes) - `params` (QueryTypes)
- `headers` (HeaderTypes) - `headers` (HeaderTypes)
@@ -100,13 +92,11 @@ pip install nonebot2[httpx]
- `proxy` (str | None) - `proxy` (str | None)
- **返回** - **返回**
- Session - Session
## _class_ `Driver(env, config)` {#Driver} ## _class_ `Driver(env, config)` {#Driver}
- **参数** - **参数**
- `env` ([Env](../config.md#Env)) - `env` ([Env](../config.md#Env))
- `config` ([Config](../config.md#Config)) - `config` ([Config](../config.md#Config))

View File

@@ -40,11 +40,9 @@ description: nonebot.drivers 模块
- **说明:** 设置一个 HTTP 服务器路由配置 - **说明:** 设置一个 HTTP 服务器路由配置
- **参数** - **参数**
- `setup` ([HTTPServerSetup](#HTTPServerSetup)) - `setup` ([HTTPServerSetup](#HTTPServerSetup))
- **返回** - **返回**
- None - None
### _abstract method_ `setup_websocket_server(setup)` {#ASGIMixin-setup-websocket-server} ### _abstract method_ `setup_websocket_server(setup)` {#ASGIMixin-setup-websocket-server}
@@ -52,23 +50,19 @@ description: nonebot.drivers 模块
- **说明:** 设置一个 WebSocket 服务器路由配置 - **说明:** 设置一个 WebSocket 服务器路由配置
- **参数** - **参数**
- `setup` ([WebSocketServerSetup](#WebSocketServerSetup)) - `setup` ([WebSocketServerSetup](#WebSocketServerSetup))
- **返回** - **返回**
- None - None
## _class_ `Cookies(cookies=None)` {#Cookies} ## _class_ `Cookies(cookies=None)` {#Cookies}
- **参数** - **参数**
- `cookies` (CookieTypes) - `cookies` (CookieTypes)
### _method_ `set(name, value, domain="", path="/")` {#Cookies-set} ### _method_ `set(name, value, domain="", path="/")` {#Cookies-set}
- **参数** - **参数**
- `name` (str) - `name` (str)
- `value` (str) - `value` (str)
@@ -78,13 +72,11 @@ description: nonebot.drivers 模块
- `path` (str) - `path` (str)
- **返回** - **返回**
- None - None
### _method_ `get(name, default=None, domain=None, path=None)` {#Cookies-get} ### _method_ `get(name, default=None, domain=None, path=None)` {#Cookies-get}
- **参数** - **参数**
- `name` (str) - `name` (str)
- `default` (str | None) - `default` (str | None)
@@ -94,13 +86,11 @@ description: nonebot.drivers 模块
- `path` (str | None) - `path` (str | None)
- **返回** - **返回**
- str | None - str | None
### _method_ `delete(name, domain=None, path=None)` {#Cookies-delete} ### _method_ `delete(name, domain=None, path=None)` {#Cookies-delete}
- **参数** - **参数**
- `name` (str) - `name` (str)
- `domain` (str | None) - `domain` (str | None)
@@ -108,39 +98,32 @@ description: nonebot.drivers 模块
- `path` (str | None) - `path` (str | None)
- **返回** - **返回**
- None - None
### _method_ `clear(domain=None, path=None)` {#Cookies-clear} ### _method_ `clear(domain=None, path=None)` {#Cookies-clear}
- **参数** - **参数**
- `domain` (str | None) - `domain` (str | None)
- `path` (str | None) - `path` (str | None)
- **返回** - **返回**
- None - None
### _method_ `update(cookies=None)` {#Cookies-update} ### _method_ `update(cookies=None)` {#Cookies-update}
- **参数** - **参数**
- `cookies` (CookieTypes) - `cookies` (CookieTypes)
- **返回** - **返回**
- None - None
### _method_ `as_header(request)` {#Cookies-as-header} ### _method_ `as_header(request)` {#Cookies-as-header}
- **参数** - **参数**
- `request` (Request) - `request` (Request)
- **返回** - **返回**
- dict[str, str] - dict[str, str]
## _abstract class_ `Driver(env, config)` {#Driver} ## _abstract class_ `Driver(env, config)` {#Driver}
@@ -152,7 +135,6 @@ description: nonebot.drivers 模块
驱动器控制框架的启动和停止,适配器的注册,以及机器人生命周期管理。 驱动器控制框架的启动和停止,适配器的注册,以及机器人生命周期管理。
- **参数** - **参数**
- `env` ([Env](../config.md#Env)): 包含环境信息的 Env 对象 - `env` ([Env](../config.md#Env)): 包含环境信息的 Env 对象
- `config` ([Config](../config.md#Config)): 包含配置信息的 Config 对象 - `config` ([Config](../config.md#Config)): 包含配置信息的 Config 对象
@@ -180,13 +162,11 @@ description: nonebot.drivers 模块
- **说明:** 注册一个协议适配器 - **说明:** 注册一个协议适配器
- **参数** - **参数**
- `adapter` (type[[Adapter](../adapters/index.md#Adapter)]): 适配器类 - `adapter` (type[[Adapter](../adapters/index.md#Adapter)]): 适配器类
- `**kwargs`: 其他传递给适配器的参数 - `**kwargs`: 其他传递给适配器的参数
- **返回** - **返回**
- None - None
### _abstract property_ `type` {#Driver-type} ### _abstract property_ `type` {#Driver-type}
@@ -206,13 +186,11 @@ description: nonebot.drivers 模块
- **说明:** 启动驱动框架 - **说明:** 启动驱动框架
- **参数** - **参数**
- `*args` - `*args`
- `**kwargs` - `**kwargs`
- **返回** - **返回**
- untyped - untyped
### _method_ `on_startup(func)` {#Driver-on-startup} ### _method_ `on_startup(func)` {#Driver-on-startup}
@@ -220,11 +198,9 @@ description: nonebot.drivers 模块
- **说明:** 注册一个启动时执行的函数 - **说明:** 注册一个启动时执行的函数
- **参数** - **参数**
- `func` (LIFESPAN_FUNC) - `func` (LIFESPAN_FUNC)
- **返回** - **返回**
- LIFESPAN_FUNC - LIFESPAN_FUNC
### _method_ `on_shutdown(func)` {#Driver-on-shutdown} ### _method_ `on_shutdown(func)` {#Driver-on-shutdown}
@@ -232,11 +208,9 @@ description: nonebot.drivers 模块
- **说明:** 注册一个停止时执行的函数 - **说明:** 注册一个停止时执行的函数
- **参数** - **参数**
- `func` (LIFESPAN_FUNC) - `func` (LIFESPAN_FUNC)
- **返回** - **返回**
- LIFESPAN_FUNC - LIFESPAN_FUNC
### _classmethod_ `on_bot_connect(func)` {#Driver-on-bot-connect} ### _classmethod_ `on_bot_connect(func)` {#Driver-on-bot-connect}
@@ -246,15 +220,12 @@ description: nonebot.drivers 模块
装饰一个函数使他在 bot 连接成功时执行。 装饰一个函数使他在 bot 连接成功时执行。
钩子函数参数: 钩子函数参数:
- bot: 当前连接上的 Bot 对象 - bot: 当前连接上的 Bot 对象
- **参数** - **参数**
- `func` ([T_BotConnectionHook](../typing.md#T-BotConnectionHook)) - `func` ([T_BotConnectionHook](../typing.md#T-BotConnectionHook))
- **返回** - **返回**
- [T_BotConnectionHook](../typing.md#T-BotConnectionHook) - [T_BotConnectionHook](../typing.md#T-BotConnectionHook)
### _classmethod_ `on_bot_disconnect(func)` {#Driver-on-bot-disconnect} ### _classmethod_ `on_bot_disconnect(func)` {#Driver-on-bot-disconnect}
@@ -264,15 +235,12 @@ description: nonebot.drivers 模块
装饰一个函数使他在 bot 连接断开时执行。 装饰一个函数使他在 bot 连接断开时执行。
钩子函数参数: 钩子函数参数:
- bot: 当前连接上的 Bot 对象 - bot: 当前连接上的 Bot 对象
- **参数** - **参数**
- `func` ([T_BotDisconnectionHook](../typing.md#T-BotDisconnectionHook)) - `func` ([T_BotDisconnectionHook](../typing.md#T-BotDisconnectionHook))
- **返回** - **返回**
- [T_BotDisconnectionHook](../typing.md#T-BotDisconnectionHook) - [T_BotDisconnectionHook](../typing.md#T-BotDisconnectionHook)
## _var_ `ForwardDriver` {#ForwardDriver} ## _var_ `ForwardDriver` {#ForwardDriver}
@@ -306,11 +274,9 @@ description: nonebot.drivers 模块
- **说明:** 发送一个 HTTP 请求 - **说明:** 发送一个 HTTP 请求
- **参数** - **参数**
- `setup` ([Request](#Request)) - `setup` ([Request](#Request))
- **返回** - **返回**
- [Response](#Response) - [Response](#Response)
### _abstract method_ `get_session(params=None, headers=None, cookies=None, version=HTTPVersion.H11, timeout=None, proxy=None)` {#HTTPClientMixin-get-session} ### _abstract method_ `get_session(params=None, headers=None, cookies=None, version=HTTPVersion.H11, timeout=None, proxy=None)` {#HTTPClientMixin-get-session}
@@ -318,7 +284,6 @@ description: nonebot.drivers 模块
- **说明:** 获取一个 HTTP 会话 - **说明:** 获取一个 HTTP 会话
- **参数** - **参数**
- `params` (QueryTypes) - `params` (QueryTypes)
- `headers` (HeaderTypes) - `headers` (HeaderTypes)
@@ -332,7 +297,6 @@ description: nonebot.drivers 模块
- `proxy` (str | None) - `proxy` (str | None)
- **返回** - **返回**
- HTTPClientSession - HTTPClientSession
## _class_ `HTTPServerSetup(<auto>)` {#HTTPServerSetup} ## _class_ `HTTPServerSetup(<auto>)` {#HTTPServerSetup}
@@ -350,7 +314,6 @@ description: nonebot.drivers 模块
- **参数** - **参数**
auto auto
- `H10: '1.0'` - `H10: '1.0'`
- `H11: '1.1'` - `H11: '1.1'`
@@ -374,7 +337,6 @@ description: nonebot.drivers 模块
## _class_ `Request(method, url, *, params=None, headers=None, cookies=None, content=None, data=None, json=None, files=None, version=HTTPVersion.H11, timeout=None, proxy=None)` {#Request} ## _class_ `Request(method, url, *, params=None, headers=None, cookies=None, content=None, data=None, json=None, files=None, version=HTTPVersion.H11, timeout=None, proxy=None)` {#Request}
- **参数** - **参数**
- `method` (str | bytes) - `method` (str | bytes)
- `url` (URL | str | RawURL) - `url` (URL | str | RawURL)
@@ -402,7 +364,6 @@ description: nonebot.drivers 模块
## _class_ `Response(status_code, *, headers=None, content=None, request=None)` {#Response} ## _class_ `Response(status_code, *, headers=None, content=None, request=None)` {#Response}
- **参数** - **参数**
- `status_code` (int) - `status_code` (int)
- `headers` (HeaderTypes) - `headers` (HeaderTypes)
@@ -432,7 +393,6 @@ description: nonebot.drivers 模块
## _abstract class_ `WebSocket(*, request)` {#WebSocket} ## _abstract class_ `WebSocket(*, request)` {#WebSocket}
- **参数** - **参数**
- `request` (Request) - `request` (Request)
### _abstract property_ `closed` {#WebSocket-closed} ### _abstract property_ `closed` {#WebSocket-closed}
@@ -450,7 +410,6 @@ description: nonebot.drivers 模块
empty empty
- **返回** - **返回**
- None - None
### _abstract async method_ `close(code=1000, reason="")` {#WebSocket-close} ### _abstract async method_ `close(code=1000, reason="")` {#WebSocket-close}
@@ -458,13 +417,11 @@ description: nonebot.drivers 模块
- **说明:** 关闭 WebSocket 连接请求 - **说明:** 关闭 WebSocket 连接请求
- **参数** - **参数**
- `code` (int) - `code` (int)
- `reason` (str) - `reason` (str)
- **返回** - **返回**
- None - None
### _abstract async method_ `receive()` {#WebSocket-receive} ### _abstract async method_ `receive()` {#WebSocket-receive}
@@ -476,7 +433,6 @@ description: nonebot.drivers 模块
empty empty
- **返回** - **返回**
- str | bytes - str | bytes
### _abstract async method_ `receive_text()` {#WebSocket-receive-text} ### _abstract async method_ `receive_text()` {#WebSocket-receive-text}
@@ -488,7 +444,6 @@ description: nonebot.drivers 模块
empty empty
- **返回** - **返回**
- str - str
### _abstract async method_ `receive_bytes()` {#WebSocket-receive-bytes} ### _abstract async method_ `receive_bytes()` {#WebSocket-receive-bytes}
@@ -500,7 +455,6 @@ description: nonebot.drivers 模块
empty empty
- **返回** - **返回**
- bytes - bytes
### _async method_ `send(data)` {#WebSocket-send} ### _async method_ `send(data)` {#WebSocket-send}
@@ -508,11 +462,9 @@ description: nonebot.drivers 模块
- **说明:** 发送一条 WebSocket text/bytes 信息 - **说明:** 发送一条 WebSocket text/bytes 信息
- **参数** - **参数**
- `data` (str | bytes) - `data` (str | bytes)
- **返回** - **返回**
- None - None
### _abstract async method_ `send_text(data)` {#WebSocket-send-text} ### _abstract async method_ `send_text(data)` {#WebSocket-send-text}
@@ -520,11 +472,9 @@ description: nonebot.drivers 模块
- **说明:** 发送一条 WebSocket text 信息 - **说明:** 发送一条 WebSocket text 信息
- **参数** - **参数**
- `data` (str) - `data` (str)
- **返回** - **返回**
- None - None
### _abstract async method_ `send_bytes(data)` {#WebSocket-send-bytes} ### _abstract async method_ `send_bytes(data)` {#WebSocket-send-bytes}
@@ -532,11 +482,9 @@ description: nonebot.drivers 模块
- **说明:** 发送一条 WebSocket binary 信息 - **说明:** 发送一条 WebSocket binary 信息
- **参数** - **参数**
- `data` (bytes) - `data` (bytes)
- **返回** - **返回**
- None - None
## _abstract class_ `WebSocketClientMixin(<auto>)` {#WebSocketClientMixin} ## _abstract class_ `WebSocketClientMixin(<auto>)` {#WebSocketClientMixin}
@@ -552,11 +500,9 @@ description: nonebot.drivers 模块
- **说明:** 发起一个 WebSocket 连接 - **说明:** 发起一个 WebSocket 连接
- **参数** - **参数**
- `setup` ([Request](#Request)) - `setup` ([Request](#Request))
- **返回** - **返回**
- AsyncGenerator[[WebSocket](#WebSocket), None] - AsyncGenerator[[WebSocket](#WebSocket), None]
## _class_ `WebSocketServerSetup(<auto>)` {#WebSocketServerSetup} ## _class_ `WebSocketServerSetup(<auto>)` {#WebSocketServerSetup}
@@ -574,19 +520,14 @@ description: nonebot.drivers 模块
- **重载** - **重载**
**1.** `(driver) -> type[D]` **1.** `(driver) -> type[D]`
- **参数** - **参数**
- `driver` (type[D]) - `driver` (type[D])
- **返回** - **返回**
- type[D] - type[D]
**2.** `(driver, __m, /, *mixins) -> type[CombinedDriver]` **2.** `(driver, __m, /, *mixins) -> type[CombinedDriver]`
- **参数** - **参数**
- `driver` (type[D]) - `driver` (type[D])
- `__m` (type[[Mixin](#Mixin)]) - `__m` (type[[Mixin](#Mixin)])
@@ -594,5 +535,4 @@ description: nonebot.drivers 模块
- `*mixins` (type[[Mixin](#Mixin)]) - `*mixins` (type[[Mixin](#Mixin)])
- **返回** - **返回**
- type[CombinedDriver] - type[CombinedDriver]

View File

@@ -18,7 +18,6 @@ None 驱动适配
- **说明:** None 驱动框架 - **说明:** None 驱动框架
- **参数** - **参数**
- `env` ([Env](../config.md#Env)) - `env` ([Env](../config.md#Env))
- `config` ([Config](../config.md#Config)) - `config` ([Config](../config.md#Config))
@@ -40,13 +39,11 @@ None 驱动适配
- **说明:** 启动 none driver - **说明:** 启动 none driver
- **参数** - **参数**
- `*args` - `*args`
- `**kwargs` - `**kwargs`
- **返回** - **返回**
- untyped - untyped
### _method_ `exit(force=False)` {#Driver-exit} ### _method_ `exit(force=False)` {#Driver-exit}
@@ -54,9 +51,7 @@ None 驱动适配
- **说明:** 退出 none driver - **说明:** 退出 none driver
- **参数** - **参数**
- `force` (bool): 强制退出 - `force` (bool): 强制退出
- **返回** - **返回**
- untyped - untyped

View File

@@ -68,7 +68,6 @@ pip install nonebot2[quart]
- **说明:** Quart 驱动框架 - **说明:** Quart 驱动框架
- **参数** - **参数**
- `env` ([Env](../config.md#Env)) - `env` ([Env](../config.md#Env))
- `config` (NoneBotConfig) - `config` (NoneBotConfig)
@@ -100,21 +99,17 @@ pip install nonebot2[quart]
### _method_ `setup_http_server(setup)` {#Driver-setup-http-server} ### _method_ `setup_http_server(setup)` {#Driver-setup-http-server}
- **参数** - **参数**
- `setup` ([HTTPServerSetup](index.md#HTTPServerSetup)) - `setup` ([HTTPServerSetup](index.md#HTTPServerSetup))
- **返回** - **返回**
- untyped - untyped
### _method_ `setup_websocket_server(setup)` {#Driver-setup-websocket-server} ### _method_ `setup_websocket_server(setup)` {#Driver-setup-websocket-server}
- **参数** - **参数**
- `setup` ([WebSocketServerSetup](index.md#WebSocketServerSetup)) - `setup` ([WebSocketServerSetup](index.md#WebSocketServerSetup))
- **返回** - **返回**
- None - None
### _method_ `run(host=None, port=None, *args, app=None, **kwargs)` {#Driver-run} ### _method_ `run(host=None, port=None, *args, app=None, **kwargs)` {#Driver-run}
@@ -122,7 +117,6 @@ pip install nonebot2[quart]
- **说明:** 使用 `uvicorn` 启动 Quart - **说明:** 使用 `uvicorn` 启动 Quart
- **参数** - **参数**
- `host` (str | None) - `host` (str | None)
- `port` (int | None) - `port` (int | None)
@@ -134,7 +128,6 @@ pip install nonebot2[quart]
- `**kwargs` - `**kwargs`
- **返回** - **返回**
- untyped - untyped
## _class_ `WebSocket(*, request, websocket_ctx)` {#WebSocket} ## _class_ `WebSocket(*, request, websocket_ctx)` {#WebSocket}
@@ -142,7 +135,6 @@ pip install nonebot2[quart]
- **说明:** Quart WebSocket Wrapper - **说明:** Quart WebSocket Wrapper
- **参数** - **参数**
- `request` (BaseRequest) - `request` (BaseRequest)
- `websocket_ctx` (WebsocketContext) - `websocket_ctx` (WebsocketContext)
@@ -154,19 +146,16 @@ pip install nonebot2[quart]
empty empty
- **返回** - **返回**
- untyped - untyped
### _async method_ `close(code=1000, reason="")` {#WebSocket-close} ### _async method_ `close(code=1000, reason="")` {#WebSocket-close}
- **参数** - **参数**
- `code` (int) - `code` (int)
- `reason` (str) - `reason` (str)
- **返回** - **返回**
- untyped - untyped
### _async method_ `receive()` {#WebSocket-receive} ### _async method_ `receive()` {#WebSocket-receive}
@@ -176,7 +165,6 @@ pip install nonebot2[quart]
empty empty
- **返回** - **返回**
- str | bytes - str | bytes
### _async method_ `receive_text()` {#WebSocket-receive-text} ### _async method_ `receive_text()` {#WebSocket-receive-text}
@@ -186,7 +174,6 @@ pip install nonebot2[quart]
empty empty
- **返回** - **返回**
- str - str
### _async method_ `receive_bytes()` {#WebSocket-receive-bytes} ### _async method_ `receive_bytes()` {#WebSocket-receive-bytes}
@@ -196,25 +183,20 @@ pip install nonebot2[quart]
empty empty
- **返回** - **返回**
- bytes - bytes
### _async method_ `send_text(data)` {#WebSocket-send-text} ### _async method_ `send_text(data)` {#WebSocket-send-text}
- **参数** - **参数**
- `data` (str) - `data` (str)
- **返回** - **返回**
- untyped - untyped
### _async method_ `send_bytes(data)` {#WebSocket-send-bytes} ### _async method_ `send_bytes(data)` {#WebSocket-send-bytes}
- **参数** - **参数**
- `data` (bytes) - `data` (bytes)
- **返回** - **返回**
- untyped - untyped

View File

@@ -22,11 +22,9 @@ pip install nonebot2[websockets]
## _def_ `catch_closed(func)` {#catch-closed} ## _def_ `catch_closed(func)` {#catch-closed}
- **参数** - **参数**
- `func` ((P) -> CoroutineType[Any, Any, T]) - `func` ((P) -> CoroutineType[Any, Any, T])
- **返回** - **返回**
- (P) -> CoroutineType[Any, Any, T] - (P) -> CoroutineType[Any, Any, T]
## _class_ `Mixin(<auto>)` {#Mixin} ## _class_ `Mixin(<auto>)` {#Mixin}
@@ -40,11 +38,9 @@ pip install nonebot2[websockets]
### _method_ `websocket(setup)` {#Mixin-websocket} ### _method_ `websocket(setup)` {#Mixin-websocket}
- **参数** - **参数**
- `setup` ([Request](index.md#Request)) - `setup` ([Request](index.md#Request))
- **返回** - **返回**
- AsyncGenerator[[WebSocket](index.md#WebSocket), None] - AsyncGenerator[[WebSocket](index.md#WebSocket), None]
## _class_ `WebSocket(*, request, websocket)` {#WebSocket} ## _class_ `WebSocket(*, request, websocket)` {#WebSocket}
@@ -52,7 +48,6 @@ pip install nonebot2[websockets]
- **说明:** Websockets WebSocket Wrapper - **说明:** Websockets WebSocket Wrapper
- **参数** - **参数**
- `request` ([Request](index.md#Request)) - `request` ([Request](index.md#Request))
- `websocket` (WebSocketClientProtocol) - `websocket` (WebSocketClientProtocol)
@@ -64,19 +59,16 @@ pip install nonebot2[websockets]
empty empty
- **返回** - **返回**
- untyped - untyped
### _async method_ `close(code=1000, reason="")` {#WebSocket-close} ### _async method_ `close(code=1000, reason="")` {#WebSocket-close}
- **参数** - **参数**
- `code` (int) - `code` (int)
- `reason` (str) - `reason` (str)
- **返回** - **返回**
- untyped - untyped
### _async method_ `receive()` {#WebSocket-receive} ### _async method_ `receive()` {#WebSocket-receive}
@@ -86,7 +78,6 @@ pip install nonebot2[websockets]
empty empty
- **返回** - **返回**
- str | bytes - str | bytes
### _async method_ `receive_text()` {#WebSocket-receive-text} ### _async method_ `receive_text()` {#WebSocket-receive-text}
@@ -96,7 +87,6 @@ pip install nonebot2[websockets]
empty empty
- **返回** - **返回**
- str - str
### _async method_ `receive_bytes()` {#WebSocket-receive-bytes} ### _async method_ `receive_bytes()` {#WebSocket-receive-bytes}
@@ -106,33 +96,27 @@ pip install nonebot2[websockets]
empty empty
- **返回** - **返回**
- bytes - bytes
### _async method_ `send_text(data)` {#WebSocket-send-text} ### _async method_ `send_text(data)` {#WebSocket-send-text}
- **参数** - **参数**
- `data` (str) - `data` (str)
- **返回** - **返回**
- None - None
### _async method_ `send_bytes(data)` {#WebSocket-send-bytes} ### _async method_ `send_bytes(data)` {#WebSocket-send-bytes}
- **参数** - **参数**
- `data` (bytes) - `data` (bytes)
- **返回** - **返回**
- None - None
## _class_ `Driver(env, config)` {#Driver} ## _class_ `Driver(env, config)` {#Driver}
- **参数** - **参数**
- `env` ([Env](../config.md#Env)) - `env` ([Env](../config.md#Env))
- `config` ([Config](../config.md#Config)) - `config` ([Config](../config.md#Config))

View File

@@ -62,7 +62,6 @@ NoneBotException
- **说明:** 指示 NoneBot 应该忽略该事件。可由 PreProcessor 抛出。 - **说明:** 指示 NoneBot 应该忽略该事件。可由 PreProcessor 抛出。
- **参数** - **参数**
- `reason`: 忽略事件的原因 - `reason`: 忽略事件的原因
## _class_ `SkippedException(<auto>)` {#SkippedException} ## _class_ `SkippedException(<auto>)` {#SkippedException}
@@ -101,7 +100,6 @@ NoneBotException
- **说明:** 指示 NoneBot 阻止本次 API 调用或修改本次调用返回值,并返回自定义内容。 可由 api hook 抛出。 - **说明:** 指示 NoneBot 阻止本次 API 调用或修改本次调用返回值,并返回自定义内容。 可由 api hook 抛出。
- **参数** - **参数**
- `result`: 返回的内容 - `result`: 返回的内容
## _class_ `StopPropagation(<auto>)` {#StopPropagation} ## _class_ `StopPropagation(<auto>)` {#StopPropagation}
@@ -200,7 +198,6 @@ NoneBotException
- **说明:** 代表 `Adapter` 抛出的异常,所有的 `Adapter` 都要在内部继承自这个 `Exception`。 - **说明:** 代表 `Adapter` 抛出的异常,所有的 `Adapter` 都要在内部继承自这个 `Exception`。
- **参数** - **参数**
- `adapter_name`: 标识 adapter - `adapter_name`: 标识 adapter
## _class_ `NoLogException(<auto>)` {#NoLogException} ## _class_ `NoLogException(<auto>)` {#NoLogException}

View File

@@ -60,11 +60,9 @@ description: nonebot 模块
empty empty
- **返回** - **返回**
- [Driver](drivers/index.md#Driver): 全局 [Driver](drivers/index.md#Driver) 对象 - [Driver](drivers/index.md#Driver): 全局 [Driver](drivers/index.md#Driver) 对象
- **异常** - **异常**
- ValueError: 全局 [Driver](drivers/index.md#Driver) 对象尚未初始化 ([nonebot.init](#init) 尚未调用) - ValueError: 全局 [Driver](drivers/index.md#Driver) 对象尚未初始化 ([nonebot.init](#init) 尚未调用)
- **用法** - **用法**
@@ -80,27 +78,20 @@ description: nonebot 模块
- **重载** - **重载**
**1.** `(name) -> Adapter` **1.** `(name) -> Adapter`
- **参数** - **参数**
- `name` (str): 适配器名称 - `name` (str): 适配器名称
- **返回** - **返回**
- [Adapter](adapters/index.md#Adapter): 指定名称的 [Adapter](adapters/index.md#Adapter) 对象 - [Adapter](adapters/index.md#Adapter): 指定名称的 [Adapter](adapters/index.md#Adapter) 对象
**2.** `(name) -> A` **2.** `(name) -> A`
- **参数** - **参数**
- `name` (type[A]): 适配器类型 - `name` (type[A]): 适配器类型
- **返回** - **返回**
- A: 指定类型的 [Adapter](adapters/index.md#Adapter) 对象 - A: 指定类型的 [Adapter](adapters/index.md#Adapter) 对象
- **异常** - **异常**
- ValueError: 指定的 [Adapter](adapters/index.md#Adapter) 未注册 - ValueError: 指定的 [Adapter](adapters/index.md#Adapter) 未注册
- ValueError: 全局 [Driver](drivers/index.md#Driver) 对象尚未初始化 ([nonebot.init](#init) 尚未调用) - ValueError: 全局 [Driver](drivers/index.md#Driver) 对象尚未初始化 ([nonebot.init](#init) 尚未调用)
@@ -121,11 +112,9 @@ description: nonebot 模块
empty empty
- **返回** - **返回**
- dict[str, [Adapter](adapters/index.md#Adapter)]: 所有 [Adapter](adapters/index.md#Adapter) 实例字典 - dict[str, [Adapter](adapters/index.md#Adapter)]: 所有 [Adapter](adapters/index.md#Adapter) 实例字典
- **异常** - **异常**
- ValueError: 全局 [Driver](drivers/index.md#Driver) 对象尚未初始化 ([nonebot.init](#init) 尚未调用) - ValueError: 全局 [Driver](drivers/index.md#Driver) 对象尚未初始化 ([nonebot.init](#init) 尚未调用)
- **用法** - **用法**
@@ -143,11 +132,9 @@ description: nonebot 模块
empty empty
- **返回** - **返回**
- Any: Server App 对象 - Any: Server App 对象
- **异常** - **异常**
- AssertionError: 全局 Driver 对象不是 [ASGIMixin](drivers/index.md#ASGIMixin) 类型 - AssertionError: 全局 Driver 对象不是 [ASGIMixin](drivers/index.md#ASGIMixin) 类型
- ValueError: 全局 [Driver](drivers/index.md#Driver) 对象尚未初始化 ([nonebot.init](#init) 尚未调用) - ValueError: 全局 [Driver](drivers/index.md#Driver) 对象尚未初始化 ([nonebot.init](#init) 尚未调用)
@@ -167,11 +154,9 @@ description: nonebot 模块
empty empty
- **返回** - **返回**
- Any: ASGI 对象 - Any: ASGI 对象
- **异常** - **异常**
- AssertionError: 全局 Driver 对象不是 [ASGIMixin](drivers/index.md#ASGIMixin) 类型 - AssertionError: 全局 Driver 对象不是 [ASGIMixin](drivers/index.md#ASGIMixin) 类型
- ValueError: 全局 [Driver](drivers/index.md#Driver) 对象尚未初始化 ([nonebot.init](#init) 尚未调用) - ValueError: 全局 [Driver](drivers/index.md#Driver) 对象尚未初始化 ([nonebot.init](#init) 尚未调用)
@@ -192,15 +177,12 @@ description: nonebot 模块
当不提供时,返回一个 [Bot](adapters/index.md#Bot)。 当不提供时,返回一个 [Bot](adapters/index.md#Bot)。
- **参数** - **参数**
- `self_id` (str | None): 用来识别 [Bot](adapters/index.md#Bot) 的 [Bot.self_id](adapters/index.md#Bot-self-id) 属性 - `self_id` (str | None): 用来识别 [Bot](adapters/index.md#Bot) 的 [Bot.self_id](adapters/index.md#Bot-self-id) 属性
- **返回** - **返回**
- [Bot](adapters/index.md#Bot): [Bot](adapters/index.md#Bot) 对象 - [Bot](adapters/index.md#Bot): [Bot](adapters/index.md#Bot) 对象
- **异常** - **异常**
- KeyError: 对应 self_id 的 Bot 不存在 - KeyError: 对应 self_id 的 Bot 不存在
- ValueError: 没有传入 self_id 且没有 Bot 可用 - ValueError: 没有传入 self_id 且没有 Bot 可用
@@ -224,13 +206,11 @@ description: nonebot 模块
empty empty
- **返回** - **返回**
- dict[str, [Bot](adapters/index.md#Bot)]: 一个以 [Bot.self_id](adapters/index.md#Bot-self-id) 为键 - dict[str, [Bot](adapters/index.md#Bot)]: 一个以 [Bot.self_id](adapters/index.md#Bot-self-id) 为键
[Bot](adapters/index.md#Bot) 对象为值的字典 [Bot](adapters/index.md#Bot) 对象为值的字典
- **异常** - **异常**
- ValueError: 全局 [Driver](drivers/index.md#Driver) 对象尚未初始化 ([nonebot.init](#init) 尚未调用) - ValueError: 全局 [Driver](drivers/index.md#Driver) 对象尚未初始化 ([nonebot.init](#init) 尚未调用)
- **用法** - **用法**
@@ -250,13 +230,11 @@ description: nonebot 模块
也可以传入自定义的 `_env_file` 来指定 NoneBot 从该文件读取配置。 也可以传入自定义的 `_env_file` 来指定 NoneBot 从该文件读取配置。
- **参数** - **参数**
- `_env_file` (DOTENV_TYPE | None): 配置文件名,默认从 `.env.{env_name}` 中读取配置 - `_env_file` (DOTENV_TYPE | None): 配置文件名,默认从 `.env.{env_name}` 中读取配置
- `**kwargs` (Any): 任意变量,将会存储到 [Driver.config](drivers/index.md#Driver-config) 对象里 - `**kwargs` (Any): 任意变量,将会存储到 [Driver.config](drivers/index.md#Driver-config) 对象里
- **返回** - **返回**
- None - None
- **用法** - **用法**
@@ -270,13 +248,11 @@ description: nonebot 模块
- **说明:** 启动 NoneBot即运行全局 [Driver](drivers/index.md#Driver) 对象。 - **说明:** 启动 NoneBot即运行全局 [Driver](drivers/index.md#Driver) 对象。
- **参数** - **参数**
- `*args` (Any): 传入 [Driver.run](drivers/index.md#Driver-run) 的位置参数 - `*args` (Any): 传入 [Driver.run](drivers/index.md#Driver-run) 的位置参数
- `**kwargs` (Any): 传入 [Driver.run](drivers/index.md#Driver-run) 的命名参数 - `**kwargs` (Any): 传入 [Driver.run](drivers/index.md#Driver-run) 的命名参数
- **返回** - **返回**
- None - None
- **用法** - **用法**

View File

@@ -25,7 +25,6 @@ NoneBot 使用 [`loguru`][loguru] 来记录日志信息。
NoneBot 日志记录器对象。 NoneBot 日志记录器对象。
默认信息: 默认信息:
- 格式: `[%(asctime)s %(name)s] %(levelname)s: %(message)s` - 格式: `[%(asctime)s %(name)s] %(levelname)s: %(message)s`
- 等级: `INFO` ,根据 `config.log_level` 配置改变 - 等级: `INFO` ,根据 `config.log_level` 配置改变
- 输出: 输出至 stdout - 输出: 输出至 stdout
@@ -47,11 +46,9 @@ NoneBot 使用 [`loguru`][loguru] 来记录日志信息。
### _method_ `emit(record)` {#LoguruHandler-emit} ### _method_ `emit(record)` {#LoguruHandler-emit}
- **参数** - **参数**
- `record` (logging.LogRecord) - `record` (logging.LogRecord)
- **返回** - **返回**
- untyped - untyped
## _def_ `default_filter(record)` {#default-filter} ## _def_ `default_filter(record)` {#default-filter}
@@ -59,11 +56,9 @@ NoneBot 使用 [`loguru`][loguru] 来记录日志信息。
- **说明:** 默认的日志过滤器,根据 `config.log_level` 配置改变日志等级。 - **说明:** 默认的日志过滤器,根据 `config.log_level` 配置改变日志等级。
- **参数** - **参数**
- `record` (Record) - `record` (Record)
- **返回** - **返回**
- untyped - untyped
## _var_ `default_format` {#default-format} ## _var_ `default_format` {#default-format}

View File

@@ -76,7 +76,6 @@ description: nonebot.matcher 模块
- **说明:** 创建一个新的事件响应器,并存储至 `matchers <#matchers>`\_ - **说明:** 创建一个新的事件响应器,并存储至 `matchers <#matchers>`\_
- **参数** - **参数**
- `type_` (str): 事件响应器类型,与 `event.get_type()` 一致时触发,空字符串表示任意 - `type_` (str): 事件响应器类型,与 `event.get_type()` 一致时触发,空字符串表示任意
- `rule` ([Rule](rule.md#Rule) | None): 匹配规则 - `rule` ([Rule](rule.md#Rule) | None): 匹配规则
@@ -106,7 +105,6 @@ description: nonebot.matcher 模块
- `default_permission_updater` ([T_PermissionUpdater](typing.md#T-PermissionUpdater) | [Dependent](dependencies/index.md#Dependent)[[Permission](permission.md#Permission)] | None): 默认会话权限更新函数 - `default_permission_updater` ([T_PermissionUpdater](typing.md#T-PermissionUpdater) | [Dependent](dependencies/index.md#Dependent)[[Permission](permission.md#Permission)] | None): 默认会话权限更新函数
- **返回** - **返回**
- type[Matcher]: 新的事件响应器类 - type[Matcher]: 新的事件响应器类
### _classmethod_ `destroy()` {#Matcher-destroy} ### _classmethod_ `destroy()` {#Matcher-destroy}
@@ -118,7 +116,6 @@ description: nonebot.matcher 模块
empty empty
- **返回** - **返回**
- None - None
### _classmethod_ `check_perm(bot, event, stack=None, dependency_cache=None)` {#Matcher-check-perm} ### _classmethod_ `check_perm(bot, event, stack=None, dependency_cache=None)` {#Matcher-check-perm}
@@ -126,7 +123,6 @@ description: nonebot.matcher 模块
- **说明:** 检查是否满足触发权限 - **说明:** 检查是否满足触发权限
- **参数** - **参数**
- `bot` ([Bot](adapters/index.md#Bot)): Bot 对象 - `bot` ([Bot](adapters/index.md#Bot)): Bot 对象
- `event` ([Event](adapters/index.md#Event)): 上报事件 - `event` ([Event](adapters/index.md#Event)): 上报事件
@@ -136,7 +132,6 @@ description: nonebot.matcher 模块
- `dependency_cache` ([T_DependencyCache](typing.md#T-DependencyCache) | None): 依赖缓存 - `dependency_cache` ([T_DependencyCache](typing.md#T-DependencyCache) | None): 依赖缓存
- **返回** - **返回**
- bool: 是否满足权限 - bool: 是否满足权限
### _classmethod_ `check_rule(bot, event, state, stack=None, dependency_cache=None)` {#Matcher-check-rule} ### _classmethod_ `check_rule(bot, event, state, stack=None, dependency_cache=None)` {#Matcher-check-rule}
@@ -144,7 +139,6 @@ description: nonebot.matcher 模块
- **说明:** 检查是否满足匹配规则 - **说明:** 检查是否满足匹配规则
- **参数** - **参数**
- `bot` ([Bot](adapters/index.md#Bot)): Bot 对象 - `bot` ([Bot](adapters/index.md#Bot)): Bot 对象
- `event` ([Event](adapters/index.md#Event)): 上报事件 - `event` ([Event](adapters/index.md#Event)): 上报事件
@@ -156,7 +150,6 @@ description: nonebot.matcher 模块
- `dependency_cache` ([T_DependencyCache](typing.md#T-DependencyCache) | None): 依赖缓存 - `dependency_cache` ([T_DependencyCache](typing.md#T-DependencyCache) | None): 依赖缓存
- **返回** - **返回**
- bool: 是否满足匹配规则 - bool: 是否满足匹配规则
### _classmethod_ `type_updater(func)` {#Matcher-type-updater} ### _classmethod_ `type_updater(func)` {#Matcher-type-updater}
@@ -164,11 +157,9 @@ description: nonebot.matcher 模块
- **说明:** 装饰一个函数来更改当前事件响应器的默认响应事件类型更新函数 - **说明:** 装饰一个函数来更改当前事件响应器的默认响应事件类型更新函数
- **参数** - **参数**
- `func` ([T_TypeUpdater](typing.md#T-TypeUpdater)): 响应事件类型更新函数 - `func` ([T_TypeUpdater](typing.md#T-TypeUpdater)): 响应事件类型更新函数
- **返回** - **返回**
- [T_TypeUpdater](typing.md#T-TypeUpdater) - [T_TypeUpdater](typing.md#T-TypeUpdater)
### _classmethod_ `permission_updater(func)` {#Matcher-permission-updater} ### _classmethod_ `permission_updater(func)` {#Matcher-permission-updater}
@@ -176,23 +167,19 @@ description: nonebot.matcher 模块
- **说明:** 装饰一个函数来更改当前事件响应器的默认会话权限更新函数 - **说明:** 装饰一个函数来更改当前事件响应器的默认会话权限更新函数
- **参数** - **参数**
- `func` ([T_PermissionUpdater](typing.md#T-PermissionUpdater)): 会话权限更新函数 - `func` ([T_PermissionUpdater](typing.md#T-PermissionUpdater)): 会话权限更新函数
- **返回** - **返回**
- [T_PermissionUpdater](typing.md#T-PermissionUpdater) - [T_PermissionUpdater](typing.md#T-PermissionUpdater)
### _classmethod_ `append_handler(handler, parameterless=None)` {#Matcher-append-handler} ### _classmethod_ `append_handler(handler, parameterless=None)` {#Matcher-append-handler}
- **参数** - **参数**
- `handler` ([T_Handler](typing.md#T-Handler)) - `handler` ([T_Handler](typing.md#T-Handler))
- `parameterless` (Iterable[Any] | None) - `parameterless` (Iterable[Any] | None)
- **返回** - **返回**
- [Dependent](dependencies/index.md#Dependent)[Any] - [Dependent](dependencies/index.md#Dependent)[Any]
### _classmethod_ `handle(parameterless=None)` {#Matcher-handle} ### _classmethod_ `handle(parameterless=None)` {#Matcher-handle}
@@ -200,11 +187,9 @@ description: nonebot.matcher 模块
- **说明:** 装饰一个函数来向事件响应器直接添加一个处理函数 - **说明:** 装饰一个函数来向事件响应器直接添加一个处理函数
- **参数** - **参数**
- `parameterless` (Iterable[Any] | None): 非参数类型依赖列表 - `parameterless` (Iterable[Any] | None): 非参数类型依赖列表
- **返回** - **返回**
- ([T_Handler](typing.md#T-Handler)) -> [T_Handler](typing.md#T-Handler) - ([T_Handler](typing.md#T-Handler)) -> [T_Handler](typing.md#T-Handler)
### _classmethod_ `receive(id="", parameterless=None)` {#Matcher-receive} ### _classmethod_ `receive(id="", parameterless=None)` {#Matcher-receive}
@@ -212,13 +197,11 @@ description: nonebot.matcher 模块
- **说明:** 装饰一个函数来指示 NoneBot 在接收用户新的一条消息后继续运行该函数 - **说明:** 装饰一个函数来指示 NoneBot 在接收用户新的一条消息后继续运行该函数
- **参数** - **参数**
- `id` (str): 消息 ID - `id` (str): 消息 ID
- `parameterless` (Iterable[Any] | None): 非参数类型依赖列表 - `parameterless` (Iterable[Any] | None): 非参数类型依赖列表
- **返回** - **返回**
- ([T_Handler](typing.md#T-Handler)) -> [T_Handler](typing.md#T-Handler) - ([T_Handler](typing.md#T-Handler)) -> [T_Handler](typing.md#T-Handler)
### _classmethod_ `got(key, prompt=None, parameterless=None)` {#Matcher-got} ### _classmethod_ `got(key, prompt=None, parameterless=None)` {#Matcher-got}
@@ -231,7 +214,6 @@ description: nonebot.matcher 模块
如果 `key` 已存在则直接继续运行 如果 `key` 已存在则直接继续运行
- **参数** - **参数**
- `key` (str): 参数名 - `key` (str): 参数名
- `prompt` (str | [Message](adapters/index.md#Message) | [MessageSegment](adapters/index.md#MessageSegment) | [MessageTemplate](adapters/index.md#MessageTemplate) | None): 在参数不存在时向用户发送的消息 - `prompt` (str | [Message](adapters/index.md#Message) | [MessageSegment](adapters/index.md#MessageSegment) | [MessageTemplate](adapters/index.md#MessageTemplate) | None): 在参数不存在时向用户发送的消息
@@ -239,7 +221,6 @@ description: nonebot.matcher 模块
- `parameterless` (Iterable[Any] | None): 非参数类型依赖列表 - `parameterless` (Iterable[Any] | None): 非参数类型依赖列表
- **返回** - **返回**
- ([T_Handler](typing.md#T-Handler)) -> [T_Handler](typing.md#T-Handler) - ([T_Handler](typing.md#T-Handler)) -> [T_Handler](typing.md#T-Handler)
### _classmethod_ `send(message, **kwargs)` {#Matcher-send} ### _classmethod_ `send(message, **kwargs)` {#Matcher-send}
@@ -247,13 +228,11 @@ description: nonebot.matcher 模块
- **说明:** 发送一条消息给当前交互用户 - **说明:** 发送一条消息给当前交互用户
- **参数** - **参数**
- `message` (str | [Message](adapters/index.md#Message) | [MessageSegment](adapters/index.md#MessageSegment) | [MessageTemplate](adapters/index.md#MessageTemplate)): 消息内容 - `message` (str | [Message](adapters/index.md#Message) | [MessageSegment](adapters/index.md#MessageSegment) | [MessageTemplate](adapters/index.md#MessageTemplate)): 消息内容
- `**kwargs` (Any): [Bot.send](adapters/index.md#Bot-send) 的参数, 请参考对应 adapter 的 bot 对象 api - `**kwargs` (Any): [Bot.send](adapters/index.md#Bot-send) 的参数, 请参考对应 adapter 的 bot 对象 api
- **返回** - **返回**
- Any - Any
### _classmethod_ `finish(message=None, **kwargs)` {#Matcher-finish} ### _classmethod_ `finish(message=None, **kwargs)` {#Matcher-finish}
@@ -261,13 +240,11 @@ description: nonebot.matcher 模块
- **说明:** 发送一条消息给当前交互用户并结束当前事件响应器 - **说明:** 发送一条消息给当前交互用户并结束当前事件响应器
- **参数** - **参数**
- `message` (str | [Message](adapters/index.md#Message) | [MessageSegment](adapters/index.md#MessageSegment) | [MessageTemplate](adapters/index.md#MessageTemplate) | None): 消息内容 - `message` (str | [Message](adapters/index.md#Message) | [MessageSegment](adapters/index.md#MessageSegment) | [MessageTemplate](adapters/index.md#MessageTemplate) | None): 消息内容
- `**kwargs`: [Bot.send](adapters/index.md#Bot-send) 的参数, 请参考对应 adapter 的 bot 对象 api - `**kwargs`: [Bot.send](adapters/index.md#Bot-send) 的参数, 请参考对应 adapter 的 bot 对象 api
- **返回** - **返回**
- NoReturn - NoReturn
### _classmethod_ `pause(prompt=None, **kwargs)` {#Matcher-pause} ### _classmethod_ `pause(prompt=None, **kwargs)` {#Matcher-pause}
@@ -275,13 +252,11 @@ description: nonebot.matcher 模块
- **说明:** 发送一条消息给当前交互用户并暂停事件响应器,在接收用户新的一条消息后继续下一个处理函数 - **说明:** 发送一条消息给当前交互用户并暂停事件响应器,在接收用户新的一条消息后继续下一个处理函数
- **参数** - **参数**
- `prompt` (str | [Message](adapters/index.md#Message) | [MessageSegment](adapters/index.md#MessageSegment) | [MessageTemplate](adapters/index.md#MessageTemplate) | None): 消息内容 - `prompt` (str | [Message](adapters/index.md#Message) | [MessageSegment](adapters/index.md#MessageSegment) | [MessageTemplate](adapters/index.md#MessageTemplate) | None): 消息内容
- `**kwargs`: [Bot.send](adapters/index.md#Bot-send) 的参数, 请参考对应 adapter 的 bot 对象 api - `**kwargs`: [Bot.send](adapters/index.md#Bot-send) 的参数, 请参考对应 adapter 的 bot 对象 api
- **返回** - **返回**
- NoReturn - NoReturn
### _classmethod_ `reject(prompt=None, **kwargs)` {#Matcher-reject} ### _classmethod_ `reject(prompt=None, **kwargs)` {#Matcher-reject}
@@ -289,13 +264,11 @@ description: nonebot.matcher 模块
- **说明:** 最近使用 `got` / `receive` 接收的消息不符合预期, 发送一条消息给当前交互用户并将当前事件处理流程中断在当前位置,在接收用户新的一个事件后从头开始执行当前处理函数 - **说明:** 最近使用 `got` / `receive` 接收的消息不符合预期, 发送一条消息给当前交互用户并将当前事件处理流程中断在当前位置,在接收用户新的一个事件后从头开始执行当前处理函数
- **参数** - **参数**
- `prompt` (str | [Message](adapters/index.md#Message) | [MessageSegment](adapters/index.md#MessageSegment) | [MessageTemplate](adapters/index.md#MessageTemplate) | None): 消息内容 - `prompt` (str | [Message](adapters/index.md#Message) | [MessageSegment](adapters/index.md#MessageSegment) | [MessageTemplate](adapters/index.md#MessageTemplate) | None): 消息内容
- `**kwargs`: [Bot.send](adapters/index.md#Bot-send) 的参数, 请参考对应 adapter 的 bot 对象 api - `**kwargs`: [Bot.send](adapters/index.md#Bot-send) 的参数, 请参考对应 adapter 的 bot 对象 api
- **返回** - **返回**
- NoReturn - NoReturn
### _classmethod_ `reject_arg(key, prompt=None, **kwargs)` {#Matcher-reject-arg} ### _classmethod_ `reject_arg(key, prompt=None, **kwargs)` {#Matcher-reject-arg}
@@ -303,7 +276,6 @@ description: nonebot.matcher 模块
- **说明:** 最近使用 `got` 接收的消息不符合预期, 发送一条消息给当前交互用户并将当前事件处理流程中断在当前位置,在接收用户新的一条消息后从头开始执行当前处理函数 - **说明:** 最近使用 `got` 接收的消息不符合预期, 发送一条消息给当前交互用户并将当前事件处理流程中断在当前位置,在接收用户新的一条消息后从头开始执行当前处理函数
- **参数** - **参数**
- `key` (str): 参数名 - `key` (str): 参数名
- `prompt` (str | [Message](adapters/index.md#Message) | [MessageSegment](adapters/index.md#MessageSegment) | [MessageTemplate](adapters/index.md#MessageTemplate) | None): 消息内容 - `prompt` (str | [Message](adapters/index.md#Message) | [MessageSegment](adapters/index.md#MessageSegment) | [MessageTemplate](adapters/index.md#MessageTemplate) | None): 消息内容
@@ -311,7 +283,6 @@ description: nonebot.matcher 模块
- `**kwargs`: [Bot.send](adapters/index.md#Bot-send) 的参数, 请参考对应 adapter 的 bot 对象 api - `**kwargs`: [Bot.send](adapters/index.md#Bot-send) 的参数, 请参考对应 adapter 的 bot 对象 api
- **返回** - **返回**
- NoReturn - NoReturn
### _classmethod_ `reject_receive(id="", prompt=None, **kwargs)` {#Matcher-reject-receive} ### _classmethod_ `reject_receive(id="", prompt=None, **kwargs)` {#Matcher-reject-receive}
@@ -319,7 +290,6 @@ description: nonebot.matcher 模块
- **说明:** 最近使用 `receive` 接收的消息不符合预期, 发送一条消息给当前交互用户并将当前事件处理流程中断在当前位置,在接收用户新的一个事件后从头开始执行当前处理函数 - **说明:** 最近使用 `receive` 接收的消息不符合预期, 发送一条消息给当前交互用户并将当前事件处理流程中断在当前位置,在接收用户新的一个事件后从头开始执行当前处理函数
- **参数** - **参数**
- `id` (str): 消息 id - `id` (str): 消息 id
- `prompt` (str | [Message](adapters/index.md#Message) | [MessageSegment](adapters/index.md#MessageSegment) | [MessageTemplate](adapters/index.md#MessageTemplate) | None): 消息内容 - `prompt` (str | [Message](adapters/index.md#Message) | [MessageSegment](adapters/index.md#MessageSegment) | [MessageTemplate](adapters/index.md#MessageTemplate) | None): 消息内容
@@ -327,7 +297,6 @@ description: nonebot.matcher 模块
- `**kwargs`: [Bot.send](adapters/index.md#Bot-send) 的参数, 请参考对应 adapter 的 bot 对象 api - `**kwargs`: [Bot.send](adapters/index.md#Bot-send) 的参数, 请参考对应 adapter 的 bot 对象 api
- **返回** - **返回**
- NoReturn - NoReturn
### _classmethod_ `skip()` {#Matcher-skip} ### _classmethod_ `skip()` {#Matcher-skip}
@@ -343,7 +312,6 @@ description: nonebot.matcher 模块
empty empty
- **返回** - **返回**
- NoReturn - NoReturn
### _method_ `get_receive(id, default=None)` {#Matcher-get-receive} ### _method_ `get_receive(id, default=None)` {#Matcher-get-receive}
@@ -357,25 +325,19 @@ description: nonebot.matcher 模块
- **重载** - **重载**
**1.** `(id) -> Event | None` **1.** `(id) -> Event | None`
- **参数** - **参数**
- `id` (str) - `id` (str)
- **返回** - **返回**
- [Event](adapters/index.md#Event) | None - [Event](adapters/index.md#Event) | None
**2.** `(id, default) -> Event | T` **2.** `(id, default) -> Event | T`
- **参数** - **参数**
- `id` (str) - `id` (str)
- `default` (T) - `default` (T)
- **返回** - **返回**
- [Event](adapters/index.md#Event) | T - [Event](adapters/index.md#Event) | T
### _method_ `set_receive(id, event)` {#Matcher-set-receive} ### _method_ `set_receive(id, event)` {#Matcher-set-receive}
@@ -383,13 +345,11 @@ description: nonebot.matcher 模块
- **说明:** 设置一个 `receive` 事件 - **说明:** 设置一个 `receive` 事件
- **参数** - **参数**
- `id` (str) - `id` (str)
- `event` ([Event](adapters/index.md#Event)) - `event` ([Event](adapters/index.md#Event))
- **返回** - **返回**
- None - None
### _method_ `get_last_receive(default=None)` {#Matcher-get-last-receive} ### _method_ `get_last_receive(default=None)` {#Matcher-get-last-receive}
@@ -403,23 +363,18 @@ description: nonebot.matcher 模块
- **重载** - **重载**
**1.** `() -> Event | None` **1.** `() -> Event | None`
- **参数** - **参数**
empty empty
- **返回** - **返回**
- [Event](adapters/index.md#Event) | None - [Event](adapters/index.md#Event) | None
**2.** `(default) -> Event | T` **2.** `(default) -> Event | T`
- **参数** - **参数**
- `default` (T) - `default` (T)
- **返回** - **返回**
- [Event](adapters/index.md#Event) | T - [Event](adapters/index.md#Event) | T
### _method_ `get_arg(key, default=None)` {#Matcher-get-arg} ### _method_ `get_arg(key, default=None)` {#Matcher-get-arg}
@@ -433,25 +388,19 @@ description: nonebot.matcher 模块
- **重载** - **重载**
**1.** `(key) -> Message | None` **1.** `(key) -> Message | None`
- **参数** - **参数**
- `key` (str) - `key` (str)
- **返回** - **返回**
- [Message](adapters/index.md#Message) | None - [Message](adapters/index.md#Message) | None
**2.** `(key, default) -> Message | T` **2.** `(key, default) -> Message | T`
- **参数** - **参数**
- `key` (str) - `key` (str)
- `default` (T) - `default` (T)
- **返回** - **返回**
- [Message](adapters/index.md#Message) | T - [Message](adapters/index.md#Message) | T
### _method_ `set_arg(key, message)` {#Matcher-set-arg} ### _method_ `set_arg(key, message)` {#Matcher-set-arg}
@@ -459,25 +408,21 @@ description: nonebot.matcher 模块
- **说明:** 设置一个 `got` 消息 - **说明:** 设置一个 `got` 消息
- **参数** - **参数**
- `key` (str) - `key` (str)
- `message` ([Message](adapters/index.md#Message)) - `message` ([Message](adapters/index.md#Message))
- **返回** - **返回**
- None - None
### _method_ `set_target(target, cache=True)` {#Matcher-set-target} ### _method_ `set_target(target, cache=True)` {#Matcher-set-target}
- **参数** - **参数**
- `target` (str) - `target` (str)
- `cache` (bool) - `cache` (bool)
- **返回** - **返回**
- None - None
### _method_ `get_target(default=None)` {#Matcher-get-target} ### _method_ `get_target(default=None)` {#Matcher-get-target}
@@ -485,23 +430,18 @@ description: nonebot.matcher 模块
- **重载** - **重载**
**1.** `() -> str | None` **1.** `() -> str | None`
- **参数** - **参数**
empty empty
- **返回** - **返回**
- str | None - str | None
**2.** `(default) -> str | T` **2.** `(default) -> str | T`
- **参数** - **参数**
- `default` (T) - `default` (T)
- **返回** - **返回**
- str | T - str | T
### _method_ `stop_propagation()` {#Matcher-stop-propagation} ### _method_ `stop_propagation()` {#Matcher-stop-propagation}
@@ -513,13 +453,11 @@ description: nonebot.matcher 模块
empty empty
- **返回** - **返回**
- untyped - untyped
### _async method_ `update_type(bot, event, stack=None, dependency_cache=None)` {#Matcher-update-type} ### _async method_ `update_type(bot, event, stack=None, dependency_cache=None)` {#Matcher-update-type}
- **参数** - **参数**
- `bot` ([Bot](adapters/index.md#Bot)) - `bot` ([Bot](adapters/index.md#Bot))
- `event` ([Event](adapters/index.md#Event)) - `event` ([Event](adapters/index.md#Event))
@@ -529,13 +467,11 @@ description: nonebot.matcher 模块
- `dependency_cache` ([T_DependencyCache](typing.md#T-DependencyCache) | None) - `dependency_cache` ([T_DependencyCache](typing.md#T-DependencyCache) | None)
- **返回** - **返回**
- str - str
### _async method_ `update_permission(bot, event, stack=None, dependency_cache=None)` {#Matcher-update-permission} ### _async method_ `update_permission(bot, event, stack=None, dependency_cache=None)` {#Matcher-update-permission}
- **参数** - **参数**
- `bot` ([Bot](adapters/index.md#Bot)) - `bot` ([Bot](adapters/index.md#Bot))
- `event` ([Event](adapters/index.md#Event)) - `event` ([Event](adapters/index.md#Event))
@@ -545,7 +481,6 @@ description: nonebot.matcher 模块
- `dependency_cache` ([T_DependencyCache](typing.md#T-DependencyCache) | None) - `dependency_cache` ([T_DependencyCache](typing.md#T-DependencyCache) | None)
- **返回** - **返回**
- [Permission](permission.md#Permission) - [Permission](permission.md#Permission)
### _async method_ `resolve_reject()` {#Matcher-resolve-reject} ### _async method_ `resolve_reject()` {#Matcher-resolve-reject}
@@ -555,25 +490,21 @@ description: nonebot.matcher 模块
empty empty
- **返回** - **返回**
- untyped - untyped
### _method_ `ensure_context(bot, event)` {#Matcher-ensure-context} ### _method_ `ensure_context(bot, event)` {#Matcher-ensure-context}
- **参数** - **参数**
- `bot` ([Bot](adapters/index.md#Bot)) - `bot` ([Bot](adapters/index.md#Bot))
- `event` ([Event](adapters/index.md#Event)) - `event` ([Event](adapters/index.md#Event))
- **返回** - **返回**
- untyped - untyped
### _async method_ `simple_run(bot, event, state, stack=None, dependency_cache=None)` {#Matcher-simple-run} ### _async method_ `simple_run(bot, event, state, stack=None, dependency_cache=None)` {#Matcher-simple-run}
- **参数** - **参数**
- `bot` ([Bot](adapters/index.md#Bot)) - `bot` ([Bot](adapters/index.md#Bot))
- `event` ([Event](adapters/index.md#Event)) - `event` ([Event](adapters/index.md#Event))
@@ -585,13 +516,11 @@ description: nonebot.matcher 模块
- `dependency_cache` ([T_DependencyCache](typing.md#T-DependencyCache) | None) - `dependency_cache` ([T_DependencyCache](typing.md#T-DependencyCache) | None)
- **返回** - **返回**
- untyped - untyped
### _async method_ `run(bot, event, state, stack=None, dependency_cache=None)` {#Matcher-run} ### _async method_ `run(bot, event, state, stack=None, dependency_cache=None)` {#Matcher-run}
- **参数** - **参数**
- `bot` ([Bot](adapters/index.md#Bot)) - `bot` ([Bot](adapters/index.md#Bot))
- `event` ([Event](adapters/index.md#Event)) - `event` ([Event](adapters/index.md#Event))
@@ -603,7 +532,6 @@ description: nonebot.matcher 模块
- `dependency_cache` ([T_DependencyCache](typing.md#T-DependencyCache) | None) - `dependency_cache` ([T_DependencyCache](typing.md#T-DependencyCache) | None)
- **返回** - **返回**
- untyped - untyped
## _class_ `MatcherManager()` {#MatcherManager} ## _class_ `MatcherManager()` {#MatcherManager}
@@ -625,7 +553,6 @@ description: nonebot.matcher 模块
empty empty
- **返回** - **返回**
- KeysView[int] - KeysView[int]
### _method_ `values()` {#MatcherManager-values} ### _method_ `values()` {#MatcherManager-values}
@@ -635,7 +562,6 @@ description: nonebot.matcher 模块
empty empty
- **返回** - **返回**
- ValuesView[list[type[[Matcher](#Matcher)]]] - ValuesView[list[type[[Matcher](#Matcher)]]]
### _method_ `items()` {#MatcherManager-items} ### _method_ `items()` {#MatcherManager-items}
@@ -645,7 +571,6 @@ description: nonebot.matcher 模块
empty empty
- **返回** - **返回**
- ItemsView[int, list[type[[Matcher](#Matcher)]]] - ItemsView[int, list[type[[Matcher](#Matcher)]]]
### _method_ `get(key, default=None)` {#MatcherManager-get} ### _method_ `get(key, default=None)` {#MatcherManager-get}
@@ -653,35 +578,27 @@ description: nonebot.matcher 模块
- **重载** - **重载**
**1.** `(key) -> list[type[Matcher]] | None` **1.** `(key) -> list[type[Matcher]] | None`
- **参数** - **参数**
- `key` (int) - `key` (int)
- **返回** - **返回**
- list[type[[Matcher](#Matcher)]] | None - list[type[[Matcher](#Matcher)]] | None
**2.** `(key, default) -> list[type[Matcher]] | T` **2.** `(key, default) -> list[type[Matcher]] | T`
- **参数** - **参数**
- `key` (int) - `key` (int)
- `default` (T) - `default` (T)
- **返回** - **返回**
- list[type[[Matcher](#Matcher)]] | T - list[type[[Matcher](#Matcher)]] | T
### _method_ `pop(key)` {#MatcherManager-pop} ### _method_ `pop(key)` {#MatcherManager-pop}
- **参数** - **参数**
- `key` (int) - `key` (int)
- **返回** - **返回**
- list[type[[Matcher](#Matcher)]] - list[type[[Matcher](#Matcher)]]
### _method_ `popitem()` {#MatcherManager-popitem} ### _method_ `popitem()` {#MatcherManager-popitem}
@@ -691,7 +608,6 @@ description: nonebot.matcher 模块
empty empty
- **返回** - **返回**
- tuple[int, list[type[[Matcher](#Matcher)]]] - tuple[int, list[type[[Matcher](#Matcher)]]]
### _method_ `clear()` {#MatcherManager-clear} ### _method_ `clear()` {#MatcherManager-clear}
@@ -701,29 +617,24 @@ description: nonebot.matcher 模块
empty empty
- **返回** - **返回**
- None - None
### _method_ `update(m, /)` {#MatcherManager-update} ### _method_ `update(m, /)` {#MatcherManager-update}
- **参数** - **参数**
- `m` (MutableMapping[int, list[type[[Matcher](#Matcher)]]]) - `m` (MutableMapping[int, list[type[[Matcher](#Matcher)]]])
- **返回** - **返回**
- None - None
### _method_ `setdefault(key, default)` {#MatcherManager-setdefault} ### _method_ `setdefault(key, default)` {#MatcherManager-setdefault}
- **参数** - **参数**
- `key` (int) - `key` (int)
- `default` (list[type[[Matcher](#Matcher)]]) - `default` (list[type[[Matcher](#Matcher)]])
- **返回** - **返回**
- list[type[[Matcher](#Matcher)]] - list[type[[Matcher](#Matcher)]]
### _method_ `set_provider(provider_class)` {#MatcherManager-set-provider} ### _method_ `set_provider(provider_class)` {#MatcherManager-set-provider}
@@ -731,11 +642,9 @@ description: nonebot.matcher 模块
- **说明:** 设置事件响应器存储器 - **说明:** 设置事件响应器存储器
- **参数** - **参数**
- `provider_class` (type[[MatcherProvider](#MatcherProvider)]): 事件响应器存储器类 - `provider_class` (type[[MatcherProvider](#MatcherProvider)]): 事件响应器存储器类
- **返回** - **返回**
- None - None
## _abstract class_ `MatcherProvider(matchers)` {#MatcherProvider} ## _abstract class_ `MatcherProvider(matchers)` {#MatcherProvider}
@@ -743,7 +652,6 @@ description: nonebot.matcher 模块
- **说明:** 事件响应器存储器基类 - **说明:** 事件响应器存储器基类
- **参数** - **参数**
- `matchers` (Mapping[int, list[type[[Matcher](#Matcher)]]]): 当前存储器中已有的事件响应器 - `matchers` (Mapping[int, list[type[[Matcher](#Matcher)]]]): 当前存储器中已有的事件响应器
## _var_ `matchers` {#matchers} ## _var_ `matchers` {#matchers}

View File

@@ -20,11 +20,9 @@ NoneBot 内部处理并按优先级分发事件给所有事件响应器,提供
装饰一个函数,使它在每次接收到事件并分发给各响应器之前执行。 装饰一个函数,使它在每次接收到事件并分发给各响应器之前执行。
- **参数** - **参数**
- `func` ([T_EventPreProcessor](typing.md#T-EventPreProcessor)) - `func` ([T_EventPreProcessor](typing.md#T-EventPreProcessor))
- **返回** - **返回**
- [T_EventPreProcessor](typing.md#T-EventPreProcessor) - [T_EventPreProcessor](typing.md#T-EventPreProcessor)
## _def_ `event_postprocessor(func)` {#event-postprocessor} ## _def_ `event_postprocessor(func)` {#event-postprocessor}
@@ -36,11 +34,9 @@ NoneBot 内部处理并按优先级分发事件给所有事件响应器,提供
装饰一个函数,使它在每次接收到事件并分发给各响应器之后执行。 装饰一个函数,使它在每次接收到事件并分发给各响应器之后执行。
- **参数** - **参数**
- `func` ([T_EventPostProcessor](typing.md#T-EventPostProcessor)) - `func` ([T_EventPostProcessor](typing.md#T-EventPostProcessor))
- **返回** - **返回**
- [T_EventPostProcessor](typing.md#T-EventPostProcessor) - [T_EventPostProcessor](typing.md#T-EventPostProcessor)
## _def_ `run_preprocessor(func)` {#run-preprocessor} ## _def_ `run_preprocessor(func)` {#run-preprocessor}
@@ -52,11 +48,9 @@ NoneBot 内部处理并按优先级分发事件给所有事件响应器,提供
装饰一个函数,使它在每次事件响应器运行前执行。 装饰一个函数,使它在每次事件响应器运行前执行。
- **参数** - **参数**
- `func` ([T_RunPreProcessor](typing.md#T-RunPreProcessor)) - `func` ([T_RunPreProcessor](typing.md#T-RunPreProcessor))
- **返回** - **返回**
- [T_RunPreProcessor](typing.md#T-RunPreProcessor) - [T_RunPreProcessor](typing.md#T-RunPreProcessor)
## _def_ `run_postprocessor(func)` {#run-postprocessor} ## _def_ `run_postprocessor(func)` {#run-postprocessor}
@@ -68,11 +62,9 @@ NoneBot 内部处理并按优先级分发事件给所有事件响应器,提供
装饰一个函数,使它在每次事件响应器运行后执行。 装饰一个函数,使它在每次事件响应器运行后执行。
- **参数** - **参数**
- `func` ([T_RunPostProcessor](typing.md#T-RunPostProcessor)) - `func` ([T_RunPostProcessor](typing.md#T-RunPostProcessor))
- **返回** - **返回**
- [T_RunPostProcessor](typing.md#T-RunPostProcessor) - [T_RunPostProcessor](typing.md#T-RunPostProcessor)
## _async def_ `check_and_run_matcher(Matcher, bot, event, state, stack=None, dependency_cache=None)` {#check-and-run-matcher} ## _async def_ `check_and_run_matcher(Matcher, bot, event, state, stack=None, dependency_cache=None)` {#check-and-run-matcher}
@@ -80,7 +72,6 @@ NoneBot 内部处理并按优先级分发事件给所有事件响应器,提供
- **说明:** 检查并运行事件响应器。 - **说明:** 检查并运行事件响应器。
- **参数** - **参数**
- `Matcher` (type[[Matcher](matcher.md#Matcher)]): 事件响应器 - `Matcher` (type[[Matcher](matcher.md#Matcher)]): 事件响应器
- `bot` ([Bot](adapters/index.md#Bot)): Bot 对象 - `bot` ([Bot](adapters/index.md#Bot)): Bot 对象
@@ -94,7 +85,6 @@ NoneBot 内部处理并按优先级分发事件给所有事件响应器,提供
- `dependency_cache` ([T_DependencyCache](typing.md#T-DependencyCache) | None): 依赖缓存 - `dependency_cache` ([T_DependencyCache](typing.md#T-DependencyCache) | None): 依赖缓存
- **返回** - **返回**
- None - None
## _async def_ `handle_event(bot, event)` {#handle-event} ## _async def_ `handle_event(bot, event)` {#handle-event}
@@ -102,13 +92,11 @@ NoneBot 内部处理并按优先级分发事件给所有事件响应器,提供
- **说明:** 处理一个事件。调用该函数以实现分发事件。 - **说明:** 处理一个事件。调用该函数以实现分发事件。
- **参数** - **参数**
- `bot` ([Bot](adapters/index.md#Bot)): Bot 对象 - `bot` ([Bot](adapters/index.md#Bot)): Bot 对象
- `event` ([Event](adapters/index.md#Event)): Event 对象 - `event` ([Event](adapters/index.md#Event)): Event 对象
- **返回** - **返回**
- None - None
- **用法** - **用法**

View File

@@ -14,11 +14,9 @@ description: nonebot.params 模块
- **说明:** Arg 参数消息 - **说明:** Arg 参数消息
- **参数** - **参数**
- `key` (str | None) - `key` (str | None)
- **返回** - **返回**
- Any - Any
## _class_ `ArgParam(*args, key, type, **kwargs)` {#ArgParam} ## _class_ `ArgParam(*args, key, type, **kwargs)` {#ArgParam}
@@ -33,7 +31,6 @@ description: nonebot.params 模块
留空则会根据参数名称获取。 留空则会根据参数名称获取。
- **参数** - **参数**
- `*args` - `*args`
- `key` (str) - `key` (str)
@@ -47,11 +44,9 @@ description: nonebot.params 模块
- **说明:** Arg 参数消息纯文本 - **说明:** Arg 参数消息纯文本
- **参数** - **参数**
- `key` (str | None) - `key` (str | None)
- **返回** - **返回**
- str - str
## _def_ `ArgPromptResult(key=None)` {#ArgPromptResult} ## _def_ `ArgPromptResult(key=None)` {#ArgPromptResult}
@@ -59,11 +54,9 @@ description: nonebot.params 模块
- **说明:** `arg` prompt 发送结果 - **说明:** `arg` prompt 发送结果
- **参数** - **参数**
- `key` (str | None) - `key` (str | None)
- **返回** - **返回**
- Any - Any
## _def_ `ArgStr(key=None)` {#ArgStr} ## _def_ `ArgStr(key=None)` {#ArgStr}
@@ -71,11 +64,9 @@ description: nonebot.params 模块
- **说明:** Arg 参数消息文本 - **说明:** Arg 参数消息文本
- **参数** - **参数**
- `key` (str | None) - `key` (str | None)
- **返回** - **返回**
- str - str
## _class_ `BotParam(*args, checker=None, **kwargs)` {#BotParam} ## _class_ `BotParam(*args, checker=None, **kwargs)` {#BotParam}
@@ -89,7 +80,6 @@ description: nonebot.params 模块
为保证兼容性,本注入还会解析名为 `bot` 且没有类型注解的参数。 为保证兼容性,本注入还会解析名为 `bot` 且没有类型注解的参数。
- **参数** - **参数**
- `*args` - `*args`
- `checker` ([ModelField](compat.md#ModelField) | None) - `checker` ([ModelField](compat.md#ModelField) | None)
@@ -107,7 +97,6 @@ description: nonebot.params 模块
本注入参数应该具有最低优先级,因此应该在所有其他注入参数之后使用。 本注入参数应该具有最低优先级,因此应该在所有其他注入参数之后使用。
- **参数** - **参数**
- `*args` - `*args`
- `validate` (bool) - `validate` (bool)
@@ -125,7 +114,6 @@ description: nonebot.params 模块
本注入应该具有最高优先级,因此应该在其他参数之前检查。 本注入应该具有最高优先级,因此应该在其他参数之前检查。
- **参数** - **参数**
- `*args` - `*args`
- `dependent` ([Dependent](dependencies/index.md#Dependent)[Any]) - `dependent` ([Dependent](dependencies/index.md#Dependent)[Any])
@@ -139,7 +127,6 @@ description: nonebot.params 模块
- **说明:** 子依赖装饰器 - **说明:** 子依赖装饰器
- **参数** - **参数**
- `dependency` ([T_Handler](typing.md#T-Handler) | None): 依赖函数。默认为参数的类型注释。 - `dependency` ([T_Handler](typing.md#T-Handler) | None): 依赖函数。默认为参数的类型注释。
- `use_cache` (bool): 是否使用缓存。默认为 `True` - `use_cache` (bool): 是否使用缓存。默认为 `True`
@@ -147,7 +134,6 @@ description: nonebot.params 模块
- `validate` (bool | PydanticFieldInfo): 是否使用 Pydantic 类型校验。默认为 `False` - `validate` (bool | PydanticFieldInfo): 是否使用 Pydantic 类型校验。默认为 `False`
- **返回** - **返回**
- Any - Any
- **用法** - **用法**
@@ -180,7 +166,6 @@ description: nonebot.params 模块
为保证兼容性,本注入还会解析名为 `event` 且没有类型注解的参数。 为保证兼容性,本注入还会解析名为 `event` 且没有类型注解的参数。
- **参数** - **参数**
- `*args` - `*args`
- `checker` ([ModelField](compat.md#ModelField) | None) - `checker` ([ModelField](compat.md#ModelField) | None)
@@ -198,7 +183,6 @@ description: nonebot.params 模块
为保证兼容性,本注入还会解析名为 `exception` 且没有类型注解的参数。 为保证兼容性,本注入还会解析名为 `exception` 且没有类型注解的参数。
- **参数** - **参数**
- `*args` - `*args`
- `validate` (bool) - `validate` (bool)
@@ -216,7 +200,6 @@ description: nonebot.params 模块
为保证兼容性,本注入还会解析名为 `matcher` 且没有类型注解的参数。 为保证兼容性,本注入还会解析名为 `matcher` 且没有类型注解的参数。
- **参数** - **参数**
- `*args` - `*args`
- `checker` ([ModelField](compat.md#ModelField) | None) - `checker` ([ModelField](compat.md#ModelField) | None)
@@ -234,7 +217,6 @@ description: nonebot.params 模块
为保证兼容性,本注入还会解析名为 `state` 且没有类型注解的参数。 为保证兼容性,本注入还会解析名为 `state` 且没有类型注解的参数。
- **参数** - **参数**
- `*args` - `*args`
- `validate` (bool) - `validate` (bool)
@@ -250,7 +232,6 @@ description: nonebot.params 模块
empty empty
- **返回** - **返回**
- str - str
## _def_ `EventMessage()` {#EventMessage} ## _def_ `EventMessage()` {#EventMessage}
@@ -262,7 +243,6 @@ description: nonebot.params 模块
empty empty
- **返回** - **返回**
- Any - Any
## _def_ `EventPlainText()` {#EventPlainText} ## _def_ `EventPlainText()` {#EventPlainText}
@@ -274,7 +254,6 @@ description: nonebot.params 模块
empty empty
- **返回** - **返回**
- str - str
## _def_ `EventToMe()` {#EventToMe} ## _def_ `EventToMe()` {#EventToMe}
@@ -286,7 +265,6 @@ description: nonebot.params 模块
empty empty
- **返回** - **返回**
- bool - bool
## _def_ `Command()` {#Command} ## _def_ `Command()` {#Command}
@@ -298,7 +276,6 @@ description: nonebot.params 模块
empty empty
- **返回** - **返回**
- tuple[str, ...] - tuple[str, ...]
## _def_ `RawCommand()` {#RawCommand} ## _def_ `RawCommand()` {#RawCommand}
@@ -310,7 +287,6 @@ description: nonebot.params 模块
empty empty
- **返回** - **返回**
- str - str
## _def_ `CommandArg()` {#CommandArg} ## _def_ `CommandArg()` {#CommandArg}
@@ -322,7 +298,6 @@ description: nonebot.params 模块
empty empty
- **返回** - **返回**
- Any - Any
## _def_ `CommandStart()` {#CommandStart} ## _def_ `CommandStart()` {#CommandStart}
@@ -334,7 +309,6 @@ description: nonebot.params 模块
empty empty
- **返回** - **返回**
- str - str
## _def_ `CommandWhitespace()` {#CommandWhitespace} ## _def_ `CommandWhitespace()` {#CommandWhitespace}
@@ -346,7 +320,6 @@ description: nonebot.params 模块
empty empty
- **返回** - **返回**
- str - str
## _def_ `ShellCommandArgs()` {#ShellCommandArgs} ## _def_ `ShellCommandArgs()` {#ShellCommandArgs}
@@ -358,7 +331,6 @@ description: nonebot.params 模块
empty empty
- **返回** - **返回**
- Any - Any
## _def_ `ShellCommandArgv()` {#ShellCommandArgv} ## _def_ `ShellCommandArgv()` {#ShellCommandArgv}
@@ -370,7 +342,6 @@ description: nonebot.params 模块
empty empty
- **返回** - **返回**
- Any - Any
## _def_ `RegexMatched()` {#RegexMatched} ## _def_ `RegexMatched()` {#RegexMatched}
@@ -382,7 +353,6 @@ description: nonebot.params 模块
empty empty
- **返回** - **返回**
- Match[str] - Match[str]
## _def_ `RegexStr(*groups)` {#RegexStr} ## _def_ `RegexStr(*groups)` {#RegexStr}
@@ -392,29 +362,21 @@ description: nonebot.params 模块
- **重载** - **重载**
**1.** `(group, /) -> str` **1.** `(group, /) -> str`
- **参数** - **参数**
- `group` (Literal[0]) - `group` (Literal[0])
- **返回** - **返回**
- str - str
**2.** `(group, /) -> str | Any` **2.** `(group, /) -> str | Any`
- **参数** - **参数**
- `group` (str | int) - `group` (str | int)
- **返回** - **返回**
- str | Any - str | Any
**3.** `(group1, group2, /, *groups) -> tuple[str | Any, ...]` **3.** `(group1, group2, /, *groups) -> tuple[str | Any, ...]`
- **参数** - **参数**
- `group1` (str | int) - `group1` (str | int)
- `group2` (str | int) - `group2` (str | int)
@@ -422,7 +384,6 @@ description: nonebot.params 模块
- `*groups` (str | int) - `*groups` (str | int)
- **返回** - **返回**
- tuple[str | Any, ...] - tuple[str | Any, ...]
## _def_ `RegexGroup()` {#RegexGroup} ## _def_ `RegexGroup()` {#RegexGroup}
@@ -434,7 +395,6 @@ description: nonebot.params 模块
empty empty
- **返回** - **返回**
- tuple[Any, ...] - tuple[Any, ...]
## _def_ `RegexDict()` {#RegexDict} ## _def_ `RegexDict()` {#RegexDict}
@@ -446,7 +406,6 @@ description: nonebot.params 模块
empty empty
- **返回** - **返回**
- dict[str, Any] - dict[str, Any]
## _def_ `Startswith()` {#Startswith} ## _def_ `Startswith()` {#Startswith}
@@ -458,7 +417,6 @@ description: nonebot.params 模块
empty empty
- **返回** - **返回**
- str - str
## _def_ `Endswith()` {#Endswith} ## _def_ `Endswith()` {#Endswith}
@@ -470,7 +428,6 @@ description: nonebot.params 模块
empty empty
- **返回** - **返回**
- str - str
## _def_ `Fullmatch()` {#Fullmatch} ## _def_ `Fullmatch()` {#Fullmatch}
@@ -482,7 +439,6 @@ description: nonebot.params 模块
empty empty
- **返回** - **返回**
- str - str
## _def_ `Keyword()` {#Keyword} ## _def_ `Keyword()` {#Keyword}
@@ -494,7 +450,6 @@ description: nonebot.params 模块
empty empty
- **返回** - **返回**
- str - str
## _def_ `Received(id=None, default=None)` {#Received} ## _def_ `Received(id=None, default=None)` {#Received}
@@ -502,13 +457,11 @@ description: nonebot.params 模块
- **说明:** `receive` 事件参数 - **说明:** `receive` 事件参数
- **参数** - **参数**
- `id` (str | None) - `id` (str | None)
- `default` (Any) - `default` (Any)
- **返回** - **返回**
- Any - Any
## _def_ `LastReceived(default=None)` {#LastReceived} ## _def_ `LastReceived(default=None)` {#LastReceived}
@@ -516,11 +469,9 @@ description: nonebot.params 模块
- **说明:** `last_receive` 事件参数 - **说明:** `last_receive` 事件参数
- **参数** - **参数**
- `default` (Any) - `default` (Any)
- **返回** - **返回**
- Any - Any
## _def_ `ReceivePromptResult(id=None)` {#ReceivePromptResult} ## _def_ `ReceivePromptResult(id=None)` {#ReceivePromptResult}
@@ -528,11 +479,9 @@ description: nonebot.params 模块
- **说明:** `receive` prompt 发送结果 - **说明:** `receive` prompt 发送结果
- **参数** - **参数**
- `id` (str | None) - `id` (str | None)
- **返回** - **返回**
- Any - Any
## _def_ `PausePromptResult()` {#PausePromptResult} ## _def_ `PausePromptResult()` {#PausePromptResult}
@@ -544,5 +493,4 @@ description: nonebot.params 模块
empty empty
- **返回** - **返回**
- Any - Any

View File

@@ -22,7 +22,6 @@ description: nonebot.permission 模块
如果 `perm` 中仅有 `User` 类型的权限检查函数,则会去除原有检查函数的会话 ID 限制。 如果 `perm` 中仅有 `User` 类型的权限检查函数,则会去除原有检查函数的会话 ID 限制。
- **参数** - **参数**
- `*users` (str) - `*users` (str)
- `perm` (Permission | None): 需要同时满足的权限 - `perm` (Permission | None): 需要同时满足的权限
@@ -30,7 +29,6 @@ description: nonebot.permission 模块
- `user`: 会话白名单 - `user`: 会话白名单
- **返回** - **返回**
- untyped - untyped
## _class_ `Permission(*checkers)` {#Permission} ## _class_ `Permission(*checkers)` {#Permission}
@@ -42,7 +40,6 @@ description: nonebot.permission 模块
当事件传递时,在 [Matcher](matcher.md#Matcher) 运行前进行检查。 当事件传递时,在 [Matcher](matcher.md#Matcher) 运行前进行检查。
- **参数** - **参数**
- `*checkers` ([T_PermissionChecker](typing.md#T-PermissionChecker) | [Dependent](dependencies/index.md#Dependent)[bool]): PermissionChecker - `*checkers` ([T_PermissionChecker](typing.md#T-PermissionChecker) | [Dependent](dependencies/index.md#Dependent)[bool]): PermissionChecker
- **用法** - **用法**
@@ -64,7 +61,6 @@ description: nonebot.permission 模块
- **说明:** 检查是否满足某个权限。 - **说明:** 检查是否满足某个权限。
- **参数** - **参数**
- `bot` ([Bot](adapters/index.md#Bot)): Bot 对象 - `bot` ([Bot](adapters/index.md#Bot)): Bot 对象
- `event` ([Event](adapters/index.md#Event)): Event 对象 - `event` ([Event](adapters/index.md#Event)): Event 对象
@@ -74,7 +70,6 @@ description: nonebot.permission 模块
- `dependency_cache` ([T_DependencyCache](typing.md#T-DependencyCache) | None): 依赖缓存 - `dependency_cache` ([T_DependencyCache](typing.md#T-DependencyCache) | None): 依赖缓存
- **返回** - **返回**
- bool - bool
## _class_ `User(users, perm=None)` {#User} ## _class_ `User(users, perm=None)` {#User}
@@ -82,7 +77,6 @@ description: nonebot.permission 模块
- **说明:** 检查当前事件是否属于指定会话。 - **说明:** 检查当前事件是否属于指定会话。
- **参数** - **参数**
- `users` (tuple[str, ...]): 会话 ID 元组 - `users` (tuple[str, ...]): 会话 ID 元组
- `perm` (Permission | None): 需同时满足的权限 - `perm` (Permission | None): 需同时满足的权限
@@ -96,13 +90,11 @@ description: nonebot.permission 模块
如果 `perm` 中仅有 `User` 类型的权限检查函数,则会去除原有的会话 ID 限制。 如果 `perm` 中仅有 `User` 类型的权限检查函数,则会去除原有的会话 ID 限制。
- **参数** - **参数**
- `event` ([Event](adapters/index.md#Event)): Event 对象 - `event` ([Event](adapters/index.md#Event)): Event 对象
- `perm` (Permission | None): 需同时满足的权限 - `perm` (Permission | None): 需同时满足的权限
- **返回** - **返回**
- Self - Self
### _classmethod_ `from_permission(*users, perm=None)` {#User-from-permission} ### _classmethod_ `from_permission(*users, perm=None)` {#User-from-permission}
@@ -114,13 +106,11 @@ description: nonebot.permission 模块
如果 `perm` 中仅有 `User` 类型的权限检查函数,则会去除原有的会话 ID 限制。 如果 `perm` 中仅有 `User` 类型的权限检查函数,则会去除原有的会话 ID 限制。
- **参数** - **参数**
- `*users` (str): 会话白名单 - `*users` (str): 会话白名单
- `perm` (Permission | None): 需同时满足的权限 - `perm` (Permission | None): 需同时满足的权限
- **返回** - **返回**
- Self - Self
## _class_ `Message(<auto>)` {#Message} ## _class_ `Message(<auto>)` {#Message}

View File

@@ -51,11 +51,9 @@ description: nonebot.plugin 模块
如果为嵌套的子插件,标识符为 `父插件标识符:子插件文件(夹)名` 如果为嵌套的子插件,标识符为 `父插件标识符:子插件文件(夹)名`
- **参数** - **参数**
- `plugin_id` (str): 插件标识符,即 [Plugin.id\_](model.md#Plugin-id-)。 - `plugin_id` (str): 插件标识符,即 [Plugin.id\_](model.md#Plugin-id-)。
- **返回** - **返回**
- [Plugin](model.md#Plugin) | None - [Plugin](model.md#Plugin) | None
## _def_ `get_plugin_by_module_name(module_name)` {#get-plugin-by-module-name} ## _def_ `get_plugin_by_module_name(module_name)` {#get-plugin-by-module-name}
@@ -67,11 +65,9 @@ description: nonebot.plugin 模块
如果提供的模块名为某个插件的子模块,同样会返回该插件。 如果提供的模块名为某个插件的子模块,同样会返回该插件。
- **参数** - **参数**
- `module_name` (str): 模块名,即 [Plugin.module_name](model.md#Plugin-module-name)。 - `module_name` (str): 模块名,即 [Plugin.module_name](model.md#Plugin-module-name)。
- **返回** - **返回**
- [Plugin](model.md#Plugin) | None - [Plugin](model.md#Plugin) | None
## _def_ `get_loaded_plugins()` {#get-loaded-plugins} ## _def_ `get_loaded_plugins()` {#get-loaded-plugins}
@@ -83,7 +79,6 @@ description: nonebot.plugin 模块
empty empty
- **返回** - **返回**
- set[[Plugin](model.md#Plugin)] - set[[Plugin](model.md#Plugin)]
## _def_ `get_available_plugin_names()` {#get-available-plugin-names} ## _def_ `get_available_plugin_names()` {#get-available-plugin-names}
@@ -95,7 +90,6 @@ description: nonebot.plugin 模块
empty empty
- **返回** - **返回**
- set[str] - set[str]
## _def_ `get_plugin_config(config)` {#get-plugin-config} ## _def_ `get_plugin_config(config)` {#get-plugin-config}
@@ -103,9 +97,7 @@ description: nonebot.plugin 模块
- **说明:** 从全局配置获取当前插件需要的配置项。 - **说明:** 从全局配置获取当前插件需要的配置项。
- **参数** - **参数**
- `config` (type[C]) - `config` (type[C])
- **返回** - **返回**
- C - C

View File

@@ -14,11 +14,9 @@ description: nonebot.plugin.load 模块
- **说明:** 加载单个插件,可以是本地插件或是通过 `pip` 安装的插件。 - **说明:** 加载单个插件,可以是本地插件或是通过 `pip` 安装的插件。
- **参数** - **参数**
- `module_path` (str | Path): 插件名称 `path.to.your.plugin` 或插件路径 `pathlib.Path(path/to/your/plugin)` - `module_path` (str | Path): 插件名称 `path.to.your.plugin` 或插件路径 `pathlib.Path(path/to/your/plugin)`
- **返回** - **返回**
- [Plugin](model.md#Plugin) | None - [Plugin](model.md#Plugin) | None
## _def_ `load_plugins(*plugin_dir)` {#load-plugins} ## _def_ `load_plugins(*plugin_dir)` {#load-plugins}
@@ -26,11 +24,9 @@ description: nonebot.plugin.load 模块
- **说明:** 导入文件夹下多个插件,以 `_` 开头的插件不会被导入! - **说明:** 导入文件夹下多个插件,以 `_` 开头的插件不会被导入!
- **参数** - **参数**
- `*plugin_dir` (str): 文件夹路径 - `*plugin_dir` (str): 文件夹路径
- **返回** - **返回**
- set[[Plugin](model.md#Plugin)] - set[[Plugin](model.md#Plugin)]
## _def_ `load_all_plugins(module_path, plugin_dir)` {#load-all-plugins} ## _def_ `load_all_plugins(module_path, plugin_dir)` {#load-all-plugins}
@@ -38,13 +34,11 @@ description: nonebot.plugin.load 模块
- **说明:** 导入指定列表中的插件以及指定目录下多个插件,以 `_` 开头的插件不会被导入! - **说明:** 导入指定列表中的插件以及指定目录下多个插件,以 `_` 开头的插件不会被导入!
- **参数** - **参数**
- `module_path` (Iterable[str]): 指定插件集合 - `module_path` (Iterable[str]): 指定插件集合
- `plugin_dir` (Iterable[str]): 指定文件夹路径集合 - `plugin_dir` (Iterable[str]): 指定文件夹路径集合
- **返回** - **返回**
- set[[Plugin](model.md#Plugin)] - set[[Plugin](model.md#Plugin)]
## _def_ `load_from_json(file_path, encoding="utf-8")` {#load-from-json} ## _def_ `load_from_json(file_path, encoding="utf-8")` {#load-from-json}
@@ -52,13 +46,11 @@ description: nonebot.plugin.load 模块
- **说明:** 导入指定 json 文件中的 `plugins` 以及 `plugin_dirs` 下多个插件。 以 `_` 开头的插件不会被导入! - **说明:** 导入指定 json 文件中的 `plugins` 以及 `plugin_dirs` 下多个插件。 以 `_` 开头的插件不会被导入!
- **参数** - **参数**
- `file_path` (str): 指定 json 文件路径 - `file_path` (str): 指定 json 文件路径
- `encoding` (str): 指定 json 文件编码 - `encoding` (str): 指定 json 文件编码
- **返回** - **返回**
- set[[Plugin](model.md#Plugin)] - set[[Plugin](model.md#Plugin)]
- **用法** - **用法**
@@ -79,13 +71,11 @@ description: nonebot.plugin.load 模块
- **说明:** 导入指定 toml 文件 `[tool.nonebot]` 中的 `plugins` 以及 `plugin_dirs` 下多个插件。 以 `_` 开头的插件不会被导入! - **说明:** 导入指定 toml 文件 `[tool.nonebot]` 中的 `plugins` 以及 `plugin_dirs` 下多个插件。 以 `_` 开头的插件不会被导入!
- **参数** - **参数**
- `file_path` (str): 指定 toml 文件路径 - `file_path` (str): 指定 toml 文件路径
- `encoding` (str): 指定 toml 文件编码 - `encoding` (str): 指定 toml 文件编码
- **返回** - **返回**
- set[[Plugin](model.md#Plugin)] - set[[Plugin](model.md#Plugin)]
- **用法** - **用法**
@@ -105,11 +95,9 @@ description: nonebot.plugin.load 模块
- **说明:** 导入 NoneBot 内置插件。 - **说明:** 导入 NoneBot 内置插件。
- **参数** - **参数**
- `name` (str): 插件名称 - `name` (str): 插件名称
- **返回** - **返回**
- [Plugin](model.md#Plugin) | None - [Plugin](model.md#Plugin) | None
## _def_ `load_builtin_plugins(*plugins)` {#load-builtin-plugins} ## _def_ `load_builtin_plugins(*plugins)` {#load-builtin-plugins}
@@ -117,11 +105,9 @@ description: nonebot.plugin.load 模块
- **说明:** 导入多个 NoneBot 内置插件。 - **说明:** 导入多个 NoneBot 内置插件。
- **参数** - **参数**
- `*plugins` (str): 插件名称列表 - `*plugins` (str): 插件名称列表
- **返回** - **返回**
- set[[Plugin](model.md#Plugin)] - set[[Plugin](model.md#Plugin)]
## _def_ `require(name)` {#require} ## _def_ `require(name)` {#require}
@@ -129,15 +115,12 @@ description: nonebot.plugin.load 模块
- **说明:** 声明依赖插件。 - **说明:** 声明依赖插件。
- **参数** - **参数**
- `name` (str): 插件模块名或插件标识符,仅在已声明插件的情况下可使用标识符。 - `name` (str): 插件模块名或插件标识符,仅在已声明插件的情况下可使用标识符。
- **返回** - **返回**
- ModuleType - ModuleType
- **异常** - **异常**
- RuntimeError: 插件无法加载 - RuntimeError: 插件无法加载
## _def_ `inherit_supported_adapters(*names)` {#inherit-supported-adapters} ## _def_ `inherit_supported_adapters(*names)` {#inherit-supported-adapters}
@@ -149,15 +132,12 @@ description: nonebot.plugin.load 模块
如果传入了多个插件名称,返回值会自动取交集。 如果传入了多个插件名称,返回值会自动取交集。
- **参数** - **参数**
- `*names` (str): 插件名称列表。 - `*names` (str): 插件名称列表。
- **返回** - **返回**
- set[str] | None - set[str] | None
- **异常** - **异常**
- RuntimeError: 插件未加载 - RuntimeError: 插件未加载
- ValueError: 插件缺少元数据 - ValueError: 插件缺少元数据

View File

@@ -16,7 +16,6 @@ description: nonebot.plugin.manager 模块
- **说明:** 插件管理器。 - **说明:** 插件管理器。
- **参数** - **参数**
- `plugins` (Iterable[str] | None): 独立插件模块名集合。 - `plugins` (Iterable[str] | None): 独立插件模块名集合。
- `search_path` (Iterable[str] | None): 插件搜索路径(文件夹),相对于当前工作目录。 - `search_path` (Iterable[str] | None): 插件搜索路径(文件夹),相对于当前工作目录。
@@ -54,11 +53,9 @@ description: nonebot.plugin.manager 模块
可以使用完整插件模块名或者插件标识符加载。 可以使用完整插件模块名或者插件标识符加载。
- **参数** - **参数**
- `name` (str): 插件名称或插件标识符。 - `name` (str): 插件名称或插件标识符。
- **返回** - **返回**
- [Plugin](model.md#Plugin) | None - [Plugin](model.md#Plugin) | None
### _method_ `load_all_plugins()` {#PluginManager-load-all-plugins} ### _method_ `load_all_plugins()` {#PluginManager-load-all-plugins}
@@ -70,7 +67,6 @@ description: nonebot.plugin.manager 模块
empty empty
- **返回** - **返回**
- set[[Plugin](model.md#Plugin)] - set[[Plugin](model.md#Plugin)]
## _class_ `PluginFinder(<auto>)` {#PluginFinder} ## _class_ `PluginFinder(<auto>)` {#PluginFinder}
@@ -82,7 +78,6 @@ description: nonebot.plugin.manager 模块
### _method_ `find_spec(fullname, path, target=None)` {#PluginFinder-find-spec} ### _method_ `find_spec(fullname, path, target=None)` {#PluginFinder-find-spec}
- **参数** - **参数**
- `fullname` (str) - `fullname` (str)
- `path` (Sequence[str] | None) - `path` (Sequence[str] | None)
@@ -90,13 +85,11 @@ description: nonebot.plugin.manager 模块
- `target` (ModuleType | None) - `target` (ModuleType | None)
- **返回** - **返回**
- untyped - untyped
## _class_ `PluginLoader(manager, fullname, path)` {#PluginLoader} ## _class_ `PluginLoader(manager, fullname, path)` {#PluginLoader}
- **参数** - **参数**
- `manager` (PluginManager) - `manager` (PluginManager)
- `fullname` (str) - `fullname` (str)
@@ -106,19 +99,15 @@ description: nonebot.plugin.manager 模块
### _method_ `create_module(spec)` {#PluginLoader-create-module} ### _method_ `create_module(spec)` {#PluginLoader-create-module}
- **参数** - **参数**
- `spec` - `spec`
- **返回** - **返回**
- ModuleType | None - ModuleType | None
### _method_ `exec_module(module)` {#PluginLoader-exec-module} ### _method_ `exec_module(module)` {#PluginLoader-exec-module}
- **参数** - **参数**
- `module` (ModuleType) - `module` (ModuleType)
- **返回** - **返回**
- None - None

View File

@@ -80,7 +80,6 @@ description: nonebot.plugin.model 模块
empty empty
- **返回** - **返回**
- set[type[[Adapter](../adapters/index.md#Adapter)]] | None - set[type[[Adapter](../adapters/index.md#Adapter)]] | None
## _class_ `Plugin(<auto>)` {#Plugin} ## _class_ `Plugin(<auto>)` {#Plugin}

View File

@@ -14,11 +14,9 @@ description: nonebot.plugin.on 模块
- **说明:** 存储一个事件响应器到插件。 - **说明:** 存储一个事件响应器到插件。
- **参数** - **参数**
- `matcher` (type[[Matcher](../matcher.md#Matcher)]): 事件响应器 - `matcher` (type[[Matcher](../matcher.md#Matcher)]): 事件响应器
- **返回** - **返回**
- None - None
## _def_ `get_matcher_plugin(depth=...)` {#get-matcher-plugin} ## _def_ `get_matcher_plugin(depth=...)` {#get-matcher-plugin}
@@ -30,11 +28,9 @@ description: nonebot.plugin.on 模块
**Deprecated**, 请使用 [get_matcher_source](#get-matcher-source) 获取信息。 **Deprecated**, 请使用 [get_matcher_source](#get-matcher-source) 获取信息。
- **参数** - **参数**
- `depth` (int): 调用栈深度 - `depth` (int): 调用栈深度
- **返回** - **返回**
- [Plugin](model.md#Plugin) | None - [Plugin](model.md#Plugin) | None
## _def_ `get_matcher_module(depth=...)` {#get-matcher-module} ## _def_ `get_matcher_module(depth=...)` {#get-matcher-module}
@@ -46,11 +42,9 @@ description: nonebot.plugin.on 模块
**Deprecated**, 请使用 [get_matcher_source](#get-matcher-source) 获取信息。 **Deprecated**, 请使用 [get_matcher_source](#get-matcher-source) 获取信息。
- **参数** - **参数**
- `depth` (int): 调用栈深度 - `depth` (int): 调用栈深度
- **返回** - **返回**
- ModuleType | None - ModuleType | None
## _def_ `get_matcher_source(depth=...)` {#get-matcher-source} ## _def_ `get_matcher_source(depth=...)` {#get-matcher-source}
@@ -58,11 +52,9 @@ description: nonebot.plugin.on 模块
- **说明:** 获取事件响应器定义所在源码信息。 - **说明:** 获取事件响应器定义所在源码信息。
- **参数** - **参数**
- `depth` (int): 调用栈深度 - `depth` (int): 调用栈深度
- **返回** - **返回**
- MatcherSource | None - MatcherSource | None
## _def_ `on(type="", rule=..., permission=..., *, handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#on} ## _def_ `on(type="", rule=..., permission=..., *, handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#on}
@@ -70,7 +62,6 @@ description: nonebot.plugin.on 模块
- **说明:** 注册一个基础事件响应器,可自定义类型。 - **说明:** 注册一个基础事件响应器,可自定义类型。
- **参数** - **参数**
- `type` (str): 事件响应器类型 - `type` (str): 事件响应器类型
- `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则 - `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则
@@ -90,7 +81,6 @@ description: nonebot.plugin.on 模块
- `state` ([T_State](../typing.md#T-State) | None): 默认 state - `state` ([T_State](../typing.md#T-State) | None): 默认 state
- **返回** - **返回**
- type[[Matcher](../matcher.md#Matcher)] - type[[Matcher](../matcher.md#Matcher)]
## _def_ `on_metaevent(rule=..., permission=..., *, handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#on-metaevent} ## _def_ `on_metaevent(rule=..., permission=..., *, handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#on-metaevent}
@@ -98,7 +88,6 @@ description: nonebot.plugin.on 模块
- **说明:** 注册一个元事件响应器。 - **说明:** 注册一个元事件响应器。
- **参数** - **参数**
- `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则 - `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则
- `permission` ([Permission](../permission.md#Permission) | [T_PermissionChecker](../typing.md#T-PermissionChecker) | None): 事件响应权限 - `permission` ([Permission](../permission.md#Permission) | [T_PermissionChecker](../typing.md#T-PermissionChecker) | None): 事件响应权限
@@ -116,7 +105,6 @@ description: nonebot.plugin.on 模块
- `state` ([T_State](../typing.md#T-State) | None): 默认 state - `state` ([T_State](../typing.md#T-State) | None): 默认 state
- **返回** - **返回**
- type[[Matcher](../matcher.md#Matcher)] - type[[Matcher](../matcher.md#Matcher)]
## _def_ `on_message(rule=..., permission=..., *, handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#on-message} ## _def_ `on_message(rule=..., permission=..., *, handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#on-message}
@@ -124,7 +112,6 @@ description: nonebot.plugin.on 模块
- **说明:** 注册一个消息事件响应器。 - **说明:** 注册一个消息事件响应器。
- **参数** - **参数**
- `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则 - `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则
- `permission` ([Permission](../permission.md#Permission) | [T_PermissionChecker](../typing.md#T-PermissionChecker) | None): 事件响应权限 - `permission` ([Permission](../permission.md#Permission) | [T_PermissionChecker](../typing.md#T-PermissionChecker) | None): 事件响应权限
@@ -142,7 +129,6 @@ description: nonebot.plugin.on 模块
- `state` ([T_State](../typing.md#T-State) | None): 默认 state - `state` ([T_State](../typing.md#T-State) | None): 默认 state
- **返回** - **返回**
- type[[Matcher](../matcher.md#Matcher)] - type[[Matcher](../matcher.md#Matcher)]
## _def_ `on_notice(rule=..., permission=..., *, handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#on-notice} ## _def_ `on_notice(rule=..., permission=..., *, handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#on-notice}
@@ -150,7 +136,6 @@ description: nonebot.plugin.on 模块
- **说明:** 注册一个通知事件响应器。 - **说明:** 注册一个通知事件响应器。
- **参数** - **参数**
- `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则 - `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则
- `permission` ([Permission](../permission.md#Permission) | [T_PermissionChecker](../typing.md#T-PermissionChecker) | None): 事件响应权限 - `permission` ([Permission](../permission.md#Permission) | [T_PermissionChecker](../typing.md#T-PermissionChecker) | None): 事件响应权限
@@ -168,7 +153,6 @@ description: nonebot.plugin.on 模块
- `state` ([T_State](../typing.md#T-State) | None): 默认 state - `state` ([T_State](../typing.md#T-State) | None): 默认 state
- **返回** - **返回**
- type[[Matcher](../matcher.md#Matcher)] - type[[Matcher](../matcher.md#Matcher)]
## _def_ `on_request(rule=..., permission=..., *, handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#on-request} ## _def_ `on_request(rule=..., permission=..., *, handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#on-request}
@@ -176,7 +160,6 @@ description: nonebot.plugin.on 模块
- **说明:** 注册一个请求事件响应器。 - **说明:** 注册一个请求事件响应器。
- **参数** - **参数**
- `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则 - `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则
- `permission` ([Permission](../permission.md#Permission) | [T_PermissionChecker](../typing.md#T-PermissionChecker) | None): 事件响应权限 - `permission` ([Permission](../permission.md#Permission) | [T_PermissionChecker](../typing.md#T-PermissionChecker) | None): 事件响应权限
@@ -194,7 +177,6 @@ description: nonebot.plugin.on 模块
- `state` ([T_State](../typing.md#T-State) | None): 默认 state - `state` ([T_State](../typing.md#T-State) | None): 默认 state
- **返回** - **返回**
- type[[Matcher](../matcher.md#Matcher)] - type[[Matcher](../matcher.md#Matcher)]
## _def_ `on_startswith(msg, rule=..., ignorecase=..., *, permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#on-startswith} ## _def_ `on_startswith(msg, rule=..., ignorecase=..., *, permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#on-startswith}
@@ -202,7 +184,6 @@ description: nonebot.plugin.on 模块
- **说明:** 注册一个消息事件响应器,并且当消息的**文本部分**以指定内容开头时响应。 - **说明:** 注册一个消息事件响应器,并且当消息的**文本部分**以指定内容开头时响应。
- **参数** - **参数**
- `msg` (str | tuple[str, ...]): 指定消息开头内容 - `msg` (str | tuple[str, ...]): 指定消息开头内容
- `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则 - `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则
@@ -224,7 +205,6 @@ description: nonebot.plugin.on 模块
- `state` ([T_State](../typing.md#T-State) | None): 默认 state - `state` ([T_State](../typing.md#T-State) | None): 默认 state
- **返回** - **返回**
- type[[Matcher](../matcher.md#Matcher)] - type[[Matcher](../matcher.md#Matcher)]
## _def_ `on_endswith(msg, rule=..., ignorecase=..., *, permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#on-endswith} ## _def_ `on_endswith(msg, rule=..., ignorecase=..., *, permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#on-endswith}
@@ -232,7 +212,6 @@ description: nonebot.plugin.on 模块
- **说明:** 注册一个消息事件响应器,并且当消息的**文本部分**以指定内容结尾时响应。 - **说明:** 注册一个消息事件响应器,并且当消息的**文本部分**以指定内容结尾时响应。
- **参数** - **参数**
- `msg` (str | tuple[str, ...]): 指定消息结尾内容 - `msg` (str | tuple[str, ...]): 指定消息结尾内容
- `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则 - `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则
@@ -254,7 +233,6 @@ description: nonebot.plugin.on 模块
- `state` ([T_State](../typing.md#T-State) | None): 默认 state - `state` ([T_State](../typing.md#T-State) | None): 默认 state
- **返回** - **返回**
- type[[Matcher](../matcher.md#Matcher)] - type[[Matcher](../matcher.md#Matcher)]
## _def_ `on_fullmatch(msg, rule=..., ignorecase=..., *, permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#on-fullmatch} ## _def_ `on_fullmatch(msg, rule=..., ignorecase=..., *, permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#on-fullmatch}
@@ -262,7 +240,6 @@ description: nonebot.plugin.on 模块
- **说明:** 注册一个消息事件响应器,并且当消息的**文本部分**与指定内容完全一致时响应。 - **说明:** 注册一个消息事件响应器,并且当消息的**文本部分**与指定内容完全一致时响应。
- **参数** - **参数**
- `msg` (str | tuple[str, ...]): 指定消息全匹配内容 - `msg` (str | tuple[str, ...]): 指定消息全匹配内容
- `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则 - `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则
@@ -284,7 +261,6 @@ description: nonebot.plugin.on 模块
- `state` ([T_State](../typing.md#T-State) | None): 默认 state - `state` ([T_State](../typing.md#T-State) | None): 默认 state
- **返回** - **返回**
- type[[Matcher](../matcher.md#Matcher)] - type[[Matcher](../matcher.md#Matcher)]
## _def_ `on_keyword(keywords, rule=..., *, permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#on-keyword} ## _def_ `on_keyword(keywords, rule=..., *, permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#on-keyword}
@@ -292,7 +268,6 @@ description: nonebot.plugin.on 模块
- **说明:** 注册一个消息事件响应器,并且当消息纯文本部分包含关键词时响应。 - **说明:** 注册一个消息事件响应器,并且当消息纯文本部分包含关键词时响应。
- **参数** - **参数**
- `keywords` (set[str]): 关键词列表 - `keywords` (set[str]): 关键词列表
- `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则 - `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则
@@ -312,7 +287,6 @@ description: nonebot.plugin.on 模块
- `state` ([T_State](../typing.md#T-State) | None): 默认 state - `state` ([T_State](../typing.md#T-State) | None): 默认 state
- **返回** - **返回**
- type[[Matcher](../matcher.md#Matcher)] - type[[Matcher](../matcher.md#Matcher)]
## _def_ `on_command(cmd, rule=..., aliases=..., force_whitespace=..., *, permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#on-command} ## _def_ `on_command(cmd, rule=..., aliases=..., force_whitespace=..., *, permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#on-command}
@@ -324,7 +298,6 @@ description: nonebot.plugin.on 模块
命令匹配规则参考: `命令形式匹配 <rule.md#command-command>`\_ 命令匹配规则参考: `命令形式匹配 <rule.md#command-command>`\_
- **参数** - **参数**
- `cmd` (str | tuple[str, ...]): 指定命令内容 - `cmd` (str | tuple[str, ...]): 指定命令内容
- `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则 - `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则
@@ -348,7 +321,6 @@ description: nonebot.plugin.on 模块
- `state` ([T_State](../typing.md#T-State) | None): 默认 state - `state` ([T_State](../typing.md#T-State) | None): 默认 state
- **返回** - **返回**
- type[[Matcher](../matcher.md#Matcher)] - type[[Matcher](../matcher.md#Matcher)]
## _def_ `on_shell_command(cmd, rule=..., aliases=..., parser=..., *, permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#on-shell-command} ## _def_ `on_shell_command(cmd, rule=..., aliases=..., parser=..., *, permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#on-shell-command}
@@ -363,7 +335,6 @@ description: nonebot.plugin.on 模块
通过 [ShellCommandArgs](../params.md#ShellCommandArgs) 获取解析后的参数字典。 通过 [ShellCommandArgs](../params.md#ShellCommandArgs) 获取解析后的参数字典。
- **参数** - **参数**
- `cmd` (str | tuple[str, ...]): 指定命令内容 - `cmd` (str | tuple[str, ...]): 指定命令内容
- `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则 - `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则
@@ -387,7 +358,6 @@ description: nonebot.plugin.on 模块
- `state` ([T_State](../typing.md#T-State) | None): 默认 state - `state` ([T_State](../typing.md#T-State) | None): 默认 state
- **返回** - **返回**
- type[[Matcher](../matcher.md#Matcher)] - type[[Matcher](../matcher.md#Matcher)]
## _def_ `on_regex(pattern, flags=..., rule=..., *, permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#on-regex} ## _def_ `on_regex(pattern, flags=..., rule=..., *, permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#on-regex}
@@ -399,7 +369,6 @@ description: nonebot.plugin.on 模块
命令匹配规则参考: `正则匹配 <rule.md#regex-regex-flags-0>`\_ 命令匹配规则参考: `正则匹配 <rule.md#regex-regex-flags-0>`\_
- **参数** - **参数**
- `pattern` (str): 正则表达式 - `pattern` (str): 正则表达式
- `flags` (int | re.RegexFlag): 正则匹配标志 - `flags` (int | re.RegexFlag): 正则匹配标志
@@ -421,7 +390,6 @@ description: nonebot.plugin.on 模块
- `state` ([T_State](../typing.md#T-State) | None): 默认 state - `state` ([T_State](../typing.md#T-State) | None): 默认 state
- **返回** - **返回**
- type[[Matcher](../matcher.md#Matcher)] - type[[Matcher](../matcher.md#Matcher)]
## _def_ `on_type(types, rule=..., *, permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#on-type} ## _def_ `on_type(types, rule=..., *, permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#on-type}
@@ -429,7 +397,6 @@ description: nonebot.plugin.on 模块
- **说明:** 注册一个事件响应器,并且当事件为指定类型时响应。 - **说明:** 注册一个事件响应器,并且当事件为指定类型时响应。
- **参数** - **参数**
- `types` (type[[Event](../adapters/index.md#Event)] | tuple[type[[Event](../adapters/index.md#Event)], ...]): 事件类型 - `types` (type[[Event](../adapters/index.md#Event)] | tuple[type[[Event](../adapters/index.md#Event)], ...]): 事件类型
- `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则 - `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则
@@ -449,13 +416,11 @@ description: nonebot.plugin.on 模块
- `state` ([T_State](../typing.md#T-State) | None): 默认 state - `state` ([T_State](../typing.md#T-State) | None): 默认 state
- **返回** - **返回**
- type[[Matcher](../matcher.md#Matcher)] - type[[Matcher](../matcher.md#Matcher)]
## _class_ `CommandGroup(cmd, prefix_aliases=..., *, rule=..., permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#CommandGroup} ## _class_ `CommandGroup(cmd, prefix_aliases=..., *, rule=..., permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#CommandGroup}
- **参数** - **参数**
- `cmd` (str | tuple[str, ...]) - `cmd` (str | tuple[str, ...])
- `prefix_aliases` (bool) - `prefix_aliases` (bool)
@@ -481,7 +446,6 @@ description: nonebot.plugin.on 模块
- **说明:** 注册一个新的命令。新参数将会覆盖命令组默认值 - **说明:** 注册一个新的命令。新参数将会覆盖命令组默认值
- **参数** - **参数**
- `cmd` (str | tuple[str, ...]): 指定命令内容 - `cmd` (str | tuple[str, ...]): 指定命令内容
- `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则 - `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则
@@ -505,7 +469,6 @@ description: nonebot.plugin.on 模块
- `state` ([T_State](../typing.md#T-State) | None): 默认 state - `state` ([T_State](../typing.md#T-State) | None): 默认 state
- **返回** - **返回**
- type[[Matcher](../matcher.md#Matcher)] - type[[Matcher](../matcher.md#Matcher)]
### _method_ `shell_command(cmd, *, rule=..., aliases=..., parser=..., permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#CommandGroup-shell-command} ### _method_ `shell_command(cmd, *, rule=..., aliases=..., parser=..., permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#CommandGroup-shell-command}
@@ -513,7 +476,6 @@ description: nonebot.plugin.on 模块
- **说明:** 注册一个新的 `shell_like` 命令。新参数将会覆盖命令组默认值 - **说明:** 注册一个新的 `shell_like` 命令。新参数将会覆盖命令组默认值
- **参数** - **参数**
- `cmd` (str | tuple[str, ...]): 指定命令内容 - `cmd` (str | tuple[str, ...]): 指定命令内容
- `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则 - `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则
@@ -537,13 +499,11 @@ description: nonebot.plugin.on 模块
- `state` ([T_State](../typing.md#T-State) | None): 默认 state - `state` ([T_State](../typing.md#T-State) | None): 默认 state
- **返回** - **返回**
- type[[Matcher](../matcher.md#Matcher)] - type[[Matcher](../matcher.md#Matcher)]
## _class_ `MatcherGroup(*, type=..., rule=..., permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#MatcherGroup} ## _class_ `MatcherGroup(*, type=..., rule=..., permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#MatcherGroup}
- **参数** - **参数**
- `type` (str) - `type` (str)
- `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None) - `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None)
@@ -567,7 +527,6 @@ description: nonebot.plugin.on 模块
- **说明:** 注册一个基础事件响应器,可自定义类型。 - **说明:** 注册一个基础事件响应器,可自定义类型。
- **参数** - **参数**
- `type` (str): 事件响应器类型 - `type` (str): 事件响应器类型
- `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则 - `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则
@@ -587,7 +546,6 @@ description: nonebot.plugin.on 模块
- `state` ([T_State](../typing.md#T-State) | None): 默认 state - `state` ([T_State](../typing.md#T-State) | None): 默认 state
- **返回** - **返回**
- type[[Matcher](../matcher.md#Matcher)] - type[[Matcher](../matcher.md#Matcher)]
### _method_ `on_metaevent(*, rule=..., permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#MatcherGroup-on-metaevent} ### _method_ `on_metaevent(*, rule=..., permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#MatcherGroup-on-metaevent}
@@ -595,7 +553,6 @@ description: nonebot.plugin.on 模块
- **说明:** 注册一个元事件响应器。 - **说明:** 注册一个元事件响应器。
- **参数** - **参数**
- `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则 - `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则
- `permission` ([Permission](../permission.md#Permission) | [T_PermissionChecker](../typing.md#T-PermissionChecker) | None): 事件响应权限 - `permission` ([Permission](../permission.md#Permission) | [T_PermissionChecker](../typing.md#T-PermissionChecker) | None): 事件响应权限
@@ -613,7 +570,6 @@ description: nonebot.plugin.on 模块
- `state` ([T_State](../typing.md#T-State) | None): 默认 state - `state` ([T_State](../typing.md#T-State) | None): 默认 state
- **返回** - **返回**
- type[[Matcher](../matcher.md#Matcher)] - type[[Matcher](../matcher.md#Matcher)]
### _method_ `on_message(*, rule=..., permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#MatcherGroup-on-message} ### _method_ `on_message(*, rule=..., permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#MatcherGroup-on-message}
@@ -621,7 +577,6 @@ description: nonebot.plugin.on 模块
- **说明:** 注册一个消息事件响应器。 - **说明:** 注册一个消息事件响应器。
- **参数** - **参数**
- `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则 - `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则
- `permission` ([Permission](../permission.md#Permission) | [T_PermissionChecker](../typing.md#T-PermissionChecker) | None): 事件响应权限 - `permission` ([Permission](../permission.md#Permission) | [T_PermissionChecker](../typing.md#T-PermissionChecker) | None): 事件响应权限
@@ -639,7 +594,6 @@ description: nonebot.plugin.on 模块
- `state` ([T_State](../typing.md#T-State) | None): 默认 state - `state` ([T_State](../typing.md#T-State) | None): 默认 state
- **返回** - **返回**
- type[[Matcher](../matcher.md#Matcher)] - type[[Matcher](../matcher.md#Matcher)]
### _method_ `on_notice(*, rule=..., permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#MatcherGroup-on-notice} ### _method_ `on_notice(*, rule=..., permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#MatcherGroup-on-notice}
@@ -647,7 +601,6 @@ description: nonebot.plugin.on 模块
- **说明:** 注册一个通知事件响应器。 - **说明:** 注册一个通知事件响应器。
- **参数** - **参数**
- `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则 - `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则
- `permission` ([Permission](../permission.md#Permission) | [T_PermissionChecker](../typing.md#T-PermissionChecker) | None): 事件响应权限 - `permission` ([Permission](../permission.md#Permission) | [T_PermissionChecker](../typing.md#T-PermissionChecker) | None): 事件响应权限
@@ -665,7 +618,6 @@ description: nonebot.plugin.on 模块
- `state` ([T_State](../typing.md#T-State) | None): 默认 state - `state` ([T_State](../typing.md#T-State) | None): 默认 state
- **返回** - **返回**
- type[[Matcher](../matcher.md#Matcher)] - type[[Matcher](../matcher.md#Matcher)]
### _method_ `on_request(*, rule=..., permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#MatcherGroup-on-request} ### _method_ `on_request(*, rule=..., permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#MatcherGroup-on-request}
@@ -673,7 +625,6 @@ description: nonebot.plugin.on 模块
- **说明:** 注册一个请求事件响应器。 - **说明:** 注册一个请求事件响应器。
- **参数** - **参数**
- `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则 - `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则
- `permission` ([Permission](../permission.md#Permission) | [T_PermissionChecker](../typing.md#T-PermissionChecker) | None): 事件响应权限 - `permission` ([Permission](../permission.md#Permission) | [T_PermissionChecker](../typing.md#T-PermissionChecker) | None): 事件响应权限
@@ -691,7 +642,6 @@ description: nonebot.plugin.on 模块
- `state` ([T_State](../typing.md#T-State) | None): 默认 state - `state` ([T_State](../typing.md#T-State) | None): 默认 state
- **返回** - **返回**
- type[[Matcher](../matcher.md#Matcher)] - type[[Matcher](../matcher.md#Matcher)]
### _method_ `on_startswith(msg, *, ignorecase=..., rule=..., permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#MatcherGroup-on-startswith} ### _method_ `on_startswith(msg, *, ignorecase=..., rule=..., permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#MatcherGroup-on-startswith}
@@ -699,7 +649,6 @@ description: nonebot.plugin.on 模块
- **说明:** 注册一个消息事件响应器,并且当消息的**文本部分**以指定内容开头时响应。 - **说明:** 注册一个消息事件响应器,并且当消息的**文本部分**以指定内容开头时响应。
- **参数** - **参数**
- `msg` (str | tuple[str, ...]): 指定消息开头内容 - `msg` (str | tuple[str, ...]): 指定消息开头内容
- `ignorecase` (bool): 是否忽略大小写 - `ignorecase` (bool): 是否忽略大小写
@@ -721,7 +670,6 @@ description: nonebot.plugin.on 模块
- `state` ([T_State](../typing.md#T-State) | None): 默认 state - `state` ([T_State](../typing.md#T-State) | None): 默认 state
- **返回** - **返回**
- type[[Matcher](../matcher.md#Matcher)] - type[[Matcher](../matcher.md#Matcher)]
### _method_ `on_endswith(msg, *, ignorecase=..., rule=..., permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#MatcherGroup-on-endswith} ### _method_ `on_endswith(msg, *, ignorecase=..., rule=..., permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#MatcherGroup-on-endswith}
@@ -729,7 +677,6 @@ description: nonebot.plugin.on 模块
- **说明:** 注册一个消息事件响应器,并且当消息的**文本部分**以指定内容结尾时响应。 - **说明:** 注册一个消息事件响应器,并且当消息的**文本部分**以指定内容结尾时响应。
- **参数** - **参数**
- `msg` (str | tuple[str, ...]): 指定消息结尾内容 - `msg` (str | tuple[str, ...]): 指定消息结尾内容
- `ignorecase` (bool): 是否忽略大小写 - `ignorecase` (bool): 是否忽略大小写
@@ -751,7 +698,6 @@ description: nonebot.plugin.on 模块
- `state` ([T_State](../typing.md#T-State) | None): 默认 state - `state` ([T_State](../typing.md#T-State) | None): 默认 state
- **返回** - **返回**
- type[[Matcher](../matcher.md#Matcher)] - type[[Matcher](../matcher.md#Matcher)]
### _method_ `on_fullmatch(msg, *, ignorecase=..., rule=..., permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#MatcherGroup-on-fullmatch} ### _method_ `on_fullmatch(msg, *, ignorecase=..., rule=..., permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#MatcherGroup-on-fullmatch}
@@ -759,7 +705,6 @@ description: nonebot.plugin.on 模块
- **说明:** 注册一个消息事件响应器,并且当消息的**文本部分**与指定内容完全一致时响应。 - **说明:** 注册一个消息事件响应器,并且当消息的**文本部分**与指定内容完全一致时响应。
- **参数** - **参数**
- `msg` (str | tuple[str, ...]): 指定消息全匹配内容 - `msg` (str | tuple[str, ...]): 指定消息全匹配内容
- `ignorecase` (bool): 是否忽略大小写 - `ignorecase` (bool): 是否忽略大小写
@@ -781,7 +726,6 @@ description: nonebot.plugin.on 模块
- `state` ([T_State](../typing.md#T-State) | None): 默认 state - `state` ([T_State](../typing.md#T-State) | None): 默认 state
- **返回** - **返回**
- type[[Matcher](../matcher.md#Matcher)] - type[[Matcher](../matcher.md#Matcher)]
### _method_ `on_keyword(keywords, *, rule=..., permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#MatcherGroup-on-keyword} ### _method_ `on_keyword(keywords, *, rule=..., permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#MatcherGroup-on-keyword}
@@ -789,7 +733,6 @@ description: nonebot.plugin.on 模块
- **说明:** 注册一个消息事件响应器,并且当消息纯文本部分包含关键词时响应。 - **说明:** 注册一个消息事件响应器,并且当消息纯文本部分包含关键词时响应。
- **参数** - **参数**
- `keywords` (set[str]): 关键词列表 - `keywords` (set[str]): 关键词列表
- `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则 - `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则
@@ -809,7 +752,6 @@ description: nonebot.plugin.on 模块
- `state` ([T_State](../typing.md#T-State) | None): 默认 state - `state` ([T_State](../typing.md#T-State) | None): 默认 state
- **返回** - **返回**
- type[[Matcher](../matcher.md#Matcher)] - type[[Matcher](../matcher.md#Matcher)]
### _method_ `on_command(cmd, aliases=..., force_whitespace=..., *, rule=..., permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#MatcherGroup-on-command} ### _method_ `on_command(cmd, aliases=..., force_whitespace=..., *, rule=..., permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#MatcherGroup-on-command}
@@ -821,7 +763,6 @@ description: nonebot.plugin.on 模块
命令匹配规则参考: `命令形式匹配 <rule.md#command-command>`\_ 命令匹配规则参考: `命令形式匹配 <rule.md#command-command>`\_
- **参数** - **参数**
- `cmd` (str | tuple[str, ...]): 指定命令内容 - `cmd` (str | tuple[str, ...]): 指定命令内容
- `aliases` (set[str | tuple[str, ...]] | None): 命令别名 - `aliases` (set[str | tuple[str, ...]] | None): 命令别名
@@ -845,7 +786,6 @@ description: nonebot.plugin.on 模块
- `state` ([T_State](../typing.md#T-State) | None): 默认 state - `state` ([T_State](../typing.md#T-State) | None): 默认 state
- **返回** - **返回**
- type[[Matcher](../matcher.md#Matcher)] - type[[Matcher](../matcher.md#Matcher)]
### _method_ `on_shell_command(cmd, aliases=..., parser=..., *, rule=..., permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#MatcherGroup-on-shell-command} ### _method_ `on_shell_command(cmd, aliases=..., parser=..., *, rule=..., permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#MatcherGroup-on-shell-command}
@@ -860,7 +800,6 @@ description: nonebot.plugin.on 模块
通过 [ShellCommandArgs](../params.md#ShellCommandArgs) 获取解析后的参数字典。 通过 [ShellCommandArgs](../params.md#ShellCommandArgs) 获取解析后的参数字典。
- **参数** - **参数**
- `cmd` (str | tuple[str, ...]): 指定命令内容 - `cmd` (str | tuple[str, ...]): 指定命令内容
- `aliases` (set[str | tuple[str, ...]] | None): 命令别名 - `aliases` (set[str | tuple[str, ...]] | None): 命令别名
@@ -884,7 +823,6 @@ description: nonebot.plugin.on 模块
- `state` ([T_State](../typing.md#T-State) | None): 默认 state - `state` ([T_State](../typing.md#T-State) | None): 默认 state
- **返回** - **返回**
- type[[Matcher](../matcher.md#Matcher)] - type[[Matcher](../matcher.md#Matcher)]
### _method_ `on_regex(pattern, flags=..., *, rule=..., permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#MatcherGroup-on-regex} ### _method_ `on_regex(pattern, flags=..., *, rule=..., permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#MatcherGroup-on-regex}
@@ -896,7 +834,6 @@ description: nonebot.plugin.on 模块
命令匹配规则参考: `正则匹配 <rule.md#regex-regex-flags-0>`\_ 命令匹配规则参考: `正则匹配 <rule.md#regex-regex-flags-0>`\_
- **参数** - **参数**
- `pattern` (str): 正则表达式 - `pattern` (str): 正则表达式
- `flags` (int | re.RegexFlag): 正则匹配标志 - `flags` (int | re.RegexFlag): 正则匹配标志
@@ -918,7 +855,6 @@ description: nonebot.plugin.on 模块
- `state` ([T_State](../typing.md#T-State) | None): 默认 state - `state` ([T_State](../typing.md#T-State) | None): 默认 state
- **返回** - **返回**
- type[[Matcher](../matcher.md#Matcher)] - type[[Matcher](../matcher.md#Matcher)]
### _method_ `on_type(types, *, rule=..., permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#MatcherGroup-on-type} ### _method_ `on_type(types, *, rule=..., permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#MatcherGroup-on-type}
@@ -926,7 +862,6 @@ description: nonebot.plugin.on 模块
- **说明:** 注册一个事件响应器,并且当事件为指定类型时响应。 - **说明:** 注册一个事件响应器,并且当事件为指定类型时响应。
- **参数** - **参数**
- `types` (type[[Event](../adapters/index.md#Event)] | tuple[type[[Event](../adapters/index.md#Event)]]): 事件类型 - `types` (type[[Event](../adapters/index.md#Event)] | tuple[type[[Event](../adapters/index.md#Event)]]): 事件类型
- `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则 - `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则
@@ -946,5 +881,4 @@ description: nonebot.plugin.on 模块
- `state` ([T_State](../typing.md#T-State) | None): 默认 state - `state` ([T_State](../typing.md#T-State) | None): 默认 state
- **返回** - **返回**
- type[[Matcher](../matcher.md#Matcher)] - type[[Matcher](../matcher.md#Matcher)]

View File

@@ -22,7 +22,6 @@ description: nonebot.rule 模块
当事件传递时,在 [Matcher](matcher.md#Matcher) 运行前进行检查。 当事件传递时,在 [Matcher](matcher.md#Matcher) 运行前进行检查。
- **参数** - **参数**
- `*checkers` ([T_RuleChecker](typing.md#T-RuleChecker) | [Dependent](dependencies/index.md#Dependent)[bool]): RuleChecker - `*checkers` ([T_RuleChecker](typing.md#T-RuleChecker) | [Dependent](dependencies/index.md#Dependent)[bool]): RuleChecker
- **用法** - **用法**
@@ -44,7 +43,6 @@ description: nonebot.rule 模块
- **说明:** 检查是否符合所有规则 - **说明:** 检查是否符合所有规则
- **参数** - **参数**
- `bot` ([Bot](adapters/index.md#Bot)): Bot 对象 - `bot` ([Bot](adapters/index.md#Bot)): Bot 对象
- `event` ([Event](adapters/index.md#Event)): Event 对象 - `event` ([Event](adapters/index.md#Event)): Event 对象
@@ -56,7 +54,6 @@ description: nonebot.rule 模块
- `dependency_cache` ([T_DependencyCache](typing.md#T-DependencyCache) | None): 依赖缓存 - `dependency_cache` ([T_DependencyCache](typing.md#T-DependencyCache) | None): 依赖缓存
- **返回** - **返回**
- bool - bool
## _class_ `CMD_RESULT(<auto>)` {#CMD-RESULT} ## _class_ `CMD_RESULT(<auto>)` {#CMD-RESULT}
@@ -78,7 +75,6 @@ description: nonebot.rule 模块
- **说明:** 检查消息纯文本是否以指定字符串开头。 - **说明:** 检查消息纯文本是否以指定字符串开头。
- **参数** - **参数**
- `msg` (tuple[str, ...]): 指定消息开头字符串元组 - `msg` (tuple[str, ...]): 指定消息开头字符串元组
- `ignorecase` (bool): 是否忽略大小写 - `ignorecase` (bool): 是否忽略大小写
@@ -88,13 +84,11 @@ description: nonebot.rule 模块
- **说明:** 匹配消息纯文本开头。 - **说明:** 匹配消息纯文本开头。
- **参数** - **参数**
- `msg` (str | tuple[str, ...]): 指定消息开头字符串元组 - `msg` (str | tuple[str, ...]): 指定消息开头字符串元组
- `ignorecase` (bool): 是否忽略大小写 - `ignorecase` (bool): 是否忽略大小写
- **返回** - **返回**
- [Rule](#Rule) - [Rule](#Rule)
## _class_ `EndswithRule(msg, ignorecase=False)` {#EndswithRule} ## _class_ `EndswithRule(msg, ignorecase=False)` {#EndswithRule}
@@ -102,7 +96,6 @@ description: nonebot.rule 模块
- **说明:** 检查消息纯文本是否以指定字符串结尾。 - **说明:** 检查消息纯文本是否以指定字符串结尾。
- **参数** - **参数**
- `msg` (tuple[str, ...]): 指定消息结尾字符串元组 - `msg` (tuple[str, ...]): 指定消息结尾字符串元组
- `ignorecase` (bool): 是否忽略大小写 - `ignorecase` (bool): 是否忽略大小写
@@ -112,13 +105,11 @@ description: nonebot.rule 模块
- **说明:** 匹配消息纯文本结尾。 - **说明:** 匹配消息纯文本结尾。
- **参数** - **参数**
- `msg` (str | tuple[str, ...]): 指定消息开头字符串元组 - `msg` (str | tuple[str, ...]): 指定消息开头字符串元组
- `ignorecase` (bool): 是否忽略大小写 - `ignorecase` (bool): 是否忽略大小写
- **返回** - **返回**
- [Rule](#Rule) - [Rule](#Rule)
## _class_ `FullmatchRule(msg, ignorecase=False)` {#FullmatchRule} ## _class_ `FullmatchRule(msg, ignorecase=False)` {#FullmatchRule}
@@ -126,7 +117,6 @@ description: nonebot.rule 模块
- **说明:** 检查消息纯文本是否与指定字符串全匹配。 - **说明:** 检查消息纯文本是否与指定字符串全匹配。
- **参数** - **参数**
- `msg` (tuple[str, ...]): 指定消息全匹配字符串元组 - `msg` (tuple[str, ...]): 指定消息全匹配字符串元组
- `ignorecase` (bool): 是否忽略大小写 - `ignorecase` (bool): 是否忽略大小写
@@ -136,13 +126,11 @@ description: nonebot.rule 模块
- **说明:** 完全匹配消息。 - **说明:** 完全匹配消息。
- **参数** - **参数**
- `msg` (str | tuple[str, ...]): 指定消息全匹配字符串元组 - `msg` (str | tuple[str, ...]): 指定消息全匹配字符串元组
- `ignorecase` (bool): 是否忽略大小写 - `ignorecase` (bool): 是否忽略大小写
- **返回** - **返回**
- [Rule](#Rule) - [Rule](#Rule)
## _class_ `KeywordsRule(*keywords)` {#KeywordsRule} ## _class_ `KeywordsRule(*keywords)` {#KeywordsRule}
@@ -150,7 +138,6 @@ description: nonebot.rule 模块
- **说明:** 检查消息纯文本是否包含指定关键字。 - **说明:** 检查消息纯文本是否包含指定关键字。
- **参数** - **参数**
- `*keywords` (str): 指定关键字元组 - `*keywords` (str): 指定关键字元组
## _def_ `keyword(*keywords)` {#keyword} ## _def_ `keyword(*keywords)` {#keyword}
@@ -158,11 +145,9 @@ description: nonebot.rule 模块
- **说明:** 匹配消息纯文本关键词。 - **说明:** 匹配消息纯文本关键词。
- **参数** - **参数**
- `*keywords` (str): 指定关键字元组 - `*keywords` (str): 指定关键字元组
- **返回** - **返回**
- [Rule](#Rule) - [Rule](#Rule)
## _class_ `CommandRule(cmds, force_whitespace=None)` {#CommandRule} ## _class_ `CommandRule(cmds, force_whitespace=None)` {#CommandRule}
@@ -170,7 +155,6 @@ description: nonebot.rule 模块
- **说明:** 检查消息是否为指定命令。 - **说明:** 检查消息是否为指定命令。
- **参数** - **参数**
- `cmds` (list[tuple[str, ...]]): 指定命令元组列表 - `cmds` (list[tuple[str, ...]]): 指定命令元组列表
- `force_whitespace` (str | bool | None): 是否强制命令后必须有指定空白符 - `force_whitespace` (str | bool | None): 是否强制命令后必须有指定空白符
@@ -189,13 +173,11 @@ description: nonebot.rule 模块
通过 [CommandArg](params.md#CommandArg) 获取匹配成功的命令参数。 通过 [CommandArg](params.md#CommandArg) 获取匹配成功的命令参数。
- **参数** - **参数**
- `*cmds` (str | tuple[str, ...]): 命令文本或命令元组 - `*cmds` (str | tuple[str, ...]): 命令文本或命令元组
- `force_whitespace` (str | bool | None): 是否强制命令后必须有指定空白符 - `force_whitespace` (str | bool | None): 是否强制命令后必须有指定空白符
- **返回** - **返回**
- [Rule](#Rule) - [Rule](#Rule)
- **用法** - **用法**
@@ -231,37 +213,28 @@ description: nonebot.rule 模块
- **重载** - **重载**
**1.** `(args=None, namespace=None) -> tuple[Namespace, list[str | MessageSegment]]` **1.** `(args=None, namespace=None) -> tuple[Namespace, list[str | MessageSegment]]`
- **参数** - **参数**
- `args` (Sequence[str | [MessageSegment](adapters/index.md#MessageSegment)] | None) - `args` (Sequence[str | [MessageSegment](adapters/index.md#MessageSegment)] | None)
- `namespace` (None) - `namespace` (None)
- **返回** - **返回**
- tuple[Namespace, list[str | [MessageSegment](adapters/index.md#MessageSegment)]] - tuple[Namespace, list[str | [MessageSegment](adapters/index.md#MessageSegment)]]
**2.** `(args, namespace) -> tuple[T, list[str | MessageSegment]]` **2.** `(args, namespace) -> tuple[T, list[str | MessageSegment]]`
- **参数** - **参数**
- `args` (Sequence[str | [MessageSegment](adapters/index.md#MessageSegment)] | None) - `args` (Sequence[str | [MessageSegment](adapters/index.md#MessageSegment)] | None)
- `namespace` (T) - `namespace` (T)
- **返回** - **返回**
- tuple[T, list[str | [MessageSegment](adapters/index.md#MessageSegment)]] - tuple[T, list[str | [MessageSegment](adapters/index.md#MessageSegment)]]
**3.** `(*, namespace) -> tuple[T, list[str | MessageSegment]]` **3.** `(*, namespace) -> tuple[T, list[str | MessageSegment]]`
- **参数** - **参数**
- `namespace` (T) - `namespace` (T)
- **返回** - **返回**
- tuple[T, list[str | [MessageSegment](adapters/index.md#MessageSegment)]] - tuple[T, list[str | [MessageSegment](adapters/index.md#MessageSegment)]]
## _class_ `ShellCommandRule(cmds, parser)` {#ShellCommandRule} ## _class_ `ShellCommandRule(cmds, parser)` {#ShellCommandRule}
@@ -269,7 +242,6 @@ description: nonebot.rule 模块
- **说明:** 检查消息是否为指定 shell 命令。 - **说明:** 检查消息是否为指定 shell 命令。
- **参数** - **参数**
- `cmds` (list[tuple[str, ...]]): 指定命令元组列表 - `cmds` (list[tuple[str, ...]]): 指定命令元组列表
- `parser` (ArgumentParser | None): 可选参数解析器 - `parser` (ArgumentParser | None): 可选参数解析器
@@ -298,13 +270,11 @@ description: nonebot.rule 模块
::: :::
- **参数** - **参数**
- `*cmds` (str | tuple[str, ...]): 命令文本或命令元组 - `*cmds` (str | tuple[str, ...]): 命令文本或命令元组
- `parser` (ArgumentParser | None): [ArgumentParser](#ArgumentParser) 对象 - `parser` (ArgumentParser | None): [ArgumentParser](#ArgumentParser) 对象
- **返回** - **返回**
- [Rule](#Rule) - [Rule](#Rule)
- **用法** - **用法**
@@ -330,7 +300,6 @@ description: nonebot.rule 模块
- **说明:** 检查消息字符串是否符合指定正则表达式。 - **说明:** 检查消息字符串是否符合指定正则表达式。
- **参数** - **参数**
- `regex` (str): 正则表达式 - `regex` (str): 正则表达式
- `flags` (int): 正则表达式标记 - `flags` (int): 正则表达式标记
@@ -346,13 +315,11 @@ description: nonebot.rule 模块
通过 [RegexDict](params.md#RegexDict) 获取匹配成功的 group 字典。 通过 [RegexDict](params.md#RegexDict) 获取匹配成功的 group 字典。
- **参数** - **参数**
- `regex` (str): 正则表达式 - `regex` (str): 正则表达式
- `flags` (int | re.RegexFlag): 正则表达式标记 - `flags` (int | re.RegexFlag): 正则表达式标记
- **返回** - **返回**
- [Rule](#Rule) - [Rule](#Rule)
:::tip 提示 :::tip 提示
@@ -380,7 +347,6 @@ description: nonebot.rule 模块
empty empty
- **返回** - **返回**
- [Rule](#Rule) - [Rule](#Rule)
## _class_ `IsTypeRule(*types)` {#IsTypeRule} ## _class_ `IsTypeRule(*types)` {#IsTypeRule}
@@ -388,7 +354,6 @@ description: nonebot.rule 模块
- **说明:** 检查事件类型是否为指定类型。 - **说明:** 检查事件类型是否为指定类型。
- **参数** - **参数**
- `*types` (type[[Event](adapters/index.md#Event)]) - `*types` (type[[Event](adapters/index.md#Event)])
## _def_ `is_type(*types)` {#is-type} ## _def_ `is_type(*types)` {#is-type}
@@ -396,9 +361,7 @@ description: nonebot.rule 模块
- **说明:** 匹配事件类型。 - **说明:** 匹配事件类型。
- **参数** - **参数**
- `*types` (type[[Event](adapters/index.md#Event)]): 事件类型 - `*types` (type[[Event](adapters/index.md#Event)]): 事件类型
- **返回** - **返回**
- [Rule](#Rule) - [Rule](#Rule)

View File

@@ -19,31 +19,25 @@ description: nonebot.typing 模块
- **说明:** 标记一个方法为父类 interface 的 implement - **说明:** 标记一个方法为父类 interface 的 implement
- **参数** - **参数**
- `InterfaceClass` (object) - `InterfaceClass` (object)
- **返回** - **返回**
- untyped - untyped
## _def_ `type_has_args(type_)` {#type-has-args} ## _def_ `type_has_args(type_)` {#type-has-args}
- **参数** - **参数**
- `type_` (type[Any]) - `type_` (type[Any])
- **返回** - **返回**
- bool - bool
## _def_ `origin_is_union(origin)` {#origin-is-union} ## _def_ `origin_is_union(origin)` {#origin-is-union}
- **参数** - **参数**
- `origin` (type[Any] | None) - `origin` (type[Any] | None)
- **返回** - **返回**
- bool - bool
## _def_ `origin_is_literal(origin)` {#origin-is-literal} ## _def_ `origin_is_literal(origin)` {#origin-is-literal}
@@ -51,11 +45,9 @@ description: nonebot.typing 模块
- **说明:** 判断是否是 Literal 类型 - **说明:** 判断是否是 Literal 类型
- **参数** - **参数**
- `origin` (type[Any] | None) - `origin` (type[Any] | None)
- **返回** - **返回**
- bool - bool
## _def_ `all_literal_values(type_)` {#all-literal-values} ## _def_ `all_literal_values(type_)` {#all-literal-values}
@@ -63,11 +55,9 @@ description: nonebot.typing 模块
- **说明:** 获取 Literal 类型包含的所有值 - **说明:** 获取 Literal 类型包含的所有值
- **参数** - **参数**
- `type_` (type[Any]) - `type_` (type[Any])
- **返回** - **返回**
- list[Any] - list[Any]
## _def_ `origin_is_annotated(origin)` {#origin-is-annotated} ## _def_ `origin_is_annotated(origin)` {#origin-is-annotated}
@@ -75,11 +65,9 @@ description: nonebot.typing 模块
- **说明:** 判断是否是 Annotated 类型 - **说明:** 判断是否是 Annotated 类型
- **参数** - **参数**
- `origin` (type[Any] | None) - `origin` (type[Any] | None)
- **返回** - **返回**
- bool - bool
## _def_ `is_none_type(type_)` {#is-none-type} ## _def_ `is_none_type(type_)` {#is-none-type}
@@ -87,17 +75,14 @@ description: nonebot.typing 模块
- **说明:** 判断是否是 None 类型 - **说明:** 判断是否是 None 类型
- **参数** - **参数**
- `type_` (type[Any]) - `type_` (type[Any])
- **返回** - **返回**
- bool - bool
## _def_ `evaluate_forwardref(ref, globalns, localns)` {#evaluate-forwardref} ## _def_ `evaluate_forwardref(ref, globalns, localns)` {#evaluate-forwardref}
- **参数** - **参数**
- `ref` (ForwardRef) - `ref` (ForwardRef)
- `globalns` (dict[str, Any]) - `globalns` (dict[str, Any])
@@ -105,7 +90,6 @@ description: nonebot.typing 模块
- `localns` (dict[str, Any]) - `localns` (dict[str, Any])
- **返回** - **返回**
- Any - Any
## _class_ `StateFlag(<auto>)` {#StateFlag} ## _class_ `StateFlag(<auto>)` {#StateFlag}
@@ -129,7 +113,6 @@ description: nonebot.typing 模块
Bot 连接建立时钩子函数 Bot 连接建立时钩子函数
依赖参数: 依赖参数:
- DependParam: 子依赖参数 - DependParam: 子依赖参数
- BotParam: Bot 对象 - BotParam: Bot 对象
- DefaultParam: 带有默认值的参数 - DefaultParam: 带有默认值的参数
@@ -143,7 +126,6 @@ description: nonebot.typing 模块
Bot 连接断开时钩子函数 Bot 连接断开时钩子函数
依赖参数: 依赖参数:
- DependParam: 子依赖参数 - DependParam: 子依赖参数
- BotParam: Bot 对象 - BotParam: Bot 对象
- DefaultParam: 带有默认值的参数 - DefaultParam: 带有默认值的参数
@@ -169,7 +151,6 @@ description: nonebot.typing 模块
事件预处理函数 EventPreProcessor 类型 事件预处理函数 EventPreProcessor 类型
依赖参数: 依赖参数:
- DependParam: 子依赖参数 - DependParam: 子依赖参数
- BotParam: Bot 对象 - BotParam: Bot 对象
- EventParam: Event 对象 - EventParam: Event 对象
@@ -185,7 +166,6 @@ description: nonebot.typing 模块
事件后处理函数 EventPostProcessor 类型 事件后处理函数 EventPostProcessor 类型
依赖参数: 依赖参数:
- DependParam: 子依赖参数 - DependParam: 子依赖参数
- BotParam: Bot 对象 - BotParam: Bot 对象
- EventParam: Event 对象 - EventParam: Event 对象
@@ -201,7 +181,6 @@ description: nonebot.typing 模块
事件响应器运行前预处理函数 RunPreProcessor 类型 事件响应器运行前预处理函数 RunPreProcessor 类型
依赖参数: 依赖参数:
- DependParam: 子依赖参数 - DependParam: 子依赖参数
- BotParam: Bot 对象 - BotParam: Bot 对象
- EventParam: Event 对象 - EventParam: Event 对象
@@ -218,7 +197,6 @@ description: nonebot.typing 模块
事件响应器运行后后处理函数 RunPostProcessor 类型 事件响应器运行后后处理函数 RunPostProcessor 类型
依赖参数: 依赖参数:
- DependParam: 子依赖参数 - DependParam: 子依赖参数
- BotParam: Bot 对象 - BotParam: Bot 对象
- EventParam: Event 对象 - EventParam: Event 对象
@@ -236,7 +214,6 @@ description: nonebot.typing 模块
RuleChecker 即判断是否响应事件的处理函数。 RuleChecker 即判断是否响应事件的处理函数。
依赖参数: 依赖参数:
- DependParam: 子依赖参数 - DependParam: 子依赖参数
- BotParam: Bot 对象 - BotParam: Bot 对象
- EventParam: Event 对象 - EventParam: Event 对象
@@ -252,7 +229,6 @@ description: nonebot.typing 模块
PermissionChecker 即判断事件是否满足权限的处理函数。 PermissionChecker 即判断事件是否满足权限的处理函数。
依赖参数: 依赖参数:
- DependParam: 子依赖参数 - DependParam: 子依赖参数
- BotParam: Bot 对象 - BotParam: Bot 对象
- EventParam: Event 对象 - EventParam: Event 对象
@@ -273,7 +249,6 @@ description: nonebot.typing 模块
TypeUpdater 在 Matcher.pause, Matcher.reject 时被运行,用于更新响应的事件类型。 默认会更新为 `message` TypeUpdater 在 Matcher.pause, Matcher.reject 时被运行,用于更新响应的事件类型。 默认会更新为 `message`
依赖参数: 依赖参数:
- DependParam: 子依赖参数 - DependParam: 子依赖参数
- BotParam: Bot 对象 - BotParam: Bot 对象
- EventParam: Event 对象 - EventParam: Event 对象
@@ -290,7 +265,6 @@ description: nonebot.typing 模块
PermissionUpdater 在 Matcher.pause, Matcher.reject 时被运行,用于更新会话对象权限。 默认会更新为当前事件的触发对象。 PermissionUpdater 在 Matcher.pause, Matcher.reject 时被运行,用于更新会话对象权限。 默认会更新为当前事件的触发对象。
依赖参数: 依赖参数:
- DependParam: 子依赖参数 - DependParam: 子依赖参数
- BotParam: Bot 对象 - BotParam: Bot 对象
- EventParam: Event 对象 - EventParam: Event 对象

View File

@@ -18,11 +18,9 @@ description: nonebot.utils 模块
参考: [loguru color 标签](https://loguru.readthedocs.io/en/stable/api/logger.html#color) 参考: [loguru color 标签](https://loguru.readthedocs.io/en/stable/api/logger.html#color)
- **参数** - **参数**
- `s` (str): 需要转义的字符串 - `s` (str): 需要转义的字符串
- **返回** - **返回**
- str - str
## _def_ `deep_update(mapping, *updating_mappings)` {#deep-update} ## _def_ `deep_update(mapping, *updating_mappings)` {#deep-update}
@@ -30,13 +28,11 @@ description: nonebot.utils 模块
- **说明:** 深度更新合并字典 - **说明:** 深度更新合并字典
- **参数** - **参数**
- `mapping` (dict[K, Any]) - `mapping` (dict[K, Any])
- `*updating_mappings` (dict[K, Any]) - `*updating_mappings` (dict[K, Any])
- **返回** - **返回**
- dict[K, Any] - dict[K, Any]
## _def_ `lenient_issubclass(cls, class_or_tuple)` {#lenient-issubclass} ## _def_ `lenient_issubclass(cls, class_or_tuple)` {#lenient-issubclass}
@@ -44,13 +40,11 @@ description: nonebot.utils 模块
- **说明:** 检查 cls 是否是 class_or_tuple 中的一个类型子类并忽略类型错误。 - **说明:** 检查 cls 是否是 class_or_tuple 中的一个类型子类并忽略类型错误。
- **参数** - **参数**
- `cls` (Any) - `cls` (Any)
- `class_or_tuple` (type[Any] | tuple[type[Any], ...]) - `class_or_tuple` (type[Any] | tuple[type[Any], ...])
- **返回** - **返回**
- bool - bool
## _def_ `generic_check_issubclass(cls, class_or_tuple)` {#generic-check-issubclass} ## _def_ `generic_check_issubclass(cls, class_or_tuple)` {#generic-check-issubclass}
@@ -60,7 +54,6 @@ description: nonebot.utils 模块
检查 cls 是否是 class_or_tuple 中的一个类型子类。 检查 cls 是否是 class_or_tuple 中的一个类型子类。
特别的: 特别的:
- 如果 cls 是 `typing.Union``types.UnionType` 类型, - 如果 cls 是 `typing.Union``types.UnionType` 类型,
则会检查其中的所有类型是否是 class_or_tuple 中一个类型的子类或 None。 则会检查其中的所有类型是否是 class_or_tuple 中一个类型的子类或 None。
- 如果 cls 是 `typing.Literal` 类型, - 如果 cls 是 `typing.Literal` 类型,
@@ -70,13 +63,11 @@ description: nonebot.utils 模块
是否是 class_or_tuple 中一个类型的子类或 None。 是否是 class_or_tuple 中一个类型的子类或 None。
- **参数** - **参数**
- `cls` (Any) - `cls` (Any)
- `class_or_tuple` (type[Any] | tuple[type[Any], ...]) - `class_or_tuple` (type[Any] | tuple[type[Any], ...])
- **返回** - **返回**
- bool - bool
## _def_ `type_is_complex(type_)` {#type-is-complex} ## _def_ `type_is_complex(type_)` {#type-is-complex}
@@ -84,11 +75,9 @@ description: nonebot.utils 模块
- **说明:** 检查 type\_ 是否是复杂类型 - **说明:** 检查 type\_ 是否是复杂类型
- **参数** - **参数**
- `type_` (type[Any]) - `type_` (type[Any])
- **返回** - **返回**
- bool - bool
## _def_ `is_coroutine_callable(call)` {#is-coroutine-callable} ## _def_ `is_coroutine_callable(call)` {#is-coroutine-callable}
@@ -96,11 +85,9 @@ description: nonebot.utils 模块
- **说明:** 检查 call 是否是一个 callable 协程函数 - **说明:** 检查 call 是否是一个 callable 协程函数
- **参数** - **参数**
- `call` ((...) -> Any) - `call` ((...) -> Any)
- **返回** - **返回**
- bool - bool
## _def_ `is_gen_callable(call)` {#is-gen-callable} ## _def_ `is_gen_callable(call)` {#is-gen-callable}
@@ -108,11 +95,9 @@ description: nonebot.utils 模块
- **说明:** 检查 call 是否是一个生成器函数 - **说明:** 检查 call 是否是一个生成器函数
- **参数** - **参数**
- `call` ((...) -> Any) - `call` ((...) -> Any)
- **返回** - **返回**
- bool - bool
## _def_ `is_async_gen_callable(call)` {#is-async-gen-callable} ## _def_ `is_async_gen_callable(call)` {#is-async-gen-callable}
@@ -120,11 +105,9 @@ description: nonebot.utils 模块
- **说明:** 检查 call 是否是一个异步生成器函数 - **说明:** 检查 call 是否是一个异步生成器函数
- **参数** - **参数**
- `call` ((...) -> Any) - `call` ((...) -> Any)
- **返回** - **返回**
- bool - bool
## _def_ `run_sync(call)` {#run-sync} ## _def_ `run_sync(call)` {#run-sync}
@@ -132,11 +115,9 @@ description: nonebot.utils 模块
- **说明:** 一个用于包装 sync function 为 async function 的装饰器 - **说明:** 一个用于包装 sync function 为 async function 的装饰器
- **参数** - **参数**
- `call` ((P) -> R): 被装饰的同步函数 - `call` ((P) -> R): 被装饰的同步函数
- **返回** - **返回**
- (P) -> Coroutine[None, None, R] - (P) -> Coroutine[None, None, R]
## _def_ `run_sync_ctx_manager(cm)` {#run-sync-ctx-manager} ## _def_ `run_sync_ctx_manager(cm)` {#run-sync-ctx-manager}
@@ -144,11 +125,9 @@ description: nonebot.utils 模块
- **说明:** 一个用于包装 sync context manager 为 async context manager 的执行函数 - **说明:** 一个用于包装 sync context manager 为 async context manager 的执行函数
- **参数** - **参数**
- `cm` (AbstractContextManager[T]) - `cm` (AbstractContextManager[T])
- **返回** - **返回**
- AsyncGenerator[T, None] - AsyncGenerator[T, None]
## _async def_ `run_coro_with_catch(coro, exc, return_on_err=None)` {#run-coro-with-catch} ## _async def_ `run_coro_with_catch(coro, exc, return_on_err=None)` {#run-coro-with-catch}
@@ -158,9 +137,7 @@ description: nonebot.utils 模块
- **重载** - **重载**
**1.** `(coro, exc, return_on_err=None) -> T | None` **1.** `(coro, exc, return_on_err=None) -> T | None`
- **参数** - **参数**
- `coro` (Coroutine[Any, Any, T]) - `coro` (Coroutine[Any, Any, T])
- `exc` (tuple[type[Exception], ...]) - `exc` (tuple[type[Exception], ...])
@@ -168,13 +145,10 @@ description: nonebot.utils 模块
- `return_on_err` (None) - `return_on_err` (None)
- **返回** - **返回**
- T | None - T | None
**2.** `(coro, exc, return_on_err) -> T | R` **2.** `(coro, exc, return_on_err) -> T | R`
- **参数** - **参数**
- `coro` (Coroutine[Any, Any, T]) - `coro` (Coroutine[Any, Any, T])
- `exc` (tuple[type[Exception], ...]) - `exc` (tuple[type[Exception], ...])
@@ -182,11 +156,9 @@ description: nonebot.utils 模块
- `return_on_err` (R) - `return_on_err` (R)
- **返回** - **返回**
- T | R - T | R
- **参数** - **参数**
- `coro`: 要运行的协程 - `coro`: 要运行的协程
- `exc`: 要捕获的异常 - `exc`: 要捕获的异常
@@ -202,21 +174,17 @@ description: nonebot.utils 模块
- **说明:** 运行协程并在取消时屏蔽取消异常。 - **说明:** 运行协程并在取消时屏蔽取消异常。
- **参数** - **参数**
- `coro` (Coroutine[Any, Any, T]): 要运行的协程 - `coro` (Coroutine[Any, Any, T]): 要运行的协程
- **返回** - **返回**
- T: 协程的返回值 - T: 协程的返回值
## _def_ `flatten_exception_group(exc_group)` {#flatten-exception-group} ## _def_ `flatten_exception_group(exc_group)` {#flatten-exception-group}
- **参数** - **参数**
- `exc_group` (BaseExceptionGroup[E]) - `exc_group` (BaseExceptionGroup[E])
- **返回** - **返回**
- Generator[E, None, None] - Generator[E, None, None]
## _def_ `get_name(obj)` {#get-name} ## _def_ `get_name(obj)` {#get-name}
@@ -224,11 +192,9 @@ description: nonebot.utils 模块
- **说明:** 获取对象的名称 - **说明:** 获取对象的名称
- **参数** - **参数**
- `obj` (Any) - `obj` (Any)
- **返回** - **返回**
- str - str
## _def_ `path_to_module_name(path)` {#path-to-module-name} ## _def_ `path_to_module_name(path)` {#path-to-module-name}
@@ -236,11 +202,9 @@ description: nonebot.utils 模块
- **说明:** 转换路径为模块名 - **说明:** 转换路径为模块名
- **参数** - **参数**
- `path` (Path) - `path` (Path)
- **返回** - **返回**
- str - str
## _def_ `resolve_dot_notation(obj_str, default_attr, default_prefix=None)` {#resolve-dot-notation} ## _def_ `resolve_dot_notation(obj_str, default_attr, default_prefix=None)` {#resolve-dot-notation}
@@ -248,7 +212,6 @@ description: nonebot.utils 模块
- **说明:** 解析并导入点分表示法的对象 - **说明:** 解析并导入点分表示法的对象
- **参数** - **参数**
- `obj_str` (str) - `obj_str` (str)
- `default_attr` (str) - `default_attr` (str)
@@ -256,7 +219,6 @@ description: nonebot.utils 模块
- `default_prefix` (str | None) - `default_prefix` (str | None)
- **返回** - **返回**
- Any - Any
## _class_ `classproperty(func)` {#classproperty} ## _class_ `classproperty(func)` {#classproperty}
@@ -264,7 +226,6 @@ description: nonebot.utils 模块
- **说明:** 类属性装饰器 - **说明:** 类属性装饰器
- **参数** - **参数**
- `func` ((Any) -> T) - `func` ((Any) -> T)
## _class_ `DataclassEncoder(<auto>)` {#DataclassEncoder} ## _class_ `DataclassEncoder(<auto>)` {#DataclassEncoder}
@@ -278,11 +239,9 @@ description: nonebot.utils 模块
### _method_ `default(o)` {#DataclassEncoder-default} ### _method_ `default(o)` {#DataclassEncoder-default}
- **参数** - **参数**
- `o` - `o`
- **返回** - **返回**
- untyped - untyped
## _def_ `logger_wrapper(logger_name)` {#logger-wrapper} ## _def_ `logger_wrapper(logger_name)` {#logger-wrapper}
@@ -290,15 +249,12 @@ description: nonebot.utils 模块
- **说明:** 用于打印 adapter 的日志。 - **说明:** 用于打印 adapter 的日志。
- **参数** - **参数**
- `logger_name` (str): adapter 的名称 - `logger_name` (str): adapter 的名称
- **返回** - **返回**
- untyped: 日志记录函数 - untyped: 日志记录函数
日志记录函数的参数: 日志记录函数的参数:
- level: 日志等级 - level: 日志等级
- message: 日志信息 - message: 日志信息
- exception: 异常信息 - exception: 异常信息

View File

@@ -278,7 +278,6 @@ opt2 = Option("--foo", default=OptionResult(value=False, args={"bar": 1}))
`Arparma` 有如下属性: `Arparma` 有如下属性:
- 调试类 - 调试类
- matched: 是否匹配成功 - matched: 是否匹配成功
- error_data: 解析失败时剩余的数据 - error_data: 解析失败时剩余的数据
- error_info: 解析失败时的异常内容 - error_info: 解析失败时的异常内容

View File

@@ -0,0 +1,229 @@
---
sidebar_position: 8
description: 轻量化 HTML 绘图
---
# 轻量化 HTML 绘图
图片是机器人交互中不可或缺的一部分,对于信息展示的直观性、美观性有很大的作用。
基于 PIL 直接绘制图片具有良好的性能和存储开销,但是难以调试、维护过程式的绘图代码。
使用浏览器渲染类插件可以方便地绘制网页,且能够直接通过 JS 对网页效果进行编程,但是它占用的存储和内存空间相对可观。
NoneBot 提供的 `nonebot-plugin-htmlkit` 提供了另一种基于 HTML 和 CSS 语法的轻量化绘图选择:它基于 `litehtml` 解析库,无须安装额外的依赖即可使用,没有进程间通信带来的额外开销,且在支持 `webp` `avif` 等丰富图片格式的前提下,安装用的 wheel 文件大小仅有约 10 MB。
作为粗略的性能参考,在一台 Ryzen 7 9700X 的 Windows 电脑上,渲染 [PEP 7](https://peps.python.org/pep-0007/) 的 HTML 页面(分辨率为 800x5788大小约 1.4MB,从本地文件系统读取 CSS大约需要 100ms每个渲染任务内存最高占用约为 40MB.
## 安装插件
在使用前请先安装 `nonebot-plugin-htmlkit` 插件至项目环境中,可参考[获取商店插件](../tutorial/store.mdx#安装插件)来了解并选择安装插件的方式。如:
在**项目目录**下执行以下命令:
```bash
nb plugin install nonebot-plugin-htmlkit
```
`nonebot-plugin-htmlkit` 插件目前兼容以下系统架构:
- Windows x64
- macOS arm64M-系列芯片)
- Linux x64 (非 Alpine 等 musl 系发行版)
- Linux arm64 (非 Alpine 等 musl 系发行版)
:::caution 访问网络内容
如果需要访问网络资源(如 http(s) 网页内容NoneBot 需要客户端型驱动器Forward。内置的驱动器有 `~httpx``~aiohttp`
详见[选择驱动器](../advanced/driver.md)。
:::
## 使用插件
### 加载插件
在使用本插件前同样需要使用 `require` 方法进行**加载**并**导入**需要使用的方法,可参考 [跨插件访问](../advanced/requiring.md) 一节进行了解,如:
```python
from nonebot import require
require("nonebot_plugin_htmlkit")
from nonebot_plugin_htmlkit import html_to_pic, md_to_pic, template_to_pic, text_to_pic
```
插件会自动使用[配置中的参数](#配置-fontconfig)初始化 `fontconfig` 以提供字体查找功能。
### 渲染 API
`nonebot-plugin-htmlkit` 主要提供以下**异步**渲染函数:
#### html_to_pic
```python
async def html_to_pic(
html: str,
*,
base_url: str = "",
dpi: float = 144.0,
max_width: float = 800.0,
device_height: float = 600.0,
default_font_size: float = 12.0,
font_name: str = "sans-serif",
allow_refit: bool = True,
image_format: Literal["png", "jpeg"] = "png",
jpeg_quality: int = 100,
lang: str = "zh",
culture: str = "CN",
img_fetch_fn: ImgFetchFn = combined_img_fetcher,
css_fetch_fn: CSSFetchFn = combined_css_fetcher,
urljoin_fn: Callable[[str, str], str] = urllib3.parse.urljoin,
) -> bytes:
...
```
最核心的渲染函数。
`base_url``urljoin_fn` 控制着传入 `image_fetch_fn``css_fetch_fn` 回调的 url 内容。
`allow_refit` 如果为真,渲染时会自动缩小产出图片的宽度到最适合的宽度,否则必定产出 `max_width` 宽度的图片。
`max_width``device_height` 会在 `@media` 判断中被使用。
`img_fetch_fn` 预期为一个异步可调用对象(函数),接收图片 url 并返回对应 url 的 jpeg 或 png 二进制数据(`bytes`),可在拒绝加载时返回 `None`.
`css_fetch_fn` 预期为一个异步可调用对象(函数),接收目标 CSS url 并返回对应 url 的 CSS 文本(`str`),可在拒绝加载时返回 `None`.
以下为辅助的封装函数,关键字参数若未特殊说明均与 `html_to_pic` 含义相同。
#### text_to_pic
```python
async def text_to_pic(
text: str,
css_path: str = "",
*,
max_width: int = 500,
allow_refit: bool = True,
image_format: Literal["png", "jpeg"] = "png",
jpeg_quality: int = 100,
) -> bytes:
...
```
可用于渲染多行文本。
`text` 会被放置于 `<div id="main" class="main-box"> <div class="text">` 中,可据此编写 CSS 来改变文本表现。
#### md_to_pic
```python
async def md_to_pic(
md: str = "",
md_path: str = "",
css_path: str = "",
*,
max_width: int = 500,
img_fetch_fn: ImgFetchFn = combined_img_fetcher,
allow_refit: bool = True,
image_format: Literal["png", "jpeg"] = "png",
jpeg_quality: int = 100,
) -> bytes:
...
```
可用于渲染 Markdown 文本。默认为 GitHub Markdown Light 风格,支持基于 `pygments` 的代码高亮。
`md``md_path` 二选一,前者设置时应为 Markdown 的文本,后者设置时应为指向 Markdown 文本文件的路径。
#### template_to_pic
```python
async def template_to_pic(
template_path: str | PathLike[str] | Sequence[str | PathLike[str]],
template_name: str,
templates: Mapping[Any, Any],
filters: None | Mapping[str, Any] = None,
*,
max_width: int = 500,
device_height: int = 600,
base_url: str | None = None,
img_fetch_fn: ImgFetchFn = combined_img_fetcher,
css_fetch_fn: CSSFetchFn = combined_css_fetcher,
allow_refit: bool = True,
image_format: Literal["png", "jpeg"] = "png",
jpeg_quality: int = 100,
) -> bytes:
...
```
渲染 jinja2 模板。
`template_path` 为 jinja2 环境的路径,`template_name` 是环境中要加载模板的名字,`templates` 为传入模板的参数,`filters` 为过滤器名 -> 自定义过滤器的映射。
### 控制外部资源获取
通过传入 `img_fetch_fn``css_fetch_fn`,我们可以在实际访问资源前进行审查,修改资源的来源,或是对 IO 操作进行缓存。
`img_fetch_fn` 预期为一个异步可调用对象(函数),接收图片 url 并返回对应 url 的 jpeg 或 png 二进制数据(`bytes`),可在拒绝加载时返回 `None`.
`css_fetch_fn` 预期为一个异步可调用对象(函数),接收目标 CSS url 并返回对应 url 的 CSS 文本(`str`),可在拒绝加载时返回 `None`.
如果你想要禁用外部资源加载/只从文件系统加载/只从网络加载,可以使用 `none_fetcher` `filesystem_***_fetcher` `network_***_fetcher`
默认的 fetcher 行为(对于 `file://` 从文件系统加载,其余从网络加载)位于 `combined_***_fetcher`,可以通过对其封装实现缓存等操作。
## 配置项
### 配置 fontconfig
`htmlkit` 使用 `fontconfig` 查找字体,请参阅 [`fontconfig 用户手册`](https://fontconfig.pages.freedesktop.org/fontconfig/fontconfig-user) 了解环境变量的具体含义、如何通过编写配置文件修改字体配置等。
#### fontconfig_file
- **类型**: `str | None`
- **默认值**: `None`
覆盖默认的配置文件路径。
#### fontconfig_path
- **类型**: `str | None`
- **默认值**: `None`
覆盖默认的配置目录。
#### fontconfig_sysroot
- **类型**: `str | None`
- **默认值**: `None`
覆盖默认的 sysroot。
#### fc_debug
- **类型**: `str | None`
- **默认值**: `None`
设置 Fontconfig 的 debug 级别。
#### fc_dbg_match_filter
- **类型**: `str | None`
- **默认值**: `None`
`FC_DEBUG` 设置为 `MATCH2` 时,过滤 debug 输出。
#### fc_lang
- **类型**: `str | None`
- **默认值**: `None`
设置默认语言,否则从 `LOCALE` 环境变量获取。
#### fontconfig_use_mmap
- **类型**: `str | None`
- **默认值**: `None`
是否使用 `mmap(2)` 读取字体缓存。

View File

@@ -40,7 +40,7 @@ async def handle_function():
### 处理近似事件 ### 处理近似事件
对于一系列**差异不大**的事件,我们往往具有相同的处理逻辑。这时,我们不希望将相同的逻辑编写两遍,而应该复用代码,以实现在同一个事件处理函数中处理多个近似事件。我们可以使用[事件重载](../advanced/dependency.mdx#Event)的特性来实现这一功能。例如: 对于一系列**差异不大**的事件,我们往往具有相同的处理逻辑。这时,我们不希望将相同的逻辑编写两遍,而应该复用代码,以实现在同一个事件处理函数中处理多个近似事件。我们可以使用[事件重载](../advanced/dependency.mdx#event)的特性来实现这一功能。例如:
<Tabs groupId="python"> <Tabs groupId="python">
<TabItem value="3.10" label="Python 3.10+" default> <TabItem value="3.10" label="Python 3.10+" default>

View File

@@ -155,7 +155,6 @@ async def test_example(app: App):
1. `should_call_send` 1. `should_call_send`
定义事件响应器预期发送的消息,即通过[事件响应器操作 send](../../appendices/session-control.mdx#send)进行的操作。`should_call_send` 有四个参数: 定义事件响应器预期发送的消息,即通过[事件响应器操作 send](../../appendices/session-control.mdx#send)进行的操作。`should_call_send` 有四个参数:
- `event`:回复的目标事件。 - `event`:回复的目标事件。
- `message`:预期的消息对象,可以是 `str`、`Message` 或 `MessageSegment`。 - `message`:预期的消息对象,可以是 `str`、`Message` 或 `MessageSegment`。
- `result`send 的返回值,将会返回给插件。 - `result`send 的返回值,将会返回给插件。
@@ -163,8 +162,7 @@ async def test_example(app: App):
- `**kwargs`send 方法的额外参数。 - `**kwargs`send 方法的额外参数。
2. `should_call_api` 2. `should_call_api`
定义事件响应器预期调用的平台 API 接口,即通过[调用平台 API](../../appendices/api-calling.mdx#调用平台-API)进行的操作。`should_call_api` 有四个参数: 定义事件响应器预期调用的平台 API 接口,即通过[调用平台 API](../../appendices/api-calling.mdx#调用平台-api)进行的操作。`should_call_api` 有四个参数:
- `api`API 名称。 - `api`API 名称。
- `data`:预期的请求数据。 - `data`:预期的请求数据。
- `result`call_api 的返回值,将会返回给插件。 - `result`call_api 的返回值,将会返回给插件。

Some files were not shown because too many files have changed in this diff Show More