Compare commits

..

597 Commits

Author SHA1 Message Date
noneflow[bot]
033c90dd74 🔖 Release 2.4.1
Some checks failed
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.10) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.11) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.12) (push) Waiting to run
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.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-v1, ubuntu-latest, 3.11) (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.12) (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.12) (push) Failing after 6m59s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.10) (push) Failing after 7m7s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.10) (push) Failing after 5m14s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.9) (push) Failing after 5m42s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.11) (push) Failing after 4m51s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.12) (push) Failing after 7m12s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.9) (push) Failing after 6m33s
Pyright Lint / Pyright Lint (pydantic-v1) (push) Failing after 8m12s
Ruff Lint / Ruff Lint (push) Successful in 43s
Pyright Lint / Pyright Lint (pydantic-v2) (push) Failing after 6m56s
Site Deploy / publish (push) Failing after 7m21s
2024-12-25 07:21:05 +00:00
Ju4tCode
762b2e6ef1 🔖 Release: v2.4.1 (#3204) 2024-12-25 15:15:20 +08:00
noneflow[bot]
3e3f504c1c 📝 Update changelog
Some checks failed
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.10) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.11) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.12) (push) Waiting to run
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.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.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.10) (push) Failing after 3m17s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.11) (push) Failing after 3m27s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.9) (push) Failing after 3m21s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.12) (push) Failing after 3m38s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.10) (push) Failing after 3m42s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.11) (push) Failing after 3m44s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.12) (push) Failing after 3m8s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.9) (push) Failing after 3m14s
Pyright Lint / Pyright Lint (pydantic-v2) (push) Failing after 3m10s
Pyright Lint / Pyright Lint (pydantic-v1) (push) Failing after 3m35s
Ruff Lint / Ruff Lint (push) Successful in 32s
Site Deploy / publish (push) Failing after 3m5s
2024-12-25 03:40:18 +00:00
Ant1816
8f8ce4b853 🍻 publish plugin nonebot_plugin_pjsekaihelper (#3179) 2024-12-25 03:39:05 +00:00
noneflow[bot]
18b6151c91 📝 Update changelog
Some checks failed
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.10) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.11) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.12) (push) Waiting to run
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.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.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.10) (push) Failing after 4m30s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.11) (push) Failing after 5m21s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.9) (push) Failing after 4m14s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.12) (push) Failing after 5m32s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.10) (push) Failing after 4m17s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.12) (push) Failing after 7s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.11) (push) Failing after 4m17s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.9) (push) Failing after 4m22s
Pyright Lint / Pyright Lint (pydantic-v1) (push) Failing after 4m25s
Ruff Lint / Ruff Lint (push) Successful in 57s
Pyright Lint / Pyright Lint (pydantic-v2) (push) Failing after 5m30s
Site Deploy / publish (push) Failing after 4m33s
2024-12-24 11:09:34 +00:00
suyiiyii
0f552743df 🍻 publish plugin Prometheus 监控 (#3198) 2024-12-24 11:08:20 +00:00
noneflow[bot]
fdc9c6f056 📝 Update changelog 2024-12-24 09:34:29 +00:00
padoru233
16812e3621 🍻 publish plugin 加群自动审批 (#3200) 2024-12-24 09:33:07 +00:00
noneflow[bot]
17c3c09d86 📝 Update changelog
Some checks failed
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.10) (push) Failing after 40s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.11) (push) Failing after 40s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.9) (push) Failing after 39s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.12) (push) Failing after 40s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.10) (push) Failing after 39s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.11) (push) Failing after 39s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.9) (push) Failing after 39s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.12) (push) Failing after 40s
Pyright Lint / Pyright Lint (pydantic-v2) (push) Failing after 38s
Pyright Lint / Pyright Lint (pydantic-v1) (push) Failing after 38s
Ruff Lint / Ruff Lint (push) Successful in 19s
Site Deploy / publish (push) Failing after 40s
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
2024-12-22 14:50:04 +00:00
Florenz0707
f7fe9fba5c 🍻 publish plugin nonebot-plugin-flo-luck (#3187) 2024-12-22 14:48:52 +00:00
noneflow[bot]
cc4d0b61f0 📝 Update changelog 2024-12-22 14:12:30 +00:00
Ju4tCode
19d9014279 📝 Docs: 添加 localstore 插件配置 (#3197) 2024-12-22 22:11:07 +08:00
noneflow[bot]
a63322633a 📝 Update changelog
Some checks failed
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.10) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.11) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.12) (push) Waiting to run
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.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.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.10) (push) Failing after 3m56s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.11) (push) Failing after 4m23s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.12) (push) Failing after 2m55s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.9) (push) Failing after 4m16s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.10) (push) Failing after 5m6s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.11) (push) Failing after 4m58s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.12) (push) Failing after 5m20s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.9) (push) Failing after 5m3s
Pyright Lint / Pyright Lint (pydantic-v1) (push) Failing after 4m50s
Pyright Lint / Pyright Lint (pydantic-v2) (push) Failing after 4m50s
Ruff Lint / Ruff Lint (push) Successful in 2m16s
Site Deploy / publish (push) Failing after 4m10s
2024-12-22 09:51:45 +00:00
ScorMax
5ddb9b295d 🍻 publish plugin 求生之路addons文件管理 (#3193) 2024-12-22 09:50:34 +00:00
noneflow[bot]
2d4379fcfa 📝 Update changelog
Some checks failed
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.10) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.11) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.12) (push) Waiting to run
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.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.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.11) (push) Failing after 2m44s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.10) (push) Failing after 3m6s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.12) (push) Failing after 3m18s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.9) (push) Failing after 3m16s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.10) (push) Failing after 3m17s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.11) (push) Failing after 3m24s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.12) (push) Failing after 3m0s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.9) (push) Failing after 2m43s
Pyright Lint / Pyright Lint (pydantic-v1) (push) Failing after 2m36s
Pyright Lint / Pyright Lint (pydantic-v2) (push) Failing after 2m45s
Ruff Lint / Ruff Lint (push) Successful in 32s
Site Deploy / publish (push) Failing after 2m38s
2024-12-22 03:03:38 +00:00
hakunomiko
227fb3b667 🍻 publish plugin 好友与群邀请管理 (#3189) 2024-12-22 03:02:27 +00:00
noneflow[bot]
faba8aae4e 📝 Update changelog
Some checks failed
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.10) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.11) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.12) (push) Waiting to run
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.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.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.11) (push) Failing after 3m37s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.10) (push) Failing after 4m23s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.12) (push) Failing after 4m18s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.9) (push) Failing after 4m24s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.10) (push) Failing after 4m10s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.11) (push) Failing after 4m1s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.12) (push) Failing after 4m34s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.9) (push) Failing after 4m33s
Pyright Lint / Pyright Lint (pydantic-v1) (push) Failing after 3m51s
Ruff Lint / Ruff Lint (push) Successful in 38s
Pyright Lint / Pyright Lint (pydantic-v2) (push) Failing after 4m58s
Site Deploy / publish (push) Failing after 4m23s
2024-12-21 05:52:44 +00:00
captain-wangrun-cn
852f033769 🍻 publish plugin 简易群聊屏蔽 (#3195) 2024-12-21 05:51:26 +00:00
noneflow[bot]
4975f4a0c8 📝 Update changelog
Some checks failed
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.10) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.11) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.12) (push) Waiting to run
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.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.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.11) (push) Failing after 52s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.10) (push) Failing after 53s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.12) (push) Failing after 48s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.9) (push) Failing after 47s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.11) (push) Failing after 47s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.10) (push) Failing after 48s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.12) (push) Failing after 47s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.9) (push) Failing after 48s
Pyright Lint / Pyright Lint (pydantic-v2) (push) Failing after 18s
Ruff Lint / Ruff Lint (push) Successful in 21s
Pyright Lint / Pyright Lint (pydantic-v1) (push) Failing after 46s
Site Deploy / publish (push) Failing after 47s
2024-12-20 15:16:38 +00:00
JQ-28
93eb6cae93 🍻 publish plugin Arcaea表情包生成器 (#3159) 2024-12-20 15:15:18 +00:00
noneflow[bot]
dea43fb1ef 📝 Update changelog
Some checks failed
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.11) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.12) (push) Waiting to run
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.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.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.11) (push) Failing after 1m51s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.10) (push) Failing after 1m57s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.12) (push) Failing after 1m48s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.9) (push) Failing after 1m54s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.10) (push) Failing after 1m44s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.11) (push) Failing after 1m48s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.12) (push) Failing after 1m49s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.9) (push) Failing after 1m43s
Pyright Lint / Pyright Lint (pydantic-v1) (push) Failing after 1m36s
Pyright Lint / Pyright Lint (pydantic-v2) (push) Failing after 1m37s
Ruff Lint / Ruff Lint (push) Successful in 27s
Site Deploy / publish (push) Failing after 1m32s
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.10) (push) Failing after 13m50s
2024-12-19 15:27:13 +00:00
lgc2333
dc83031589 🍻 publish plugin PicStatus Template ZhenXun (#3191) 2024-12-19 15:25:48 +00:00
noneflow[bot]
ebb4ca4dba 📝 Update changelog
Some checks failed
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.11) (push) Failing after 1m2s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.10) (push) Failing after 1m6s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.12) (push) Failing after 1m0s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.9) (push) Failing after 1m6s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.10) (push) Failing after 55s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.11) (push) Failing after 56s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.12) (push) Failing after 55s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.9) (push) Failing after 57s
Pyright Lint / Pyright Lint (pydantic-v1) (push) Failing after 59s
Pyright Lint / Pyright Lint (pydantic-v2) (push) Failing after 58s
Ruff Lint / Ruff Lint (push) Successful in 22s
Site Deploy / publish (push) Failing after 59s
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
2024-12-17 15:17:34 +00:00
MaStAr1128
25fc7a7449 🍻 publish plugin nonebot-plugin-ollama (#3181) 2024-12-17 15:16:07 +00:00
noneflow[bot]
f4f72dc2b3 📝 Update changelog 2024-12-17 15:06:50 +00:00
Kaguya233qwq
ac9ee830c6 🍻 publish plugin 南无阿弥陀佛 (#3177) 2024-12-17 15:05:31 +00:00
noneflow[bot]
73710aa311 📝 Update changelog
Some checks failed
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.10) (push) Failing after 1m3s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.11) (push) Failing after 1m6s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.12) (push) Failing after 59s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.9) (push) Failing after 1m2s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.10) (push) Failing after 1m1s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.11) (push) Failing after 1m1s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.12) (push) Failing after 1m3s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.9) (push) Failing after 1m0s
Pyright Lint / Pyright Lint (pydantic-v1) (push) Failing after 59s
Pyright Lint / Pyright Lint (pydantic-v2) (push) Failing after 59s
Ruff Lint / Ruff Lint (push) Successful in 25s
Site Deploy / publish (push) Failing after 1m3s
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
2024-12-15 03:02:48 +00:00
Refound-445
b8c4898eff 🍻 publish plugin 奶龙魔法 (#3173) 2024-12-15 03:01:24 +00:00
noneflow[bot]
9189711c0a 📝 Update changelog
Some checks failed
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.10) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.11) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.12) (push) Waiting to run
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.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.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.10) (push) Failing after 1m6s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.11) (push) Failing after 1m10s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.12) (push) Failing after 1m4s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.9) (push) Failing after 1m5s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.10) (push) Failing after 1m3s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.11) (push) Failing after 1m7s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.12) (push) Failing after 1m4s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.9) (push) Failing after 1m6s
Pyright Lint / Pyright Lint (pydantic-v1) (push) Failing after 1m6s
Pyright Lint / Pyright Lint (pydantic-v2) (push) Failing after 1m6s
Ruff Lint / Ruff Lint (push) Successful in 27s
Site Deploy / publish (push) Failing after 1m7s
2024-12-14 13:42:04 +00:00
Florenz0707
2d4c2e472b 🍻 publish plugin CSGO_MARKET (#3144) 2024-12-14 13:40:50 +00:00
noneflow[bot]
34427f0dd2 📝 Update changelog
Some checks failed
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.11) (push) Failing after 2m17s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.12) (push) Failing after 11s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.9) (push) Failing after 16s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.10) (push) Failing after 12s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.11) (push) Failing after 37s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.10) (push) Failing after 3m49s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.12) (push) Failing after 18s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.9) (push) Failing after 10s
Pyright Lint / Pyright Lint (pydantic-v2) (push) Failing after 10s
Ruff Lint / Ruff Lint (push) Successful in 2m45s
Pyright Lint / Pyright Lint (pydantic-v1) (push) Failing after 6m3s
Site Deploy / publish (push) Failing after 4m32s
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
2024-12-12 14:00:27 +00:00
zhiyu1998
4f7d3965d4 🍻 publish plugin 谷歌 Gemini 多模态助手 (#3164) 2024-12-12 13:59:02 +00:00
noneflow[bot]
64ce1a64d9 📝 Update changelog
Some checks failed
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.10) (push) Failing after 40s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.11) (push) Failing after 41s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.12) (push) Failing after 39s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.9) (push) Failing after 38s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.10) (push) Failing after 39s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.11) (push) Failing after 39s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.12) (push) Failing after 38s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.9) (push) Failing after 40s
Pyright Lint / Pyright Lint (pydantic-v1) (push) Failing after 37s
Pyright Lint / Pyright Lint (pydantic-v2) (push) Failing after 38s
Ruff Lint / Ruff Lint (push) Successful in 19s
Site Deploy / publish (push) Failing after 41s
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
2024-12-08 14:34:16 +00:00
uy/sun
ca79f29c60 🧑‍💻 Develop: 发布议题模板增加 Publish 标签 (#3174) 2024-12-08 22:33:05 +08:00
noneflow[bot]
d5cd6427b9 📝 Update changelog
Some checks failed
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.10) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.11) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.12) (push) Waiting to run
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.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.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.10) (push) Failing after 42s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.11) (push) Failing after 41s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.12) (push) Failing after 38s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.9) (push) Failing after 39s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.11) (push) Failing after 31s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.10) (push) Failing after 38s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.12) (push) Failing after 39s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.9) (push) Failing after 38s
Pyright Lint / Pyright Lint (pydantic-v1) (push) Failing after 37s
Pyright Lint / Pyright Lint (pydantic-v2) (push) Failing after 38s
Ruff Lint / Ruff Lint (push) Successful in 19s
Site Deploy / publish (push) Failing after 41s
2024-12-07 15:14:32 +00:00
fllesser
aa00ccf3be 🍻 publish plugin 名片赞,表情回应插件 (#3169) 2024-12-07 15:13:14 +00:00
noneflow[bot]
3997c09c34 📝 Update changelog 2024-12-07 14:51:14 +00:00
Guicheng Liu
4a06576c5e ✏️ Plugin: 移除插件 riffusion (#3171) 2024-12-07 22:50:04 +08:00
noneflow[bot]
67bca08ee2 📝 Update changelog
Some checks failed
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.10) (push) Failing after 16s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.11) (push) Failing after 54s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.12) (push) Failing after 46s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.9) (push) Failing after 1m13s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.10) (push) Failing after 1m12s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.11) (push) Failing after 46s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.12) (push) Failing after 45s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.9) (push) Failing after 44s
Pyright Lint / Pyright Lint (pydantic-v1) (push) Failing after 46s
Ruff Lint / Ruff Lint (push) Successful in 21s
Pyright Lint / Pyright Lint (pydantic-v2) (push) Failing after 51s
Site Deploy / publish (push) Failing after 54s
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
2024-12-06 03:14:26 +00:00
FrostN0v0
867766b469 🍻 publish plugin PCR签到重制版 (#3156) 2024-12-06 03:13:19 +00:00
noneflow[bot]
1175a4452e 📝 Update changelog 2024-12-06 02:59:02 +00:00
zhongwen-4
208533f5ca 🍻 publish plugin 发言统计 (#3161) 2024-12-06 02:57:51 +00:00
noneflow[bot]
4a6428100b 📝 Update changelog
Some checks failed
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.10) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.11) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.12) (push) Waiting to run
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.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.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.11) (push) Failing after 44s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.10) (push) Failing after 46s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.12) (push) Failing after 42s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.9) (push) Failing after 41s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.11) (push) Failing after 41s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.10) (push) Failing after 42s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.12) (push) Failing after 41s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.9) (push) Failing after 42s
Pyright Lint / Pyright Lint (pydantic-v2) (push) Failing after 40s
Pyright Lint / Pyright Lint (pydantic-v1) (push) Failing after 41s
Ruff Lint / Ruff Lint (push) Successful in 21s
Site Deploy / publish (push) Failing after 43s
2024-12-05 12:56:42 +00:00
Ju4tCode
32bc2c314a Feature: 存储 matcher 发送 prompt 的结果 (#3155) 2024-12-05 20:55:24 +08:00
noneflow[bot]
ab8dea5a02 📝 Update changelog
Some checks failed
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.10) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.11) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.12) (push) Waiting to run
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.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.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.10) (push) Failing after 2m20s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.11) (push) Failing after 2m18s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.12) (push) Failing after 2m21s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.9) (push) Failing after 2m16s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.11) (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.10) (push) Failing after 2m35s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.12) (push) Failing after 2m46s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.9) (push) Failing after 2m31s
Pyright Lint / Pyright Lint (pydantic-v1) (push) Failing after 2m38s
Ruff Lint / Ruff Lint (push) Successful in 28s
Pyright Lint / Pyright Lint (pydantic-v2) (push) Failing after 2m33s
Site Deploy / publish (push) Failing after 2m15s
2024-12-05 11:26:52 +00:00
uy/sun
e06076aa3a 👷 CI: 删除 NoneFlow 中关于 pre-commit 的部分 (#3166) 2024-12-05 19:25:41 +08:00
noneflow[bot]
36d90c0efd 📝 Update changelog
Some checks failed
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.11) (push) Failing after 1m17s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.10) (push) Failing after 1m23s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.12) (push) Failing after 1m16s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.9) (push) Failing after 1m21s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.10) (push) Failing after 1m24s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.11) (push) Failing after 1m21s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.12) (push) Failing after 1m20s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.9) (push) Failing after 1m39s
Pyright Lint / Pyright Lint (pydantic-v1) (push) Failing after 1m20s
Ruff Lint / Ruff Lint (push) Successful in 23s
Pyright Lint / Pyright Lint (pydantic-v2) (push) Failing after 1m22s
Site Deploy / publish (push) Failing after 1m26s
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
2024-12-04 03:00:23 +00:00
fllesser
0fbfa20257 🍻 publish plugin 链接分享解析器重制版 (#3153) 2024-12-04 02:59:13 +00:00
noneflow[bot]
6c0d5f3e1d 📝 Update changelog
Some checks failed
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.10) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.11) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.12) (push) Waiting to run
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.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.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.10) (push) Failing after 41s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.11) (push) Failing after 41s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.12) (push) Failing after 39s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.9) (push) Failing after 39s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.10) (push) Failing after 38s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.11) (push) Failing after 39s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.12) (push) Failing after 38s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.9) (push) Failing after 38s
Pyright Lint / Pyright Lint (pydantic-v1) (push) Failing after 37s
Pyright Lint / Pyright Lint (pydantic-v2) (push) Failing after 37s
Ruff Lint / Ruff Lint (push) Successful in 19s
Site Deploy / publish (push) Failing after 41s
2024-12-03 11:32:44 +00:00
uy/sun
0b72c765a7 📝 Docs: 使用勾选框而不是评论来重新测试插件 (#3158) 2024-12-03 19:31:21 +08:00
noneflow[bot]
21815b380f 📝 Update changelog
Some checks failed
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.10) (push) Failing after 1m43s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.11) (push) Failing after 1m53s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.9) (push) Failing after 1m39s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.12) (push) Failing after 1m53s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.10) (push) Failing after 1m44s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.11) (push) Failing after 1m56s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.12) (push) Failing after 26s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.9) (push) Failing after 1m50s
Pyright Lint / Pyright Lint (pydantic-v1) (push) Failing after 1m41s
Ruff Lint / Ruff Lint (push) Successful in 37s
Pyright Lint / Pyright Lint (pydantic-v2) (push) Failing after 1m44s
Site Deploy / publish (push) Failing after 2m5s
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
2024-12-02 07:38:01 +00:00
Ju4tCode
9fed938de1 🐛 Fix: httpx proxy 与 aiohttp timeout 参数新版本修改 (#3152) 2024-12-02 15:36:44 +08:00
noneflow[bot]
6df8d5b254 📝 Update changelog 2024-12-02 03:38:35 +00:00
HibiKier
aedc541d03 🍻 publish plugin ZXWB词库问答 (#3142) 2024-12-02 03:37:18 +00:00
noneflow[bot]
bdf8dff08e 📝 Update changelog
Some checks failed
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.10) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.11) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.12) (push) Waiting to run
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.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.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.11) (push) Failing after 1m49s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.10) (push) Failing after 1m59s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.12) (push) Failing after 2m0s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.9) (push) Failing after 2m1s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.10) (push) Failing after 1m55s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.11) (push) Failing after 2m3s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.12) (push) Failing after 2m4s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.9) (push) Failing after 2m0s
Pyright Lint / Pyright Lint (pydantic-v1) (push) Failing after 2m1s
Pyright Lint / Pyright Lint (pydantic-v2) (push) Failing after 2m13s
Ruff Lint / Ruff Lint (push) Successful in 27s
Site Deploy / publish (push) Failing after 1m56s
2024-12-01 04:32:22 +00:00
Ju4tCode
081dc8352d 🚨 Develop: 完全使用 ruff 替代 isort 与 black (#3151) 2024-12-01 12:31:11 +08:00
noneflow[bot]
6dad4d2a74 📝 Update changelog
Some checks failed
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.10) (push) Failing after 3m26s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.11) (push) Failing after 3m30s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.12) (push) Failing after 2m57s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.9) (push) Failing after 3m7s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.11) (push) Failing after 3m0s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.10) (push) Failing after 3m47s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.12) (push) Failing after 3m43s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.9) (push) Failing after 4m9s
Pyright Lint / Pyright Lint (pydantic-v1) (push) Failing after 3m27s
Pyright Lint / Pyright Lint (pydantic-v2) (push) Failing after 3m9s
Ruff Lint / Ruff Lint (push) Failing after 1m1s
Site Deploy / publish (push) Failing after 2m43s
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
2024-11-28 07:03:21 +00:00
Reversedeer
3528339751 🍻 publish plugin nonebot-plugin-hyp (#3139) 2024-11-28 07:02:09 +00:00
noneflow[bot]
efae3c8756 📝 Update changelog
Some checks failed
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.11) (push) Failing after 1m2s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.10) (push) Failing after 1m5s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.12) (push) Failing after 1m2s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.9) (push) Failing after 1m2s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.10) (push) Failing after 49s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.11) (push) Failing after 1m2s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.12) (push) Failing after 1m0s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.9) (push) Failing after 1m4s
Pyright Lint / Pyright Lint (pydantic-v1) (push) Failing after 59s
Pyright Lint / Pyright Lint (pydantic-v2) (push) Failing after 1m1s
Ruff Lint / Ruff Lint (push) Failing after 26s
Site Deploy / publish (push) Failing after 1m3s
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
2024-11-24 07:15:44 +00:00
1296lol
3aa1bc7b66 🍻 publish plugin nonebot-plugin-zepplife (#3131) 2024-11-24 07:14:24 +00:00
noneflow[bot]
f6027bbcd9 📝 Update changelog 2024-11-24 02:31:41 +00:00
Yan-Zero
1dec074232 🍻 publish plugin 权限控制 (#3111) 2024-11-24 02:30:30 +00:00
noneflow[bot]
76a455227d 📝 Update changelog
Some checks failed
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.10) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.11) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.12) (push) Waiting to run
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.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.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.10) (push) Failing after 1m3s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.11) (push) Failing after 1m5s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.12) (push) Failing after 1m1s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.9) (push) Failing after 1m0s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.10) (push) Failing after 1m1s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.11) (push) Failing after 1m1s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.12) (push) Failing after 1m1s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.9) (push) Failing after 1m0s
Pyright Lint / Pyright Lint (pydantic-v1) (push) Failing after 1m0s
Pyright Lint / Pyright Lint (pydantic-v2) (push) Failing after 1m0s
Ruff Lint / Ruff Lint (push) Failing after 26s
Site Deploy / publish (push) Failing after 1m4s
2024-11-23 09:52:15 +00:00
mmdexb
b33845b936 🍻 publish plugin nonebot-plugin-api-scheduler (#3073) 2024-11-23 09:51:03 +00:00
noneflow[bot]
56f1927376 📝 Update changelog
Some checks failed
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.10) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.11) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.12) (push) Waiting to run
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.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.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.11) (push) Failing after 28s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.10) (push) Failing after 1m9s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.12) (push) Failing after 1m0s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.9) (push) Failing after 1m0s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.10) (push) Failing after 1m2s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.11) (push) Failing after 1m0s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.12) (push) Failing after 1m2s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.9) (push) Failing after 1m3s
Pyright Lint / Pyright Lint (pydantic-v1) (push) Failing after 1m2s
Ruff Lint / Ruff Lint (push) Failing after 25s
Pyright Lint / Pyright Lint (pydantic-v2) (push) Failing after 1m1s
Site Deploy / publish (push) Failing after 1m4s
2024-11-23 04:30:34 +00:00
Ju4tCode
232b7134f0 📝 Docs: 添加 pytest-asyncio 配置 (#3136) 2024-11-23 12:29:12 +08:00
noneflow[bot]
980affd31b 📝 Update changelog 2024-11-23 03:36:15 +00:00
Ju4tCode
f2a35a7520 ⬆️ Fix: 屏蔽 pydantic 2.10.0 (#3137) 2024-11-23 11:34:15 +08:00
Ju4tCode
02c41eb97a 👷 CI: 添加 codecov junit result report (#3138) 2024-11-23 11:25:39 +08:00
noneflow[bot]
06682ee36a 📝 Update changelog
Some checks failed
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.10) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.11) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.12) (push) Waiting to run
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.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.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.10) (push) Failing after 57s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.11) (push) Failing after 57s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.12) (push) Failing after 53s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.9) (push) Failing after 56s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.10) (push) Failing after 52s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.11) (push) Failing after 52s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.12) (push) Failing after 54s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.9) (push) Failing after 53s
Pyright Lint / Pyright Lint (pydantic-v1) (push) Failing after 55s
Pyright Lint / Pyright Lint (pydantic-v2) (push) Failing after 52s
Ruff Lint / Ruff Lint (push) Successful in 23s
Site Deploy / publish (push) Failing after 57s
2024-11-22 07:44:27 +00:00
CM-Edelweiss
97e3ee32e7 🍻 publish plugin nb商店插件安装器web版 (#3125) 2024-11-22 07:43:12 +00:00
noneflow[bot]
a4bc8fe544 📝 Update changelog 2024-11-22 06:17:48 +00:00
StarHeart
e0d7e90f4a 📝 Docs: 移除侧栏遮罩及启用构建加速 (#3135) 2024-11-22 14:16:22 +08:00
dependabot[bot]
4404a6c74e ⬆️ Bump codecov/codecov-action from 4 to 5 in the actions group (#3119)
Some checks failed
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.10) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.11) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.12) (push) Waiting to run
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.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.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.10) (push) Failing after 1m24s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.11) (push) Failing after 1m26s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.12) (push) Failing after 46s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.9) (push) Failing after 1m1s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.10) (push) Failing after 1m6s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.11) (push) Failing after 1m0s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.12) (push) Failing after 1m2s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.9) (push) Failing after 1m8s
Pyright Lint / Pyright Lint (pydantic-v1) (push) Failing after 1m5s
Pyright Lint / Pyright Lint (pydantic-v2) (push) Failing after 1m4s
Ruff Lint / Ruff Lint (push) Successful in 26s
Site Deploy / publish (push) Failing after 1m3s
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-21 21:56:00 +08:00
noneflow[bot]
ae8bf488d0 📝 Update changelog 2024-11-21 13:33:48 +00:00
mobyw
9f6e8a1833 📝 Docs: 添加 Mail 适配器说明 (#3134) 2024-11-21 21:32:31 +08:00
noneflow[bot]
af03c61f89 📝 Update changelog
Some checks failed
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.10) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.11) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.12) (push) Waiting to run
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.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.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.10) (push) Failing after 56s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.11) (push) Failing after 56s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.9) (push) Failing after 52s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.12) (push) Failing after 55s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.10) (push) Failing after 53s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.11) (push) Failing after 57s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.12) (push) Failing after 54s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.9) (push) Failing after 53s
Pyright Lint / Pyright Lint (pydantic-v1) (push) Failing after 54s
Pyright Lint / Pyright Lint (pydantic-v2) (push) Failing after 53s
Ruff Lint / Ruff Lint (push) Successful in 22s
Site Deploy / publish (push) Failing after 55s
2024-11-20 15:30:01 +00:00
mobyw
7a1e9adf33 🍻 publish adapter Mail (#3128) 2024-11-20 15:28:52 +00:00
BigOrangeQWQ
eed42db645 ✏️ CI: 更新 plugins 数据的 project_link 字段 (#3130)
Some checks failed
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.10) (push) Failing after 1m5s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.11) (push) Failing after 1m7s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.12) (push) Failing after 58s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.9) (push) Failing after 1m0s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.10) (push) Failing after 59s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.11) (push) Failing after 1m0s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.12) (push) Failing after 1m2s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.9) (push) Failing after 59s
Pyright Lint / Pyright Lint (pydantic-v2) (push) Failing after 1m2s
Pyright Lint / Pyright Lint (pydantic-v1) (push) Failing after 1m2s
Ruff Lint / Ruff Lint (push) Successful in 24s
Site Deploy / publish (push) Failing after 1m1s
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
2024-11-19 19:24:02 +08:00
uy/sun
7f8b5e9993 👷 CI: 使用最新版的 NoneFlow (#3127)
Some checks failed
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.10) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.11) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.12) (push) Waiting to run
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.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.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.10) (push) Failing after 57s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.11) (push) Failing after 57s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.9) (push) Failing after 18s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.10) (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.12) (push) Failing after 53s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.11) (push) Failing after 56s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.12) (push) Failing after 54s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.9) (push) Failing after 54s
Pyright Lint / Pyright Lint (pydantic-v1) (push) Failing after 51s
Ruff Lint / Ruff Lint (push) Successful in 22s
Pyright Lint / Pyright Lint (pydantic-v2) (push) Failing after 52s
Site Deploy / publish (push) Failing after 55s
2024-11-18 23:18:27 +08:00
Ju4tCode
83552d6995 🔒 Security: restrict workflow context (#3124)
Co-authored-by: polarathene <5098581+polarathene@users.noreply.github.com>
2024-11-18 23:09:11 +08:00
noneflow[bot]
3bf393444d 📝 Update changelog
Some checks failed
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.10) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.11) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.12) (push) Waiting to run
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.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.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.11) (push) Failing after 1m1s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.10) (push) Failing after 1m3s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.12) (push) Failing after 58s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.9) (push) Failing after 1m2s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.10) (push) Failing after 1m0s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.11) (push) Failing after 1m2s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.12) (push) Failing after 58s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.9) (push) Failing after 1m0s
Pyright Lint / Pyright Lint (pydantic-v1) (push) Failing after 1m1s
Pyright Lint / Pyright Lint (pydantic-v2) (push) Failing after 57s
Ruff Lint / Ruff Lint (push) Successful in 25s
Site Deploy / publish (push) Failing after 1m1s
2024-11-18 11:06:35 +00:00
zhaomaoniu
fd2ed08009 🍻 publish plugin 恩情课文 (#3122) 2024-11-18 11:05:29 +00:00
noneflow[bot]
9b421548d6 📝 Update changelog 2024-11-18 10:54:05 +00:00
zhiyu1998
f2d9a3ba6b 🍻 publish plugin 自动点赞订阅赞 (#3102) 2024-11-18 10:53:01 +00:00
noneflow[bot]
abe90c0074 📝 Update changelog
Some checks failed
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.10) (push) Failing after 1m6s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.11) (push) Failing after 1m5s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.12) (push) Failing after 1m0s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.9) (push) Failing after 1m1s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.10) (push) Failing after 1m3s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.11) (push) Failing after 1m1s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.12) (push) Failing after 1m0s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.9) (push) Failing after 1m3s
Pyright Lint / Pyright Lint (pydantic-v1) (push) Failing after 1m2s
Pyright Lint / Pyright Lint (pydantic-v2) (push) Failing after 1m1s
Ruff Lint / Ruff Lint (push) Successful in 25s
Site Deploy / publish (push) Failing after 1m2s
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
2024-11-17 03:59:39 +00:00
EienSakura
9a0cf5b9dc 🍻 publish bot Mio澪 (#3120) 2024-11-17 03:58:24 +00:00
noneflow[bot]
f9f82da58d 📝 Update changelog
Some checks failed
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.10) (push) Failing after 17s
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.11) (push) Failing after 15s
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.12) (push) Failing after 16s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.11) (push) Failing after 58s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.10) (push) Failing after 58s
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.9) (push) Failing after 16s
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.10) (push) Failing after 15s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.12) (push) Failing after 56s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.9) (push) Failing after 56s
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.11) (push) Failing after 15s
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.12) (push) Failing after 16s
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.9) (push) Failing after 15s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.11) (push) Failing after 55s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.10) (push) Failing after 57s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.12) (push) Failing after 56s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.9) (push) Failing after 56s
Pyright Lint / Pyright Lint (pydantic-v1) (push) Failing after 55s
Pyright Lint / Pyright Lint (pydantic-v2) (push) Failing after 55s
Ruff Lint / Ruff Lint (push) Successful in 23s
Site Deploy / publish (push) Failing after 57s
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
2024-11-12 15:10:53 +00:00
小久
a067d1b1b1 ✏️ Plugin: 删除function 插件,添加 batch-withdrawal 插件标签 (#3118) 2024-11-12 23:09:47 +08:00
noneflow[bot]
a97f0e6da9 📝 Update changelog
Some checks failed
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.10) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.11) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.12) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, macos-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.9) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.10) (push) Failing after 19s
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.11) (push) Failing after 15s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.11) (push) Failing after 1m0s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.10) (push) Failing after 1m2s
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.12) (push) Failing after 15s
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.9) (push) Failing after 16s
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.10) (push) Failing after 15s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.12) (push) Failing after 59s
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.11) (push) Failing after 15s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.9) (push) Failing after 59s
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.12) (push) Failing after 15s
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.9) (push) Failing after 14s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.10) (push) Failing after 1m1s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.11) (push) Failing after 59s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.12) (push) Failing after 1m1s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.9) (push) Failing after 1m2s
Pyright Lint / Pyright Lint (pydantic-v1) (push) Failing after 57s
Pyright Lint / Pyright Lint (pydantic-v2) (push) Failing after 1m0s
Ruff Lint / Ruff Lint (push) Successful in 23s
Site Deploy / publish (push) Failing after 1m1s
2024-11-12 07:11:50 +00:00
zhongwen-4
58b18ada6f 🍻 publish plugin 违禁词撤回 (#3116) 2024-11-12 07:10:52 +00:00
noneflow[bot]
6f8c4692c8 📝 Update changelog
Some checks failed
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.10) (push) Failing after 24s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.10) (push) Failing after 42s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.11) (push) Failing after 42s
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.11) (push) Failing after 17s
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.12) (push) Failing after 16s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.12) (push) Failing after 42s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.9) (push) Failing after 42s
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.9) (push) Failing after 15s
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.10) (push) Failing after 16s
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.11) (push) Failing after 15s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.10) (push) Failing after 41s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.11) (push) Failing after 41s
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.12) (push) Failing after 15s
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.9) (push) Failing after 15s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.12) (push) Failing after 44s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.9) (push) Failing after 42s
Pyright Lint / Pyright Lint (pydantic-v1) (push) Failing after 39s
Pyright Lint / Pyright Lint (pydantic-v2) (push) Failing after 39s
Ruff Lint / Ruff Lint (push) Successful in 19s
Site Deploy / publish (push) Failing after 44s
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
2024-11-10 12:20:14 +00:00
STESmly
ad4a04dae2 🍻 publish plugin b站弹幕监控 (#3090) 2024-11-10 12:19:17 +00:00
noneflow[bot]
d62e59325b 📝 Update changelog
Some checks failed
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.10) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.11) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.12) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, macos-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.9) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.10) (push) Failing after 18s
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.11) (push) Failing after 16s
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.12) (push) Failing after 15s
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.9) (push) Failing after 15s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.10) (push) Failing after 1m28s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.11) (push) Failing after 1m31s
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.10) (push) Failing after 16s
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.11) (push) Failing after 15s
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.12) (push) Failing after 15s
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.9) (push) Failing after 15s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.12) (push) Failing after 1m50s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.9) (push) Failing after 2m0s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.11) (push) Failing after 1m20s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.10) (push) Failing after 1m34s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.12) (push) Failing after 1m58s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.9) (push) Failing after 2m4s
Pyright Lint / Pyright Lint (pydantic-v2) (push) Failing after 2m24s
Pyright Lint / Pyright Lint (pydantic-v1) (push) Failing after 2m50s
Ruff Lint / Ruff Lint (push) Successful in 30s
Site Deploy / publish (push) Failing after 1m40s
2024-11-10 10:04:09 +00:00
captain-wangrun-cn
781f8a67df 🍻 publish plugin nonebot_plugin_better_broadcast (#3113) 2024-11-10 10:03:19 +00:00
noneflow[bot]
599bb377b7 📝 Update changelog
Some checks failed
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.10) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.11) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.12) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, macos-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.9) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.10) (push) Failing after 17s
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.11) (push) Failing after 14s
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.12) (push) Failing after 14s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.10) (push) Failing after 58s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.11) (push) Failing after 58s
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.9) (push) Failing after 14s
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.10) (push) Failing after 15s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.12) (push) Failing after 51s
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.11) (push) Failing after 15s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.9) (push) Failing after 51s
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.12) (push) Failing after 15s
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.9) (push) Failing after 14s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.10) (push) Failing after 1m23s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.11) (push) Failing after 1m21s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.12) (push) Failing after 1m19s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.9) (push) Failing after 1m40s
Pyright Lint / Pyright Lint (pydantic-v1) (push) Failing after 1m25s
Pyright Lint / Pyright Lint (pydantic-v2) (push) Failing after 1m17s
Ruff Lint / Ruff Lint (push) Successful in 29s
Site Deploy / publish (push) Failing after 1m52s
2024-11-09 12:41:35 +00:00
鹿友-Reina
97fd095666 ✏️ Plugin: 删除插件 nonebot-plugin-llob-master (#3115) 2024-11-09 20:40:40 +08:00
noneflow[bot]
3aec8e3acd 📝 Update changelog
Some checks failed
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.10) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.11) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.12) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, macos-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.9) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.10) (push) Failing after 28s
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.11) (push) Failing after 15s
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.12) (push) Failing after 14s
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.9) (push) Failing after 14s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.10) (push) Failing after 1m28s
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.10) (push) Failing after 21s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.11) (push) Failing after 1m45s
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.11) (push) Failing after 21s
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.12) (push) Failing after 13s
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.9) (push) Failing after 14s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.9) (push) Failing after 1m29s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.12) (push) Failing after 2m2s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.10) (push) Failing after 2m33s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.11) (push) Failing after 2m23s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.12) (push) Failing after 1m53s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.9) (push) Failing after 1m51s
Pyright Lint / Pyright Lint (pydantic-v1) (push) Failing after 1m41s
Pyright Lint / Pyright Lint (pydantic-v2) (push) Failing after 1m46s
Ruff Lint / Ruff Lint (push) Successful in 29s
Site Deploy / publish (push) Failing after 1m52s
2024-11-09 02:57:49 +00:00
Ju4tCode
1fdb7a45cf 🔊 Feature: 提升已加载的适配器日志等级 (#3110) 2024-11-09 10:56:53 +08:00
noneflow[bot]
9f6c750236 📝 Update changelog
Some checks failed
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.10) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.11) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.12) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, macos-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.9) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.10) (push) Failing after 27s
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.11) (push) Failing after 20s
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.12) (push) Failing after 14s
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.9) (push) Failing after 14s
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.10) (push) Failing after 13s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.11) (push) Failing after 1m42s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.10) (push) Failing after 1m53s
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.11) (push) Failing after 13s
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.12) (push) Failing after 14s
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.9) (push) Failing after 13s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.9) (push) Failing after 1m12s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.12) (push) Failing after 1m23s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.10) (push) Failing after 53s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.11) (push) Failing after 53s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.9) (push) Failing after 54s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.12) (push) Failing after 59s
Pyright Lint / Pyright Lint (pydantic-v2) (push) Failing after 56s
Pyright Lint / Pyright Lint (pydantic-v1) (push) Failing after 1m1s
Ruff Lint / Ruff Lint (push) Successful in 24s
Site Deploy / publish (push) Failing after 1m52s
2024-11-08 08:45:47 +00:00
zhongwen-4
4a52662ad8 🍻 publish plugin PyPi下载统计 (#3108) 2024-11-08 08:44:48 +00:00
pre-commit-ci[bot]
0660ddba28 ⬆️ auto update by pre-commit hooks (#3107)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-11-05 10:43:46 +08:00
noneflow[bot]
463eddb0f4 📝 Update changelog 2024-11-04 13:11:36 +00:00
KhasAlushird
aa0c113e65 🍻 publish plugin nonebot-plugin-leetcodeapi-khasa (#3074) 2024-11-04 13:10:26 +00:00
noneflow[bot]
babd8b2093 📝 Update changelog 2024-11-04 08:08:50 +00:00
StarHeart
23bcab5450 🐛 Docs: 修复 wwads 造成的 client 水合不匹配 (#3106) 2024-11-04 16:07:50 +08:00
noneflow[bot]
d766455d13 📝 Update changelog 2024-11-04 07:54:49 +00:00
StarHeart
c9bea5d0ea 📝 Docs: 修复 wwads (#3105) 2024-11-04 15:53:45 +08:00
noneflow[bot]
8704ee42f1 📝 Update changelog 2024-11-01 14:52:19 +00:00
eya46
bf366d8361 🍻 publish plugin Ohh My Bot (#3088) 2024-11-01 14:51:16 +00:00
noneflow[bot]
cf9729aac4 📝 Update changelog 2024-11-01 14:24:21 +00:00
StarHeart
58475fe929 📝 Docs: 修复侧边栏折叠状态问题 (#3101) 2024-11-01 22:23:04 +08:00
noneflow[bot]
57c553f971 📝 Update changelog 2024-11-01 05:55:46 +00:00
StarHeart
2b8aae4eee 📝 Docs: Changelog 按页码挂载 route (#3100) 2024-11-01 13:54:27 +08:00
noneflow[bot]
c5aa5d3deb 📝 Update changelog 2024-11-01 04:18:37 +00:00
Ju4tCode
3d8731f41d 📝 Docs: 修复 changelog 链接 (#3098)
Co-authored-by: StarHeartHunt <starheart233@gmail.com>
2024-11-01 12:17:23 +08:00
noneflow[bot]
5e86d53e0b 🔖 Release 2.4.0 2024-10-31 13:45:33 +00:00
Ju4tCode
a50a3398de 🔖 Release: v2.4.0 (#3097) 2024-10-31 21:35:08 +08:00
noneflow[bot]
950930a275 📝 Update changelog 2024-10-31 11:01:53 +00:00
DiaoDaiaChan
c7af169a94 🍻 publish plugin Comfyui绘图插件 (#3080) 2024-10-31 11:00:37 +00:00
noneflow[bot]
e17096d8d7 📝 Update changelog 2024-10-31 09:25:24 +00:00
tkgs0
00e9e74dfc 🍻 publish plugin 每日wife (#3093) 2024-10-31 09:24:19 +00:00
noneflow[bot]
934954d985 📝 Update changelog 2024-10-31 08:49:34 +00:00
Ju4tCode
a4a4991473 📝 Docs: 新增 nonebug 新版启动需要的配置 (#3087) 2024-10-31 16:48:22 +08:00
noneflow[bot]
60acb71033 📝 Update changelog 2024-10-31 07:38:50 +00:00
StarHeart
f8b4dfb1b1 📝 Docs: 修复侧边栏滚动 (#3062) 2024-10-31 15:37:23 +08:00
noneflow[bot]
ee5561046f 📝 Update changelog 2024-10-31 05:13:30 +00:00
YuuzukiRin
6660c3b471 🍻 publish plugin nonebot_plugin_impart (#3078) 2024-10-31 05:12:15 +00:00
noneflow[bot]
bd5ba84737 📝 Update changelog 2024-10-31 04:50:01 +00:00
Ju4tCode
15c5464069 Feature: 跳过部分非必要的 task group 创建 (#3095) 2024-10-31 12:47:29 +08:00
noneflow[bot]
7b136548a9 📝 Update changelog 2024-10-30 13:29:19 +00:00
wangyw15
36ed8030d3 🍻 publish bot CanrotBot (#3085) 2024-10-30 13:27:57 +00:00
noneflow[bot]
eff1fe455f 📝 Update changelog 2024-10-29 06:23:51 +00:00
Ju4tCode
e3cb4c7907 🐛 Fix: 修复结构化并发子依赖取消缓存问题 (#3084) 2024-10-29 14:22:41 +08:00
noneflow[bot]
be732cf9d8 📝 Update changelog 2024-10-28 11:31:31 +00:00
HibiKier
88a5966a40 🍻 publish plugin Pix图库 (#3082) 2024-10-28 11:30:21 +00:00
noneflow[bot]
bdde496332 📝 Update changelog 2024-10-26 15:04:43 +00:00
YuuzukiRin
a989a895e4 🍻 publish plugin nonebot_plugin_partner_join (#3048) 2024-10-26 15:03:23 +00:00
noneflow[bot]
7fc51e9227 📝 Update changelog 2024-10-26 08:14:26 +00:00
eya46
571fd007ba 🍻 publish plugin pong (#3065) 2024-10-26 08:13:17 +00:00
noneflow[bot]
599ef3b253 📝 Update changelog 2024-10-26 07:43:58 +00:00
eya46
c0c7d141ef 🍻 publish plugin Bot的消息也是消息 (#3063) 2024-10-26 07:42:44 +00:00
noneflow[bot]
3be68895e5 📝 Update changelog 2024-10-26 07:37:16 +00:00
Ju4tCode
ff21ceb946 Feature: 迁移至结构化并发框架 AnyIO (#3053) 2024-10-26 15:36:01 +08:00
noneflow[bot]
bd9befbb55 📝 Update changelog 2024-10-26 04:56:40 +00:00
Lonely-Sails
ed91ec9bf5 🍻 publish plugin BiliMusic Downloader (#3045) 2024-10-26 04:55:34 +00:00
noneflow[bot]
a00def5d86 📝 Update changelog 2024-10-26 04:48:33 +00:00
Ant1816
973282587e 🍻 publish bot 小安提Bot (#3060) 2024-10-26 04:47:16 +00:00
noneflow[bot]
8a6d209942 📝 Update changelog 2024-10-23 07:42:02 +00:00
zhongwen-4
fcd226031b 🍻 publish plugin 防撤回 (#3054) 2024-10-23 07:40:56 +00:00
noneflow[bot]
fb3f0d5e30 📝 Update changelog 2024-10-23 06:19:03 +00:00
YuuzukiRin
56518748d9 🍻 publish plugin nonebot_plugin_mai_arcade (#3044) 2024-10-23 06:17:44 +00:00
noneflow[bot]
474398ee3d 📝 Update changelog 2024-10-23 04:02:12 +00:00
gongfuture
597b104111 🍻 publish plugin DDNet 成绩查询 (#3030) 2024-10-23 04:01:06 +00:00
noneflow[bot]
acec8945ac 📝 Update changelog 2024-10-22 13:24:49 +00:00
ChenXu233
06b5f09371 🍻 publish plugin 省流 (#3041) 2024-10-22 13:23:38 +00:00
noneflow[bot]
15470cd3bb 📝 Update changelog 2024-10-22 02:35:06 +00:00
StarHeart
c1c5f57e0b 📝 Docs: 升级到 Docusaurus V3 (#2956) 2024-10-22 10:33:48 +08:00
noneflow[bot]
533e8794b2 📝 Update changelog 2024-10-21 10:03:18 +00:00
Cvandia
05c20a7a86 🍻 publish plugin FishSpeechTTS (#3049) 2024-10-21 10:02:12 +00:00
noneflow[bot]
edb416736b 📝 Update changelog 2024-10-20 12:36:27 +00:00
Onimaimai
2a68bb1b6e 🍻 publish plugin 语音点歌 (#3036) 2024-10-20 12:35:22 +00:00
noneflow[bot]
29ffbc630a 📝 Update changelog 2024-10-20 05:59:57 +00:00
snowykami
5cf6b93984 🍻 publish plugin Gotify (#3042) 2024-10-20 05:58:49 +00:00
noneflow[bot]
30011e3fb4 📝 Update changelog 2024-10-20 02:20:52 +00:00
zhongwen-4
36606ab05a 🍻 publish plugin 涩图插件 (#3038) 2024-10-20 02:19:49 +00:00
noneflow[bot]
0aba6b4bb4 📝 Update changelog 2024-10-20 02:15:59 +00:00
ssttkkl
fab51d9605 ✏️ Plugin: 移除不再维护的插件 (#3040) 2024-10-20 10:14:55 +08:00
noneflow[bot]
d7e2cc608b 📝 Update changelog 2024-10-19 16:08:07 +00:00
yeying-xingchen
b2c5ab3235 🍻 publish plugin boom (#3016) 2024-10-19 16:07:02 +00:00
noneflow[bot]
1668568d1a 📝 Update changelog 2024-10-19 08:49:11 +00:00
Agnes4m
4385934a6b 🍻 publish plugin 恶魔轮盘赌 (#3032) 2024-10-19 08:48:09 +00:00
noneflow[bot]
4830182050 📝 Update changelog 2024-10-18 15:09:49 +00:00
Onimaimai
d86a86d4b2 🍻 publish plugin 机厅 (#3028) 2024-10-18 15:08:38 +00:00
noneflow[bot]
f175bc9e80 📝 Update changelog 2024-10-18 14:40:56 +00:00
CM-Edelweiss
40c2bc636a 🍻 publish plugin PM帮助 (#3022) 2024-10-18 14:39:50 +00:00
noneflow[bot]
8ad5a8d4d1 📝 Update changelog 2024-10-18 13:51:38 +00:00
Refound-445
aed91dcc48 🍻 publish plugin NailongRemove (#2953) 2024-10-18 13:50:31 +00:00
noneflow[bot]
de8ffb6c97 📝 Update changelog 2024-10-18 12:59:02 +00:00
Onimaimai
990cf32304 🍻 publish plugin 团购 help (#3025) 2024-10-18 12:57:57 +00:00
noneflow[bot]
09b3f13e7e 📝 Update changelog 2024-10-14 13:22:17 +00:00
HibiKier
c39b13b782 🍻 publish plugin 真寻日报 (#3020) 2024-10-14 13:21:07 +00:00
noneflow[bot]
3ec4611a29 📝 Update changelog 2024-10-14 12:56:39 +00:00
zhongwen-4
9d6832303d 🍻 publish plugin 运行状态 (#3018) 2024-10-14 12:55:33 +00:00
noneflow[bot]
9fc9f7c384 📝 Update changelog 2024-10-10 06:26:10 +00:00
qllokirin
2021e81ed2 🍻 publish plugin 西工大翱翔门户成绩监控 (#3011) 2024-10-10 06:25:06 +00:00
noneflow[bot]
ada6e1ab64 📝 Update changelog 2024-10-10 06:18:05 +00:00
hanasa2023
2723a372da 🍻 publish plugin nb插件更新器 (#3014) 2024-10-10 06:17:01 +00:00
noneflow[bot]
a56c93cbcc 📝 Update changelog 2024-10-09 14:30:36 +00:00
ChenXu233
230476d8ae 🍻 publish plugin 涩涩保存器 (#2987) 2024-10-09 14:29:23 +00:00
noneflow[bot]
31a13551be 📝 Update changelog 2024-10-08 07:15:42 +00:00
swallow513
82dbacda83 🍻 publish plugin nonebot_plugin_BFVsearch (#3007) 2024-10-08 07:14:39 +00:00
noneflow[bot]
badd53b4bb 📝 Update changelog 2024-10-08 03:55:09 +00:00
yeying-xingchen
94052b5bf7 🍻 publish plugin lingyi_chat (#3005) 2024-10-08 03:54:07 +00:00
noneflow[bot]
72a6914980 📝 Update changelog 2024-10-08 02:25:52 +00:00
HibiKier
a2a604dd85 🍻 publish plugin ZXPM插件管理 (#3002) 2024-10-08 02:24:41 +00:00
noneflow[bot]
d3d0779d30 📝 Update changelog 2024-10-07 13:03:55 +00:00
Lonely-Sails
a45e7d3854 🍻 publish plugin MinecraftWatcher (#3009) 2024-10-07 13:02:44 +00:00
noneflow[bot]
4dadef3e51 📝 Update changelog 2024-10-06 12:29:31 +00:00
Lonely-Sails
ee643544f1 🍻 publish plugin BF5_grouptools (#3001) 2024-10-06 12:28:32 +00:00
noneflow[bot]
4598a3de9a 📝 Update changelog 2024-10-05 11:02:36 +00:00
Shadow403
59ad3d4b17 🍻 publish plugin lolinfo (#2996) 2024-10-05 11:01:23 +00:00
noneflow[bot]
ba78c3aef8 📝 Update changelog 2024-10-05 08:06:00 +00:00
Sevenyine
3ce2b69431 🍻 publish plugin osu! Match Monitor (#2982) 2024-10-05 08:04:56 +00:00
noneflow[bot]
d47722d87c 📝 Update changelog 2024-10-04 03:07:42 +00:00
Asankilp
c4ddfc3df1 🍻 publish plugin Marsho AI插件 (#2992) 2024-10-04 03:06:25 +00:00
hanasa2023
58c8879cbb 🍻 publish plugin nonechat (#2989) 2024-10-04 02:53:24 +00:00
noneflow[bot]
eb1342b78d 📝 Update changelog 2024-10-02 02:13:53 +00:00
STESmly
feb619a85c 🍻 publish plugin nonebot_plugin_SimpleToWrite (#2994) 2024-10-02 02:12:44 +00:00
noneflow[bot]
a9ec70e798 📝 Update changelog 2024-10-01 03:48:44 +00:00
qwq12738qwq
c96e9dbcb6 🍻 publish plugin Beat Saber查分器 (#2973) 2024-10-01 03:47:42 +00:00
noneflow[bot]
8742d867e8 📝 Update changelog 2024-09-30 02:29:48 +00:00
lyqgzbl
ed14dcd090 🍻 publish plugin githubmodels (#2944) 2024-09-30 02:28:43 +00:00
noneflow[bot]
7956b53530 📝 Update changelog 2024-09-29 13:17:13 +00:00
FrostN0v0
1140d668b6 🍻 publish plugin 给我点颜色瞧瞧 (#2983) 2024-09-29 13:16:03 +00:00
noneflow[bot]
9351b074b1 📝 Update changelog 2024-09-29 06:07:36 +00:00
yixinNB
61dc206935 📝 Docs: 修改文档示例代码与部分表述 (#2797)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Komorebi <110453675+KomoriDev@users.noreply.github.com>
Co-authored-by: Ju4tCode <42488585+yanyongyu@users.noreply.github.com>
2024-09-29 14:06:27 +08:00
noneflow[bot]
70f62bf4da 📝 Update changelog 2024-09-28 06:54:12 +00:00
Atr1ck
812c0cd624 🍻 publish plugin pjsk-helper (#2979) 2024-09-28 06:53:10 +00:00
noneflow[bot]
5107729290 📝 Update changelog 2024-09-26 08:44:18 +00:00
chsiyu
9b59c16b04 🍻 publish plugin 趣味内容插件 (#2978) 2024-09-26 08:43:13 +00:00
noneflow[bot]
fdc1dcace7 📝 Update changelog 2024-09-24 15:19:20 +00:00
Yurchiu
c6c22e3c29 🍻 publish plugin 计算器:游戏 (#2975) 2024-09-24 15:18:14 +00:00
noneflow[bot]
0291b10560 📝 Update changelog 2024-09-21 04:21:05 +00:00
yao-yun
6f07ce0060 🍻 publish plugin nonebot-plugin-yareminder (#2961) 2024-09-21 04:20:01 +00:00
noneflow[bot]
b375575792 📝 Update changelog 2024-09-20 12:29:42 +00:00
zhongwen-4
88765711f3 🍻 publish plugin 批量撤回 (#2965) 2024-09-20 12:28:40 +00:00
noneflow[bot]
17ba8d70e1 📝 Update changelog 2024-09-20 05:10:23 +00:00
RF-Tar-Railt
e373251092 🍻 publish plugin inspect (#2970) 2024-09-20 05:09:13 +00:00
noneflow[bot]
63dcc658da 📝 Update changelog 2024-09-20 04:31:23 +00:00
RF-Tar-Railt
3aaf86e9a9 🍻 publish plugin 通用信息 (#2968) 2024-09-20 04:30:17 +00:00
noneflow[bot]
2cabeb658e 📝 Update changelog 2024-09-19 04:07:57 +00:00
KiKi-XC
0c187cd8c3 🍻 publish plugin SSE日志输出流 (#2959) 2024-09-19 04:06:57 +00:00
noneflow[bot]
c0c8e1aa02 📝 Update changelog 2024-09-16 02:23:31 +00:00
TheChenXI
a8586d7990 🍻 publish plugin WITFF (#2940) 2024-09-16 02:22:28 +00:00
noneflow[bot]
91b3d3d5e0 📝 Update changelog 2024-09-15 11:40:22 +00:00
hanasa2023
8ef51154fd 🍻 publish plugin weather-rank (#2948) 2024-09-15 11:39:16 +00:00
noneflow[bot]
86c83064e4 📝 Update changelog 2024-09-14 04:23:30 +00:00
Funny1Potato
a4be2c465f 🍻 publish plugin 二维码生成器 (#2941) 2024-09-14 04:22:23 +00:00
noneflow[bot]
be4f36036c 📝 Update changelog 2024-09-09 14:42:24 +00:00
zouXH-god
f6c7fb6da6 🍻 publish plugin 次元星辰 (#2934) 2024-09-09 14:41:17 +00:00
noneflow[bot]
c9b4c3f3c0 📝 Update changelog 2024-09-08 09:42:53 +00:00
shoucandanghehe
4af4412cd7 🍻 publish plugin nonebot-plugin-tarina-lang-turbo (#2937) 2024-09-08 09:41:52 +00:00
noneflow[bot]
4e7f7fb722 📝 Update changelog 2024-09-04 15:38:25 +00:00
MeetWq
f01f692fde ✏️ Plugin: 删除不再维护的 simplemusic hikarisearch 插件 (#2933) 2024-09-04 23:37:21 +08:00
noneflow[bot]
6e94dade69 📝 Update changelog 2024-09-03 08:33:07 +00:00
wyf7685
eaef8dfc19 🍻 publish plugin 狼人杀 (#2931) 2024-09-03 08:32:00 +00:00
pre-commit-ci[bot]
dec8b26b89 ⬆️ auto update by pre-commit hooks (#2930)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-09-03 16:09:29 +08:00
noneflow[bot]
e8c39f9cc8 📝 Update changelog 2024-09-01 03:05:46 +00:00
SamuNatsu
2a8644de81 🍻 publish plugin 阿瓦隆 (#2914) 2024-09-01 03:04:44 +00:00
noneflow[bot]
5aaa0d3f12 📝 Update changelog 2024-08-29 04:00:46 +00:00
youlanan
22bb377fcf 🍻 publish plugin 消音器 (#2918) 2024-08-29 03:59:44 +00:00
noneflow[bot]
0c0ad0dd5e 📝 Update changelog 2024-08-27 15:20:56 +00:00
ChenXu233
c947bdfef5 🍻 publish plugin 悠悠 (#2927) 2024-08-27 15:19:49 +00:00
noneflow[bot]
b197802d9a 📝 Update changelog 2024-08-27 13:21:49 +00:00
kanbereina
8019a570cc 🍻 publish plugin LLOneBot-Master (#2924) 2024-08-27 13:20:45 +00:00
noneflow[bot]
25a85330a7 📝 Update changelog 2024-08-26 15:34:21 +00:00
鹿友-Reina
35fb4fc18d ✏️ Plugin: 删除插件 nonebot-plugin-ntqq-restart (#2926) 2024-08-26 23:33:13 +08:00
noneflow[bot]
ff50e997d0 📝 Update changelog 2024-08-26 15:26:03 +00:00
Funny1Potato
6cda981aa2 🍻 publish plugin nonebot-plugin-Send-API-picture (#2922) 2024-08-26 15:24:54 +00:00
noneflow[bot]
dcfbb32363 📝 Update changelog 2024-08-24 09:24:50 +00:00
KomoriDev
d8a1a0ab38 🍻 publish plugin maimai DX 查分 (#2920) 2024-08-24 09:23:52 +00:00
noneflow[bot]
6efd01a575 📝 Update changelog 2024-08-22 14:36:12 +00:00
molanp
b2f7846eb4 🍻 publish plugin Minecraft查服 (#2881) 2024-08-22 14:35:06 +00:00
noneflow[bot]
8d2a284fe2 📝 Update changelog 2024-08-22 13:29:57 +00:00
呵呵です
cce13f682d Feature: 添加 websockets 驱动器 proxy 连接警告 (#2916)
Co-authored-by: Ju4tCode <42488585+yanyongyu@users.noreply.github.com>
2024-08-22 21:28:51 +08:00
noneflow[bot]
6c1d7ad74b 📝 Update changelog 2024-08-21 15:25:11 +00:00
paro
4b837343ff 📝 Docs: 添加钩子函数 IgnoredException 用法 (#2912)
Co-authored-by: Ju4tCode <42488585+yanyongyu@users.noreply.github.com>
2024-08-21 23:23:56 +08:00
noneflow[bot]
d1904ba156 📝 Update changelog 2024-08-21 08:17:07 +00:00
Lonely-Sails
3ed1bde38a 🍻 publish plugin lagrange (#2897) 2024-08-21 08:16:16 +00:00
noneflow[bot]
5cd82df580 📝 Update changelog 2024-08-19 14:59:15 +00:00
Tarrailt
fdd0e82099 ✏️ Adapter: 移除社区版 mirai 适配器 (#2909) 2024-08-19 22:58:20 +08:00
noneflow[bot]
f540245aec 📝 Update changelog 2024-08-19 08:25:43 +00:00
KroMiose
7b3ca228ef 🍻 publish plugin nekro-agent (#2875) 2024-08-19 08:24:46 +00:00
noneflow[bot]
aa23adfd8a 📝 Update changelog 2024-08-18 14:42:21 +00:00
shengwang52005
95ee5d54e8 🍻 publish plugin nonebot_plugin_mute (#2892) 2024-08-18 14:41:35 +00:00
noneflow[bot]
eac0e7a656 📝 Update changelog 2024-08-18 07:08:21 +00:00
snowykami
e41ec29867 🍻 publish plugin LiteyukiBot(plugin) (#2904) 2024-08-18 07:07:26 +00:00
noneflow[bot]
42a922deb6 📝 Update changelog 2024-08-18 06:00:34 +00:00
tkgs0
8e70d55d77 🍻 publish plugin 复读6 (#2899) 2024-08-18 05:59:44 +00:00
noneflow[bot]
eeaf823ea9 🔖 Release 2.3.3 2024-08-18 03:57:17 +00:00
Ju4tCode
2195e07998 🔖 bump version 2.3.3 (#2903) 2024-08-18 11:53:33 +08:00
noneflow[bot]
70fb8fc8c6 📝 Update changelog 2024-08-18 03:03:33 +00:00
shoucandanghehe
b78ae1ef0d 🍻 publish plugin nonebot-plugin-wait-a-minute (#2901) 2024-08-18 03:02:40 +00:00
noneflow[bot]
6af5566466 📝 Update changelog 2024-08-18 02:58:50 +00:00
tkgs0
8ceca0a90d 🍻 publish plugin 你看我像 (#2894) 2024-08-18 02:57:59 +00:00
noneflow[bot]
08fa6dbfc8 📝 Update changelog 2024-08-18 02:56:16 +00:00
gsskk
967aa758d3 🍻 publish plugin dify插件 (#2888) 2024-08-18 02:55:19 +00:00
noneflow[bot]
e3b10fbdc2 📝 Update changelog 2024-08-17 15:15:03 +00:00
shengwang52005
2115e5c6ec 🍻 publish plugin mai2_pcount (#2890) 2024-08-17 15:14:05 +00:00
noneflow[bot]
41dc908032 📝 Update changelog 2024-08-17 02:49:42 +00:00
N791
2b2f24628d 🍻 publish plugin nonebot-plugin-ehentai-search (#2884) 2024-08-17 02:48:53 +00:00
noneflow[bot]
1cc5d1af33 📝 Update changelog 2024-08-16 13:27:05 +00:00
shengwang52005
88074cf5c3 🍻 publish plugin pokepoke_miss (#2878) 2024-08-16 13:25:54 +00:00
noneflow[bot]
5d637eed95 📝 Update changelog 2024-08-15 03:35:09 +00:00
lm175
362c43ce5f 🍻 publish plugin 聊天截图伪造 (#2879) 2024-08-15 03:34:08 +00:00
noneflow[bot]
622b8eb51e 📝 Update changelog 2024-08-13 11:23:45 +00:00
hanasa2023
c369dcf781 🍻 publish plugin ba-tools (#2863) 2024-08-13 11:22:46 +00:00
noneflow[bot]
53d1e1dee9 📝 Update changelog 2024-08-13 07:39:10 +00:00
Leo Q
75f5825cff 📝 Docs: 添加 Windows Powershell 设置环境变量方法 (#2874)
Co-authored-by: Ju4tCode <42488585+yanyongyu@users.noreply.github.com>
2024-08-13 15:38:17 +08:00
noneflow[bot]
d05c90787c 📝 Update changelog 2024-08-12 15:23:00 +00:00
BEISNWKZNAN
e07ba36a4a 🍻 publish plugin 精华消息管理 (#2872) 2024-08-12 15:22:10 +00:00
noneflow[bot]
f7c05d9a08 📝 Update changelog 2024-08-11 15:24:59 +00:00
kawaiior
59c5a1a35d 🍻 publish plugin B站收藏夹监视器 (#2868) 2024-08-11 15:24:07 +00:00
noneflow[bot]
3eb653821e 📝 Update changelog 2024-08-11 12:47:36 +00:00
Ju4tCode
214bc838c2 📝 Docs: 更新 localstore 插件文档 (#2871) 2024-08-11 20:46:41 +08:00
noneflow[bot]
79c7ea5bab 📝 Update changelog 2024-08-11 07:17:00 +00:00
Ju4tCode
b59b1be6ff Feature: 优化依赖注入在 pydantic v2 下的性能 (#2870) 2024-08-11 15:15:59 +08:00
noneflow[bot]
aeb75a6ce3 📝 Update changelog 2024-08-11 07:05:13 +00:00
iam57ao
847325a119 🍻 publish plugin Alist (#2864) 2024-08-11 07:04:22 +00:00
noneflow[bot]
26eabfaf6f 📝 Update changelog 2024-08-09 12:18:53 +00:00
月ヶ瀬
40a7b97220 ✏️ Plugin: 修改插件 system-command 信息 (#2862)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-08-09 20:18:01 +08:00
noneflow[bot]
91b40748c4 📝 Update changelog 2024-08-09 12:14:40 +00:00
SamuNatsu
013a2f94d6 🍻 publish plugin nonebot-plugin-deer-pipe (#2858) 2024-08-09 12:13:51 +00:00
noneflow[bot]
74d280ed75 📝 Update changelog 2024-08-08 09:04:11 +00:00
luosheng520qaq
b7d46de10e 🍻 publish plugin 漂流瓶 (#2860) 2024-08-08 09:03:15 +00:00
noneflow[bot]
c37b5bbbca 📝 Update changelog 2024-08-07 13:11:34 +00:00
zhongwen-4
5e08e73698 🍻 publish plugin 奇怪的小功能 (#2850) 2024-08-07 13:10:40 +00:00
pre-commit-ci[bot]
b27bb92d03 ⬆️ auto update by pre-commit hooks (#2857)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-08-06 14:43:44 +08:00
noneflow[bot]
6bf8858cc6 📝 Update changelog 2024-08-06 06:20:30 +00:00
Ju4tCode
c97a780645 Feature: 添加遗漏的类型标注 (#2856) 2024-08-06 14:19:17 +08:00
noneflow[bot]
976c1cd8e0 📝 Update changelog 2024-08-03 13:21:57 +00:00
ALittleBot
26fd6f8a6c ✏️ Plugin: 修改 nonebot-plugin-fishing 插件作者 (#2854) 2024-08-03 21:20:57 +08:00
noneflow[bot]
0020ad28ba 📝 Update changelog 2024-08-03 09:53:27 +00:00
CCYellowStar2
ba9ca63f10 🍻 publish plugin SunoAI音乐生成 (#2852) 2024-08-03 09:52:24 +00:00
noneflow[bot]
28b5b732c2 📝 Update changelog 2024-07-29 12:38:05 +00:00
KomoriDev
b944da8445 🍻 publish plugin 谁是卷王 (#2848) 2024-07-29 12:37:02 +00:00
noneflow[bot]
5cab166d6b 📝 Update changelog 2024-07-28 15:04:05 +00:00
zhaomaoniu
546cdb4229 🍻 publish plugin GPT-SoVITS 语音合成 (#2846) 2024-07-28 15:02:59 +00:00
noneflow[bot]
77790fad1f 📝 Update changelog 2024-07-28 12:41:01 +00:00
Alpaca4610
bcf849c98f 🍻 publish plugin 基于清影的AI视频生成 (#2842) 2024-07-28 12:40:00 +00:00
noneflow[bot]
f7b3c8af02 📝 Update changelog 2024-07-26 03:42:50 +00:00
tkgs0
cced60589c 🍻 publish plugin 命令行 (#2839) 2024-07-26 03:41:42 +00:00
noneflow[bot]
62adb32c94 📝 Update changelog 2024-07-22 07:10:44 +00:00
Lonely-Sails
6ab752dcdb ✏️ Bot: 更新 Minecraft QQBot 信息 (#2838) 2024-07-22 15:09:31 +08:00
noneflow[bot]
4d6f071739 📝 Update changelog 2024-07-21 14:58:12 +00:00
wyf7685
bd140c2ceb 🍻 publish plugin exe_code (#2834) 2024-07-21 14:57:09 +00:00
noneflow[bot]
59d9991aa4 📝 Update changelog 2024-07-21 12:56:40 +00:00
Lonely-Sails
55e7f59e40 🍻 publish bot Minecraft_QQBot (#2836) 2024-07-21 12:55:37 +00:00
noneflow[bot]
bb83483020 📝 Update changelog 2024-07-21 12:36:25 +00:00
This-is-XiaoDeng
5300ef5119 🍻 publish plugin nonebot-plugin-autopush (#2832) 2024-07-21 12:35:17 +00:00
noneflow[bot]
5a50d4203c 📝 Update changelog 2024-07-21 10:07:54 +00:00
SwedishDoveCooker
01a96f3086 🍻 publish plugin vv_helper (#2820) 2024-07-21 10:06:53 +00:00
noneflow[bot]
0570d779ee 📝 Update changelog 2024-07-21 04:51:31 +00:00
Cvandia
18d0bc2c81 🍻 publish plugin nonebot_plugin_game_torrent (#2826) 2024-07-21 04:50:31 +00:00
Ju4tCode
87e0d8148f 👷 Fix: preview alias and commit status (#2831) 2024-07-21 12:40:50 +08:00
Ju4tCode
53d8989145 🐛 Fix: website preview CD (#2830) 2024-07-21 12:14:18 +08:00
noneflow[bot]
5433b4ebdf 📝 Update changelog 2024-07-21 03:29:14 +00:00
wyeeeee
f10cecf16a 🍻 publish plugin 每日油价 (#2821) 2024-07-21 03:28:10 +00:00
Ju4tCode
60a3f6f4cc 👷 Security: 拆分 PR Website CI/CD (#2829) 2024-07-21 11:23:15 +08:00
noneflow[bot]
f70ae89098 📝 Update changelog 2024-07-20 06:04:34 +00:00
Ju4tCode
2f60c5e9b4 🚨 Fix: 错误的类型标注和 annotated 处理 (#2828) 2024-07-20 14:03:32 +08:00
noneflow[bot]
015ddd9517 📝 Update changelog 2024-07-18 15:18:51 +00:00
StarXinXin
f1539d9ec4 🍻 publish bot 星辰 Bot (#2823) 2024-07-18 15:17:48 +00:00
noneflow[bot]
2d0444ba75 📝 Update changelog 2024-07-18 13:35:13 +00:00
shiyihang2007
ed2c222e83 🍻 publish plugin wordle (#2817) 2024-07-18 13:34:08 +00:00
noneflow[bot]
ed048913a4 📝 Update changelog 2024-07-17 15:07:06 +00:00
SuperGuGuGu
121ba17698 ✏️ Plugin: 移除 kanonbot 插件 (#2819) 2024-07-17 23:05:55 +08:00
noneflow[bot]
d0f5a76c47 📝 Update changelog 2024-07-15 14:21:24 +00:00
NCBM
f809f1d089 🍻 publish plugin 再润 (#2815) 2024-07-15 14:20:12 +00:00
noneflow[bot]
070ad18781 📝 Update changelog 2024-07-13 13:10:45 +00:00
Shenyi Chen
56119ef1cc ✏️ Plugin: 更新插件 sparkapi 信息 (#2812) 2024-07-13 21:09:41 +08:00
noneflow[bot]
30195a35dc 📝 Update changelog 2024-07-13 12:07:10 +00:00
Asankilp
0500b7baab 🍻 publish plugin 漫展/展览查询 (#2810) 2024-07-13 12:06:04 +00:00
noneflow[bot]
08473a5c25 📝 Update changelog 2024-07-11 09:47:40 +00:00
Lumine
37ad14c277 ✏️ Plugin: 修改插件 miragetank & charpic 信息 (#2807) 2024-07-11 17:46:41 +08:00
noneflow[bot]
3e8c6ce541 📝 Update changelog 2024-07-11 09:41:38 +00:00
shi-yingyingjiang
3dd5539dc7 🍻 publish plugin 鸣潮wiki (#2801) 2024-07-11 09:40:36 +00:00
noneflow[bot]
559a0320a8 📝 Update changelog 2024-07-11 09:34:58 +00:00
1v7w
8646d885f0 🍻 publish plugin cloudfare R2 客服端 (#2805) 2024-07-11 09:33:53 +00:00
noneflow[bot]
84c008cdce 📝 Update changelog 2024-07-10 13:41:24 +00:00
QuickLAW
2671cb5b72 🍻 publish plugin AnyMate小助手 (#2760) 2024-07-10 13:40:12 +00:00
noneflow[bot]
379440708f 📝 Update changelog 2024-07-06 12:54:50 +00:00
noneflow[bot]
4d070f5b48 🔖 Release 2.3.2 2024-07-06 12:34:00 +00:00
Ju4tCode
82138454bc 🔖 bump version 2.3.2 (#2799) 2024-07-06 20:24:00 +08:00
noneflow[bot]
d98fe53d56 📝 Update changelog 2024-07-05 12:49:09 +00:00
Komorebi
278b9e92c2 📝 Docs: 修改导航栏开源之夏链接 (#2798) 2024-07-05 20:48:06 +08:00
noneflow[bot]
45418ccfae 📝 Update changelog 2024-07-04 15:06:15 +00:00
fallllllllsleep
2ad2922565 📝 Docs: on_keyword 参数类型错误 (#2795)
Co-authored-by: Ju4tCode <42488585+yanyongyu@users.noreply.github.com>
2024-07-04 23:04:58 +08:00
pre-commit-ci[bot]
84ebcb4ce6 ⬆️ auto update by pre-commit hooks (#2794)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-07-02 21:50:54 +08:00
noneflow[bot]
6a0caacfd6 📝 Update changelog 2024-07-02 13:30:22 +00:00
tianyisama
a8f3940cbc 🍻 publish plugin 指令更新NapCat (#2790) 2024-07-02 13:29:12 +00:00
noneflow[bot]
15d3910462 📝 Update changelog 2024-07-01 13:18:15 +00:00
Autuamn
edfd0eb887 🍻 publish plugin QQ群-Discord 互通 (#2787) 2024-07-01 13:17:10 +00:00
noneflow[bot]
fe63717848 📝 Update changelog 2024-06-28 12:30:26 +00:00
Dongyanmio
63424bc3ac 🍻 publish plugin nonebot_plugin_obastatus (#2779) 2024-06-28 12:29:23 +00:00
noneflow[bot]
99b1d0ed96 📝 Update changelog 2024-06-25 15:18:44 +00:00
BraveCowardp
90c7fd4747 🍻 publish plugin b站消息转发 (#2784) 2024-06-25 15:17:40 +00:00
noneflow[bot]
c1a9758a18 📝 Update changelog 2024-06-25 15:06:02 +00:00
WMGray
17e7a0c029 🍻 publish plugin Daily Task (#2768) 2024-06-25 15:04:50 +00:00
noneflow[bot]
df6a948c08 📝 Update changelog 2024-06-25 14:05:42 +00:00
zifox666
9f19eb7a96 🍻 publish plugin EVE ONLINE 多功能机器人 (#2781) 2024-06-25 14:04:38 +00:00
noneflow[bot]
2b68428526 📝 Update changelog 2024-06-25 13:45:54 +00:00
kanbereina
d62c6561c2 🍻 publish plugin NTQQ自动登录/断连重启 (#2783) 2024-06-25 13:44:51 +00:00
noneflow[bot]
fc3bb5ff1f 📝 Update changelog 2024-06-25 13:13:53 +00:00
CCYellowStar2
76b1bbb443 🍻 publish plugin asmr (#2774) 2024-06-25 13:12:48 +00:00
noneflow[bot]
7b724925ba 📝 Update changelog 2024-06-20 12:50:21 +00:00
uy/sun
62dc2574c7 🐛 Fix: 修复 ForwardRef eval 时参数 recursive_guard 缺失 (#2778) 2024-06-20 20:49:17 +08:00
noneflow[bot]
ea40ae3a18 📝 Update changelog 2024-06-19 18:08:39 +00:00
ElainaFanBoy
f94e7d9b5b 🍻 publish plugin 日麻猜手牌小游戏 (#2776) 2024-06-19 18:07:12 +00:00
noneflow[bot]
c8ba973280 📝 Update changelog 2024-06-19 10:08:21 +00:00
SherkeyXD
35e062c588 🍻 publish plugin 绝地潜兵信息查询小助手 (#2771) 2024-06-19 10:07:19 +00:00
noneflow[bot]
53724487d3 📝 Update changelog 2024-06-19 08:56:41 +00:00
LiLuo-B
a3003b0ff6 🍻 publish plugin MCSM小助手 (#2770) 2024-06-19 08:55:32 +00:00
noneflow[bot]
96ecd415cd 📝 Update changelog 2024-06-18 21:42:46 +00:00
syagina
e8ef4735ea 🍻 publish plugin 多模态AI工具 (#2754) 2024-06-18 21:41:43 +00:00
noneflow[bot]
b78b08ed81 📝 Update changelog 2024-06-14 14:23:26 +00:00
phquathi
e11ea52276 🍻 publish plugin nonebot-plugin-easymarkdown (#2766) 2024-06-14 14:22:20 +00:00
noneflow[bot]
819e7334b2 📝 Update changelog 2024-06-14 14:08:12 +00:00
AzideCupric
1ebafaa9a5 🍻 publish plugin 峯驰外包 (#2764) 2024-06-14 14:07:04 +00:00
noneflow[bot]
3554292d5f 📝 Update changelog 2024-06-12 11:08:37 +00:00
BraveCowardp
ec9ef9a760 🍻 publish plugin 鸣潮抽卡记录分析 (#2762) 2024-06-12 11:07:23 +00:00
noneflow[bot]
74663c7c5e 📝 Update changelog 2024-06-11 13:48:36 +00:00
ajdgg
cbc99be031 🍻 publish plugin nonebot-plugin-xjie-weather (#2755) 2024-06-11 13:47:34 +00:00
noneflow[bot]
81e9bdd7ec 📝 Update changelog 2024-06-08 04:39:27 +00:00
KomoriDev
323038ecc6 🍻 publish plugin 颜值评分 (#2751) 2024-06-08 04:38:23 +00:00
noneflow[bot]
7091beb809 📝 Update changelog 2024-06-07 09:42:23 +00:00
ikarosf
010c48d30f 🍻 publish plugin 学园偶像大师算分插件 (#2749) 2024-06-07 09:41:19 +00:00
noneflow[bot]
a5b2dd38d5 📝 Update changelog 2024-06-05 13:38:04 +00:00
050644zf
fa5f295fe7 🍻 publish plugin nonebot-plugin-lynchpined (#2747) 2024-06-05 13:36:59 +00:00
pre-commit-ci[bot]
7f7b23bd2f ⬆️ auto update by pre-commit hooks (#2746)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-06-04 10:40:10 +08:00
noneflow[bot]
0434e12b8a 📝 Update changelog 2024-06-03 04:39:22 +00:00
yejue
425d140161 🍻 publish plugin QQShell (#2744) 2024-06-03 04:38:08 +00:00
noneflow[bot]
64d8f7843a 📝 Update changelog 2024-06-02 14:31:34 +00:00
CCYellowStar2
a0a6427540 🍻 publish plugin ai唱歌 (#2742) 2024-06-02 14:30:24 +00:00
noneflow[bot]
31fe8e6582 📝 Update changelog 2024-05-30 06:14:11 +00:00
mobyw
38e42919b7 📝 Docs: 修复单元测试示例代码 (#2741) 2024-05-30 14:13:11 +08:00
noneflow[bot]
c769f95688 📝 Update changelog 2024-05-29 12:53:55 +00:00
yejue
d642897a5b 🍻 publish plugin 复读姬+1 PlusOne (#2731) 2024-05-29 12:52:45 +00:00
noneflow[bot]
d7931f8ec2 📝 Update changelog 2024-05-27 13:22:56 +00:00
Sclock
8a0b989718 🍻 publish plugin 高优先级关闭信号钩子插件 (#2736) 2024-05-27 13:21:55 +00:00
noneflow[bot]
4fbbb646c3 📝 Update changelog 2024-05-25 14:17:07 +00:00
cubstaryow
75856e63f6 🍻 publish plugin 插件响应鉴权 (#2726) 2024-05-25 14:16:03 +00:00
noneflow[bot]
98213f50db 📝 Update changelog 2024-05-25 04:21:01 +00:00
Weltolk
5bce1db24e 📝 Docs: 修改依赖注入定义链接 (#2733) 2024-05-25 12:19:48 +08:00
noneflow[bot]
380ace5780 📝 Update changelog 2024-05-21 20:14:18 +00:00
Ljzd-PRO
6e5b01a3d4 🍻 publish plugin DG-Lab-Play (#2728) 2024-05-21 20:13:16 +00:00
noneflow[bot]
622e8e8af3 🔖 Release 2.3.1 2024-05-20 14:19:50 +00:00
Ju4tCode
2bbb83d3f2 🔖 bump version 2.3.1 (#2725) 2024-05-20 22:09:51 +08:00
noneflow[bot]
54756134d4 📝 Update changelog 2024-05-20 13:31:40 +00:00
Alpaca4610
932b212e04 🍻 publish plugin 自定义人格和AI绘图的混合聊天BOT (#2723) 2024-05-20 13:30:32 +00:00
noneflow[bot]
3b40e5b20c 📝 Update changelog 2024-05-18 15:32:15 +00:00
ajdgg
f594db207d 🍻 publish plugin nonebot-plugin-calc24 (#2720) 2024-05-18 15:31:14 +00:00
noneflow[bot]
70e23427e8 📝 Update changelog 2024-05-18 14:47:10 +00:00
WindowsSov8forUs
c1a303fd3d 🍻 publish plugin nonebot-plugin-tsugu-bangdream-bot (#2718) 2024-05-18 14:46:02 +00:00
noneflow[bot]
a62b9a5e1a 📝 Update changelog 2024-05-18 03:44:44 +00:00
Komorebi
36eece311a 📝 Docs: 修正 匹配扩展 中的示例 (#2722) 2024-05-18 11:43:39 +08:00
noneflow[bot]
29ea5f5787 📝 Update changelog 2024-05-17 05:58:08 +00:00
CCLMSY
c00e3aacfc 🍻 publish plugin 科大讯飞星火大语言模型官方API聊天机器人插件 (#2716) 2024-05-17 05:57:07 +00:00
noneflow[bot]
cf9f78528c 📝 Update changelog 2024-05-15 02:03:18 +00:00
Tarrailt
68d4795de6 📝 Docs: 更新 Mirai 适配器说明 (#2715)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-05-15 10:02:12 +08:00
noneflow[bot]
e689d7f7d2 📝 Update changelog 2024-05-14 17:06:21 +00:00
RF-Tar-Railt
a607f868c2 🍻 publish adapter Mirai (#2713) 2024-05-14 17:05:19 +00:00
noneflow[bot]
84ac1c4bad 📝 Update changelog 2024-05-14 15:27:34 +00:00
worldmozara
e11ff528e2 🗑️ 移除已在 PyPI 上删除的 covid 插件和 molar-mass 插件 (#2712) 2024-05-14 23:26:26 +08:00
noneflow[bot]
047f4d1878 📝 Update changelog 2024-05-14 04:28:53 +00:00
LiLuo-B
0294c33baf 🍻 publish plugin nonebot_plugin_valve_server_query (#2710) 2024-05-14 04:27:43 +00:00
noneflow[bot]
11a8b6e40b 📝 Update changelog 2024-05-13 14:06:07 +00:00
ConcyWee
cade86b62a 🍻 publish plugin 库洛游戏信息 (#2702) 2024-05-13 14:04:58 +00:00
noneflow[bot]
df836ec1c6 📝 Update changelog 2024-05-12 09:46:03 +00:00
zhaomaoniu
12cc00a3d3 🍻 publish plugin BanG Dream! Tsugu Frontend (#2707) 2024-05-12 09:45:00 +00:00
noneflow[bot]
24aa81f0be 📝 Update changelog 2024-05-12 09:33:27 +00:00
Yan-Zero
339706a3a6 🍻 publish plugin 神秘学助手 (#2699) 2024-05-12 09:32:25 +00:00
noneflow[bot]
b43c9adb7a 📝 Update changelog 2024-05-12 02:42:57 +00:00
Ekac00
c2783039d4 🍻 publish plugin nonebot-plugin-furryfusion (#2704) 2024-05-12 02:41:50 +00:00
noneflow[bot]
c4706e4123 📝 Update changelog 2024-05-12 02:30:10 +00:00
Ekac00
8a997540b3 🍻 publish plugin nonebot-plugin-RanFurryPic (#2701) 2024-05-12 02:28:59 +00:00
noneflow[bot]
045022b22a 📝 Update changelog 2024-05-09 07:10:05 +00:00
Ju4tCode
723fa4b3d8 🐛 Fix: State ForwardRef 检测错误 (#2698) 2024-05-09 15:08:49 +08:00
noneflow[bot]
41b59cff06 📝 Update changelog 2024-05-09 02:38:47 +00:00
yejue
bed1b46527 🍻 publish plugin with_ai_agents (#2696) 2024-05-09 02:37:44 +00:00
pre-commit-ci[bot]
ad695ca6e8 ⬆️ auto update by pre-commit hooks (#2695)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-05-07 13:35:53 +08:00
noneflow[bot]
33e997708c 📝 Update changelog 2024-05-05 05:48:08 +00:00
zhaomaoniu
56b6ee1d38 🍻 publish plugin nonebot_plugin_anime_downloader (#2690) 2024-05-05 05:47:03 +00:00
noneflow[bot]
27b2cf52a5 📝 Update changelog 2024-05-05 04:56:01 +00:00
eya46
b532130f6e 📝 Docs: 添加 Tailchat 适配器说明 (#2694)
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>
2024-05-05 12:54:51 +08:00
noneflow[bot]
d16b8594ad 📝 Update changelog 2024-05-05 04:42:08 +00:00
eya46
ad8442c6de 🍻 publish adapter Tailchat (#2692) 2024-05-05 04:40:57 +00:00
noneflow[bot]
4edf7e2c2c 📝 Update changelog 2024-05-01 14:29:42 +00:00
StarHeart
ea49318809 📝 Docs: 添加 uwu logo (#2689) 2024-05-01 22:28:36 +08:00
noneflow[bot]
a9a86aba61 🔖 Release 2.3.0 2024-05-01 09:01:32 +00:00
Ju4tCode
6e95d5366c 🔖 bump version 2.3.0 (#2688) 2024-05-01 16:55:17 +08:00
noneflow[bot]
445711e1cb 📝 Update changelog 2024-05-01 08:17:06 +00:00
Bryan不可思议
dfd2096fe5 📝 Docs: 数据库最佳实践 (#2545)
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>
2024-05-01 16:16:02 +08:00
noneflow[bot]
d469c6f287 📝 Update changelog 2024-05-01 05:39:50 +00:00
Ju4tCode
9655b941f3 🐛 Fix: none 系列驱动器启动失败时未退出应用 (#2687) 2024-05-01 13:38:47 +08:00
noneflow[bot]
4254fdfd8c 📝 Update changelog 2024-05-01 03:35:49 +00:00
Tarrailt
1b3cd7e2e2 📝 Docs: 更新最佳实践的 Alconna 部分 (#2686) 2024-05-01 11:34:33 +08:00
noneflow[bot]
897498b7f5 📝 Update changelog 2024-04-29 12:27:53 +00:00
Ju4tCode
34770e4463 🧑‍💻 CI: 修复 NoneFlow reaction 范围 (#2685) 2024-04-29 20:26:35 +08:00
noneflow[bot]
9d14f72249 📝 Update changelog 2024-04-27 09:58:35 +00:00
colasama
87f6e81ffc 🍻 publish plugin 表情包保存器 (#2683) 2024-04-27 09:57:30 +00:00
noneflow[bot]
c3373e141a 📝 Update changelog 2024-04-26 03:12:24 +00:00
StarHeart
a5f2d97b04 👷 CI: 修复测试 (#2682) 2024-04-26 11:11:13 +08:00
noneflow[bot]
80ac6a5ae9 📝 Update changelog 2024-04-25 03:13:26 +00:00
cubstaryow
496475e0ca 🍻 publish plugin HelpWithPic (#2680) 2024-04-25 03:12:15 +00:00
noneflow[bot]
982dbbccdf 📝 Update changelog 2024-04-24 06:57:06 +00:00
cubstaryow
3f9c20c60b 🍻 publish plugin cyberfurry (#2678) 2024-04-24 06:55:56 +00:00
noneflow[bot]
cabb3c6c45 📝 Update changelog 2024-04-23 04:37:41 +00:00
afterow
03bf1fdcfe 🍻 publish plugin 三爻易数 (#2674) 2024-04-23 04:36:36 +00:00
noneflow[bot]
f36f8d1bcc 📝 Update changelog 2024-04-22 07:59:57 +00:00
Ju4tCode
5c2c1770a2 👷 CI: NoneFlow 添加 reaction 响应提示 (#2677) 2024-04-22 15:58:48 +08:00
noneflow[bot]
6810af1e1d 📝 Update changelog 2024-04-22 07:27:58 +00:00
Ju4tCode
78ba6ce973 📝 Docs: 添加 OSPP 2024 项目说明 (#2676) 2024-04-22 15:26:48 +08:00
noneflow[bot]
15bcb7e374 📝 Update changelog 2024-04-22 06:35:01 +00:00
shi-yingyingjiang
7dd7ccbff5 🍻 publish plugin 战双表情 (#2668) 2024-04-22 06:33:57 +00:00
noneflow[bot]
5b17c8de71 📝 Update changelog 2024-04-21 02:39:49 +00:00
Autuamn
5cf4ff66a3 🍻 publish plugin QQ频道-Discord 互通 (#2666) 2024-04-21 02:38:40 +00:00
noneflow[bot]
b6be8a178e 📝 Update changelog 2024-04-20 15:41:30 +00:00
YuxiCN
b77c3b2d0c 🍻 publish plugin Yinying-Chat (#2653) 2024-04-20 15:40:30 +00:00
noneflow[bot]
e4a210b47c 📝 Update changelog 2024-04-20 06:48:21 +00:00
Ju4tCode
6bf10aafb7 Feature: 嵌套插件名称作用域优化 (#2665) 2024-04-20 14:47:12 +08:00
noneflow[bot]
e15d544341 📝 Update changelog 2024-04-19 03:49:38 +00:00
惜月
acdb5787db 📝 Docs: 更新 Villa 适配器说明 (#2661) 2024-04-19 11:48:34 +08:00
noneflow[bot]
18f0c9b500 📝 Update changelog 2024-04-19 02:56:24 +00:00
shi-yingyingjiang
b36e721274 🍻 publish plugin 淫语 (#2649) 2024-04-19 02:55:16 +00:00
noneflow[bot]
9fdc50cd0e 📝 Update changelog 2024-04-19 02:52:46 +00:00
Tarrailt
41abf077bc 📝 Docs: 添加 Kritor 适配器说明 (#2660)
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>
2024-04-19 10:51:37 +08:00
noneflow[bot]
27a4e5a55b 📝 Update changelog 2024-04-19 02:43:27 +00:00
Ju4tCode
65f6a104e9 Update assets/adapters.json 2024-04-19 02:42:17 +00:00
RF-Tar-Railt
415bd07c0d 🍻 publish adapter Kritor (#2658) 2024-04-19 02:42:17 +00:00
noneflow[bot]
3fd26dd937 📝 Update changelog 2024-04-18 10:51:15 +00:00
Azide
f5f5d93b64 🐛 Bug: inherit_supported_adapters 在展开缩写前取交集 (#2654)
Co-authored-by: Ju4tCode <42488585+yanyongyu@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-04-18 18:50:11 +08:00
noneflow[bot]
b497bb8c83 📝 Update changelog 2024-04-18 10:30:35 +00:00
Tarrailt
b0d554eacb 📝 Docs: 更新最佳实践的 Alconna 部分 (#2656)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-04-18 18:28:31 +08:00
noneflow[bot]
cbecc7b930 📝 Update changelog 2024-04-18 06:11:20 +00:00
baiqwerdvd
5e0921aca9 🍻 publish plugin 飞花令 (#2647) 2024-04-18 06:10:11 +00:00
noneflow[bot]
7e8015e828 📝 Update changelog 2024-04-17 11:14:50 +00:00
huanxin996
bef5bdf0bf 🍻 publish plugin Hx_YinYing (#2645) 2024-04-17 11:13:39 +00:00
noneflow[bot]
c04cd5e83e 📝 Update changelog 2024-04-17 09:25:33 +00:00
Ju4tCode
30d3c1bbce Feature: 优化调用栈识别 (#2644) 2024-04-17 17:24:38 +08:00
noneflow[bot]
5e72461391 📝 Update changelog 2024-04-16 12:52:07 +00:00
KarisAya
54fdf71d91 🍻 publish plugin clovers插件框架 (#2642) 2024-04-16 12:51:10 +00:00
noneflow[bot]
420d0cfdc4 📝 Update changelog 2024-04-16 06:45:23 +00:00
zhulinyv
84bfba7a82 🍻 publish plugin nonebot-plugin-nai3 (#2638) 2024-04-16 06:44:27 +00:00
noneflow[bot]
9fd89a6822 📝 Update changelog 2024-04-15 16:34:44 +00:00
Ju4tCode
4a02dde83f 💥 Remove: 移除 Python 3.8 支持 (#2641) 2024-04-16 00:33:48 +08:00
noneflow[bot]
e93ee1ffec 📝 Update changelog 2024-04-14 14:27:20 +00:00
Ju4tCode
e2b6fb12c7 📝 Docs: 添加 RocketChat 适配器说明 (#2640)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-04-14 22:26:23 +08:00
noneflow[bot]
7836073c7e 📝 Update changelog 2024-04-11 05:33:11 +00:00
IllTamer
3119626d89 🍻 publish adapter RocketChat (#2636) 2024-04-11 05:32:21 +00:00
noneflow[bot]
19bebdd923 📝 Update changelog 2024-04-09 03:28:08 +00:00
Well2333
0b0dd8b552 🍻 publish plugin nonebot-plugin-auto-bot-selector (#2634) 2024-04-09 03:27:14 +00:00
noneflow[bot]
47ce7a633f 📝 Update changelog 2024-04-08 12:23:18 +00:00
StarHeart
ca32f68787 📝 Docs: 商店卡片样式调整 (#2633) 2024-04-08 20:22:29 +08:00
noneflow[bot]
0b972ad302 📝 Update changelog 2024-04-08 12:17:53 +00:00
Ju4tCode
9b4b1526b1 🐛 Bug: 添加 HTTP 客户端会话上下文检查 (#2632) 2024-04-08 20:17:03 +08:00
noneflow[bot]
7a232c7a4a 📝 Update changelog 2024-04-06 12:08:18 +00:00
Azide
983351f0b7 📝 Docs: 为商店插件卡片添加更多展示内容 (#2626) 2024-04-06 20:07:09 +08:00
noneflow[bot]
16fb5ac121 📝 Update changelog 2024-04-05 13:44:11 +00:00
mrqx0195
bb1fbca4a7 🍻 publish plugin Chikari_economy (#2630) 2024-04-05 13:43:17 +00:00
noneflow[bot]
b7c0b6b8e0 📝 Update changelog 2024-04-05 13:11:57 +00:00
Ju4tCode
485aa62755 Feature: 支持 HTTP 客户端会话 (#2627) 2024-04-05 21:11:05 +08:00
noneflow[bot]
53e2a86dd9 📝 Update changelog 2024-04-05 03:36:21 +00:00
zhzhongshi
312095d1df 🍻 publish plugin diffsinger (#2624) 2024-04-05 03:35:33 +00:00
noneflow[bot]
b498be1092 📝 Update changelog 2024-04-04 08:13:35 +00:00
Akirami
211ea8427f 📝 Docs: 修复 RegexMatched 文档类型标注错误 (#2629) 2024-04-04 16:12:39 +08:00
noneflow[bot]
407eb69568 📝 Update changelog 2024-04-04 07:30:23 +00:00
Akirami
8a44b4d6ee 📝 Docs: 修复 RegexMatched​ 文档高亮行错误 (#2628) 2024-04-04 15:29:33 +08:00
noneflow[bot]
bc58fbb741 📝 Update changelog 2024-04-02 14:55:01 +00:00
Azide
0c977f5fd7 📝 Docs: 为商店的详情卡片添加跳转链接 (#2623) 2024-04-02 22:54:10 +08:00
noneflow[bot]
7eeccbcb14 📝 Update changelog 2024-04-02 02:04:37 +00:00
Jigsaw
020d2a5687 🐛 Fix: 将 aiohttp 的 quote_fields 默认设为 False (#2619) 2024-04-02 10:03:46 +08:00
pre-commit-ci[bot]
83d61fcffd ⬆️ auto update by pre-commit hooks (#2620)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-04-02 09:55:19 +08:00
noneflow[bot]
c0b222a5fa 📝 Update changelog 2024-04-02 01:38:09 +00:00
Akirami
236e4ea9aa 📝 Docs: 添加 RegexMatched 依赖注入文档 (#2618)
Co-authored-by: Ju4tCode <42488585+yanyongyu@users.noreply.github.com>
2024-04-02 09:37:02 +08:00
noneflow[bot]
0622e16d18 📝 Update changelog 2024-04-02 01:21:36 +00:00
Lipraty
159ca84e46 🍻 publish plugin ghtiles (#2621) 2024-04-02 01:20:19 +00:00
noneflow[bot]
142a61ce5c 📝 Update changelog 2024-03-24 13:17:39 +00:00
QuanhuZeYu
7f226af541 🍻 publish plugin 人类友好数据配置 (#2615) 2024-03-24 13:16:37 +00:00
noneflow[bot]
8bf912499a 📝 Update changelog 2024-03-23 12:20:18 +00:00
Redmomn
a55b10cfa3 🍻 publish plugin nonebot-plugin-pallas-repeater (#2613) 2024-03-23 12:19:13 +00:00
noneflow[bot]
1a4f889b40 📝 Update changelog 2024-03-23 05:24:00 +00:00
Redmomn
f9bc2de4e4 🍻 publish plugin nonebot-plugin-duel (#2611) 2024-03-23 05:22:54 +00:00
noneflow[bot]
5a1c635083 📝 Update changelog 2024-03-23 05:14:56 +00:00
Agnes4m
76e8567f1e 🍻 publish plugin Sekai Stickers (#2609) 2024-03-23 05:13:57 +00:00
noneflow[bot]
9bd349d933 📝 Update changelog 2024-03-17 12:58:31 +00:00
GLDYM
5e8a67b605 🍻 publish plugin 100orangejuice (#2600) 2024-03-17 12:57:28 +00:00
noneflow[bot]
e16799d500 📝 Update changelog 2024-03-15 14:36:09 +00:00
zhaomaoniu
a189846194 🍻 publish plugin Steam Info (#2607) 2024-03-15 14:35:03 +00:00
noneflow[bot]
fcd536aada 📝 Update changelog 2024-03-13 03:32:46 +00:00
KroMiose
c89bafc2c9 🍻 publish plugin nonebot-plugin-dice-narrator (#2604) 2024-03-13 03:31:42 +00:00
dependabot[bot]
f5855a9f9a ⬆️ Bump the actions group with 1 update (#2605)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-11 13:56:57 +08:00
noneflow[bot]
a49b4bccc6 📝 Update changelog 2024-03-11 05:27:16 +00:00
NanakaNeko
b434da29b1 🍻 publish plugin a2s查询 (#2602) 2024-03-11 05:26:16 +00:00
noneflow[bot]
514b3a5afe 📝 Update changelog 2024-03-11 02:35:56 +00:00
student_2333
0d30f81ddb ✏️ Plugin: 移除不维护的插件 eitherchoice (#2599) 2024-03-11 10:34:44 +08:00
noneflow[bot]
9a86c00f62 📝 Update changelog 2024-03-09 05:54:47 +00:00
noneflow[bot]
7648138902 🍻 publish plugin 赛博钓鱼 (#2596)
Co-authored-by: C14H22O <C14H22O@users.noreply.github.com>
2024-03-09 13:53:45 +08:00
noneflow[bot]
2055f092f2 📝 Update changelog 2024-03-07 06:58:32 +00:00
uy/sun
9ff7f4baba 🧑‍💻 Develop: 添加 ruff RUF 规则 (#2598)
Co-authored-by: Ju4tCode <42488585+yanyongyu@users.noreply.github.com>
2024-03-07 14:57:26 +08:00
noneflow[bot]
92ba99c34c 📝 Update changelog 2024-03-05 05:42:03 +00:00
XTxiaoting14332
876cff4daf 🍻 publish plugin 人性化的ChatGLM (#2591) 2024-03-05 05:40:55 +00:00
noneflow[bot]
1ac6a612b0 📝 Update changelog 2024-03-04 09:12:55 +00:00
Redmomn
15ecad9f87 🍻 publish plugin nonebot-plugin-vits-tts (#2594) 2024-03-04 09:11:47 +00:00
noneflow[bot]
587d3f7c7e 📝 Update changelog 2024-03-02 09:49:10 +00:00
Ju4tCode
10e4ea6743 📝 Docs: 添加百度搜索资源验证 (#2590)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-03-02 17:48:04 +08:00
468 changed files with 31909 additions and 15418 deletions

View File

@@ -9,13 +9,11 @@
"vscode": {
"settings": {
"python.analysis.diagnosticMode": "workspace",
"python.analysis.typeCheckingMode": "basic",
"ruff.organizeImports": false,
"[python]": {
"editor.defaultFormatter": "ms-python.black-formatter",
"editor.defaultFormatter": "charliermarsh.ruff",
"editor.codeActionsOnSave": {
"source.fixAll.ruff": true,
"source.organizeImports": true
"source.fixAll.ruff": "explicit",
"source.organizeImports": "explicit"
}
},
"[javascript]": {
@@ -44,8 +42,6 @@
"extensions": [
"ms-python.python",
"ms-python.vscode-pylance",
"ms-python.isort",
"ms-python.black-formatter",
"charliermarsh.ruff",
"EditorConfig.EditorConfig",
"esbenp.prettier-vscode",

2
.github/FUNDING.yml vendored
View File

@@ -1,2 +1,2 @@
open_collective: nonebot
custom: ["https://afdian.net/@nonebot"]
custom: ["https://afdian.com/@nonebot"]

View File

@@ -1,7 +1,7 @@
name: 发布适配器
title: "Adapter: {name}"
description: 发布适配器到 NoneBot 官方商店
labels: ["Adapter"]
labels: ["Adapter", "Publish"]
body:
- type: input
id: name

View File

@@ -1,7 +1,7 @@
name: 发布机器人
title: "Bot: {name}"
description: 发布机器人到 NoneBot 官方商店
labels: ["Bot"]
labels: ["Bot", "Publish"]
body:
- type: input
id: name

View File

@@ -1,7 +1,7 @@
name: 发布插件
title: "Plugin: {name}"
description: 发布插件到 NoneBot 官方商店
labels: ["Plugin"]
labels: ["Plugin", "Publish"]
body:
- type: input
id: pypi

View File

@@ -25,7 +25,6 @@ runs:
- uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python-version }}
architecture: "x64"
cache: "poetry"
cache-dependency-path: |
./poetry.lock

View File

@@ -35,3 +35,12 @@ updates:
actions:
patterns:
- "*"
- package-ecosystem: devcontainers
directory: "/"
schedule:
interval: daily
groups:
devcontainers:
patterns:
- "*"

View File

@@ -23,11 +23,11 @@ jobs:
group: test-coverage-${{ github.ref }}-${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.env }}
cancel-in-progress: true
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
python-version: ["3.9", "3.10", "3.11", "3.12"]
os: [ubuntu-latest, windows-latest, macos-latest]
env: [pydantic-v1, pydantic-v2]
fail-fast: false
env:
OS: ${{ matrix.os }}
PYTHON_VERSION: ${{ matrix.python-version }}
@@ -48,11 +48,21 @@ jobs:
cd ./envs/${{ matrix.env }}
poetry run bash "../../scripts/run-tests.sh"
- name: Upload test results
uses: codecov/test-results-action@v1
with:
env_vars: OS,PYTHON_VERSION,PYDANTIC_VERSION
files: ./tests/junit.xml
flags: unittests
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Upload coverage report
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v5
with:
env_vars: OS,PYTHON_VERSION,PYDANTIC_VERSION
files: ./tests/coverage.xml
flags: unittests
fail_ci_if_error: true
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

View File

@@ -15,9 +15,10 @@ concurrency:
cancel-in-progress: false
jobs:
plugin_test:
noneflow:
runs-on: ubuntu-latest
name: nonebot2 plugin test
name: noneflow
# do not run on forked PRs, do not run on not related issues, do not run on pr comments
if: |
!(
(
@@ -35,30 +36,6 @@ jobs:
github.event_name == 'issue_comment' && github.event.issue.pull_request
)
)
permissions:
issues: read
outputs:
result: ${{ steps.plugin-test.outputs.RESULT }}
output: ${{ steps.plugin-test.outputs.OUTPUT }}
metadata: ${{ steps.plugin-test.outputs.METADATA }}
steps:
- name: Install Poetry
if: ${{ !startsWith(github.event_name, 'pull_request') }}
run: pipx install poetry
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Test Plugin
id: plugin-test
run: |
curl -sSL https://github.com/nonebot/noneflow/releases/latest/download/plugin_test.py | python -
noneflow:
runs-on: ubuntu-latest
name: noneflow
needs: plugin_test
steps:
- name: Generate token
id: generate-token
@@ -72,29 +49,17 @@ jobs:
with:
token: ${{ steps.generate-token.outputs.token }}
- name: Cache pre-commit hooks
uses: actions/cache@v4
with:
path: .cache/.pre-commit
key: noneflow-${{ runner.os }}-${{ hashFiles('.pre-commit-config.yaml') }}
- name: NoneFlow
uses: docker://ghcr.io/nonebot/noneflow:latest
with:
config: >
{
"base": "master",
"plugin_path": "assets/plugins.json",
"bot_path": "assets/bots.json",
"adapter_path": "assets/adapters.json"
"plugin_path": "assets/plugins.json5",
"bot_path": "assets/bots.json5",
"adapter_path": "assets/adapters.json5",
"registry_repository": "nonebot/registry"
}
env:
PLUGIN_TEST_RESULT: ${{ needs.plugin_test.outputs.result }}
PLUGIN_TEST_OUTPUT: ${{ needs.plugin_test.outputs.output }}
PLUGIN_TEST_METADATA: ${{ needs.plugin_test.outputs.metadata }}
APP_ID: ${{ secrets.APP_ID }}
PRIVATE_KEY: ${{ secrets.APP_KEY }}
PRE_COMMIT_HOME: /github/workspace/.cache/.pre-commit
- name: Fix permission
run: sudo chown -R $(whoami):$(id -ng) .cache/.pre-commit

View File

@@ -40,7 +40,7 @@ jobs:
- name: Update Changelog
uses: docker://ghcr.io/nonebot/auto-changelog:master
with:
changelog_file: website/src/pages/changelog.md
changelog_file: website/src/changelog/changelog.md
latest_changes_position: '# 更新日志\n\n'
latest_changes_title: "## 最近更新"
replace_regex: '(?<=## 最近更新\n)[\s\S]*?(?=\n## )'

View File

@@ -32,7 +32,7 @@ jobs:
- name: Archive Changelog
uses: docker://ghcr.io/nonebot/auto-changelog:master
with:
changelog_file: website/src/pages/changelog.md
changelog_file: website/src/changelog/changelog.md
archive_regex: '(?<=## )最近更新(?=\n)'
archive_title: ${{ env.TAG_NAME }}
commit_and_push: false

View File

@@ -33,7 +33,7 @@ jobs:
run: echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV
- name: Deploy to Netlify
uses: nwtgck/actions-netlify@v2
uses: nwtgck/actions-netlify@v3
with:
publish-dir: "./website/build"
production-deploy: true

104
.github/workflows/website-preview-cd.yml vendored Normal file
View File

@@ -0,0 +1,104 @@
name: Site Deploy (Preview CD)
on:
workflow_run:
workflows: ["Site Deploy (Preview CI)"]
types:
- completed
jobs:
preview-cd:
runs-on: ubuntu-latest
concurrency:
group: pull-request-preview-${{ github.event.workflow_run.head_repository.full_name }}-${{ github.event.workflow_run.head_branch }}
cancel-in-progress: true
if: ${{ github.event.workflow_run.conclusion == 'success' }}
environment: pull request
permissions:
actions: read
statuses: write
pull-requests: write
steps:
- name: Set Commit Status
uses: actions/github-script@v7
with:
script: |
github.rest.repos.createCommitStatus({
owner: context.repo.owner,
repo: context.repo.repo,
sha: context.payload.workflow_run.head_sha,
context: 'Website Preview',
description: 'Deploying...',
state: 'pending',
})
- name: Download Artifact
uses: actions/download-artifact@v4
with:
name: website-preview
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ github.event.workflow_run.id }}
- name: Restore Context
run: |
PR_NUMBER=$(cat ./pr-number)
if ! [[ "${PR_NUMBER}" =~ ^[0-9]+$ ]]; then
echo "Invalid PR number: ${PR_NUMBER}"
exit 1
fi
echo "PR_NUMBER=${PR_NUMBER}" >> "${GITHUB_ENV}"
- name: Set Deploy Name
run: |
echo "DEPLOY_NAME=deploy-preview-${PR_NUMBER}" >> "${GITHUB_ENV}"
- name: Deploy to Netlify
id: deploy
uses: nwtgck/actions-netlify@v3
with:
publish-dir: ./website/build
production-deploy: false
deploy-message: "Deploy ${{ env.DEPLOY_NAME }}@${{ github.event.workflow_run.head_sha }}"
alias: ${{ env.DEPLOY_NAME }}
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.SITE_ID }}
# action netlify has no pull request context, so we need to comment by ourselves
- name: Comment on Pull Request
uses: marocchino/sticky-pull-request-comment@v2
with:
header: website
number: ${{ env.PR_NUMBER }}
message: |
:rocket: Deployed to ${{ steps.deploy.outputs.deploy-url }}
- name: Set Commit Status
uses: actions/github-script@v7
if: always()
with:
script: |
if (`${{ job.status }}` === 'success') {
github.rest.repos.createCommitStatus({
owner: context.repo.owner,
repo: context.repo.repo,
sha: context.payload.workflow_run.head_sha,
context: 'Website Preview',
description: `Deployed to ${{ steps.deploy.outputs.deploy-url }}`,
state: 'success',
target_url: `${{ steps.deploy.outputs.deploy-url }}`,
})
} else {
github.rest.repos.createCommitStatus({
owner: context.repo.owner,
repo: context.repo.repo,
sha: context.payload.workflow_run.head_sha,
context: 'Website Preview',
description: `Deploy ${{ job.status }}`,
state: 'failure',
})
}

View File

@@ -0,0 +1,42 @@
name: Site Deploy (Preview CI)
on:
pull_request:
jobs:
preview-ci:
runs-on: ubuntu-latest
concurrency:
group: pull-request-preview-${{ github.event.number }}
cancel-in-progress: true
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: Setup Python Environment
uses: ./.github/actions/setup-python
- name: Setup Node Environment
uses: ./.github/actions/setup-node
- name: Build API Doc
uses: ./.github/actions/build-api-doc
- name: Build Doc
run: yarn build
- name: Export Context
run: |
echo "${{ github.event.pull_request.number }}" > ./pr-number
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: website-preview
path: |
./website/build
./pr-number
retention-days: 1

View File

@@ -1,46 +0,0 @@
name: Site Deploy(Preview)
on:
pull_request_target:
jobs:
preview:
runs-on: ubuntu-latest
concurrency:
group: pull-request-preview-${{ github.event.number }}
cancel-in-progress: true
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: Setup Python Environment
uses: ./.github/actions/setup-python
- name: Setup Node Environment
uses: ./.github/actions/setup-node
- name: Build API Doc
uses: ./.github/actions/build-api-doc
- name: Build Doc
run: yarn build
- name: Get Deploy Name
run: |
echo "DEPLOY_NAME=deploy-preview-${{ github.event.number }}" >> $GITHUB_ENV
- name: Deploy to Netlify
uses: nwtgck/actions-netlify@v2
with:
publish-dir: "./website/build"
production-deploy: false
github-token: ${{ secrets.GITHUB_TOKEN }}
deploy-message: "Deploy ${{ env.DEPLOY_NAME }}@${{ github.sha }}"
enable-commit-comment: false
alias: ${{ env.DEPLOY_NAME }}
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.SITE_ID }}

1
.gitignore vendored
View File

@@ -7,6 +7,7 @@ docs_build/_build
!tests/.env
.docusaurus
website/docs/api/**/*.md
website/src/pages/changelog/**/*
# Created by https://www.toptal.com/developers/gitignore/api/python,node,visualstudiocode,jetbrains,macos,windows,linux
# Edit at https://www.toptal.com/developers/gitignore?templates=python,node,visualstudiocode,jetbrains,macos,windows,linux

View File

@@ -7,30 +7,13 @@ ci:
autoupdate_commit_msg: ":arrow_up: auto update by pre-commit hooks"
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.2.0
rev: v0.8.1
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
stages: [commit]
- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
stages: [commit]
- repo: https://github.com/psf/black
rev: 24.1.1
hooks:
- id: black
stages: [commit]
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v4.0.0-alpha.8
hooks:
- id: prettier
types_or: [javascript, jsx, ts, tsx, markdown, yaml, json]
stages: [commit]
args: [--fix]
stages: [pre-commit]
- id: ruff-format
stages: [pre-commit]
- repo: https://github.com/nonebot/nonemoji
rev: v0.1.4

View File

@@ -1,3 +1,3 @@
# Changelog
See [changelog.md](./website/src/pages/changelog.md) or <https://nonebot.dev/changelog>
See [changelog.md](./website/src/changelog/changelog.md) or <https://nonebot.dev/changelog>

View File

@@ -21,7 +21,7 @@ _✨ 跨平台 Python 异步机器人框架 ✨_
<a href="https://pypi.python.org/pypi/nonebot2">
<img src="https://img.shields.io/pypi/v/nonebot2?logo=python&logoColor=edb641" alt="pypi">
</a>
<img src="https://img.shields.io/badge/python-3.8+-blue?logo=python&logoColor=edb641" alt="python">
<img src="https://img.shields.io/badge/python-3.9+-blue?logo=python&logoColor=edb641" alt="python">
<a href="https://github.com/psf/black">
<img src="https://img.shields.io/badge/code%20style-black-000000.svg?logo=python&logoColor=edb641" alt="black">
</a>
@@ -111,25 +111,29 @@ NoneBot2 是一个现代、跨平台、可扩展的 Python 聊天机器人框架
- 海纳百川:一个框架,支持多个聊天软件平台,可自定义通信协议
| 协议名称 | 状态 | 注释 |
| :--------------------------------------------------------------------------------------------------------------------------: | :--: | :-----------------------------------------------------------------------: |
| :-------------------------------------------------------------------------------------------------------------------: | :--: | :-----------------------------------------------------------------------: |
| OneBot[仓库](https://github.com/nonebot/adapter-onebot)[协议](https://onebot.dev/) | ✅ | 支持 QQ、TG、微信公众号、KOOK 等[平台](https://onebot.dev/ecosystem.html) |
| Telegram[仓库](https://github.com/nonebot/adapter-telegram)[协议](https://core.telegram.org/bots/api) | ✅ | |
| 飞书([仓库](https://github.com/nonebot/adapter-feishu)[协议](https://open.feishu.cn/document/home/index) | ✅ | |
| GitHub[仓库](https://github.com/nonebot/adapter-github)[协议](https://docs.github.com/en/apps) | ✅ | GitHub APP & OAuth APP |
| QQ[仓库](https://github.com/nonebot/adapter-qq)[协议](https://bot.q.qq.com/wiki/) | ✅ | QQ 官方接口调整较多 |
| 钉钉([仓库](https://github.com/nonebot/adapter-ding)[协议](https://open.dingtalk.com/document/) | 🤗 | 寻找 Maintainer暂不可用 |
| Console[仓库](https://github.com/nonebot/adapter-console) | ✅ | 控制台交互 |
| Red [仓库](https://github.com/nonebot/adapter-red)[协议](https://chrononeko.github.io/QQNTRedProtocol/) | ✅ | QQ 协议 |
| Red[仓库](https://github.com/nonebot/adapter-red)[协议](https://chrononeko.github.io/QQNTRedProtocol/) | ✅ | QQ 协议 |
| Satori[仓库](https://github.com/nonebot/adapter-satori)[协议](https://satori.js.org/zh-CN) | ✅ | 支持 Onebot、TG、飞书、微信公众号、Koishi 等 |
| Discord [仓库](https://github.com/nonebot/adapter-discord)[协议](https://discord.com/developers/docs/intro) | ✅ | Discord Bot 协议 |
| DoDo [仓库](https://github.com/nonebot/adapter-dodo)[协议](https://open.imdodo.com/) | ✅ | DoDo Bot 协议 |
| Discord[仓库](https://github.com/nonebot/adapter-discord)[协议](https://discord.com/developers/docs/intro) | ✅ | Discord Bot 协议 |
| DoDo[仓库](https://github.com/nonebot/adapter-dodo)[协议](https://open.imdodo.com/) | ✅ | DoDo Bot 协议 |
| Kritor[仓库](https://github.com/nonebot/adapter-kritor)[协议](https://github.com/KarinJS/kritor) | ✅ | Kritor (OnebotX) 协议QQ 机器人接口标准 |
| Mirai[仓库](https://github.com/nonebot/adapter-mirai)[协议](https://docs.mirai.mamoe.net/mirai-api-http/) | ✅ | QQ 协议 |
| 钉钉([仓库](https://github.com/nonebot/adapter-ding)[协议](https://open.dingtalk.com/document/) | 🤗 | 寻找 Maintainer暂不可用 |
| 开黑啦([仓库](https://github.com/Tian-que/nonebot-adapter-kaiheila)[协议](https://developer.kookapp.cn/) | ↗️ | 由社区贡献 |
| Mirai[仓库](https://github.com/ieew/nonebot_adapter_mirai2)[协议](https://docs.mirai.mamoe.net/mirai-api-http/) | ↗️ | QQ 协议,由社区贡献 |
| Ntchat[仓库](https://github.com/JustUndertaker/adapter-ntchat) | ↗️ | 微信协议,由社区贡献 |
| 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 协议,由社区贡献 |
| Villa[仓库](https://github.com/CMHopeSunshine/nonebot-adapter-villa)[协议](https://webstatic.mihoyo.com/vila/bot/doc/) | ↗️ | 米游社大别野 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 协议,由社区贡献 |
| Tailchat[仓库](https://github.com/eya46/nonebot-adapter-tailchat)[协议](https://tailchat.msgbyte.com/) | ↗️ | Tailchat 开放平台 Bot 协议,由社区贡献 |
| Mail[仓库](https://github.com/mobyw/nonebot-adapter-mail) | ↗️ | 邮件收发协议,由社区贡献 |
- 坚实后盾:支持多种 web 框架,可自定义替换、组合

View File

@@ -4,7 +4,7 @@
"project_link": "nonebot-adapter-onebot",
"name": "OneBot V11",
"desc": "OneBot V11 协议",
"author": "yanyongyu",
"author_id": 42488585,
"homepage": "https://onebot.adapters.nonebot.dev/",
"tags": [],
"is_official": true
@@ -14,7 +14,7 @@
"project_link": "nonebot-adapter-ding",
"name": "钉钉",
"desc": "钉钉协议",
"author": "Artin",
"author_id": 1184028,
"homepage": "https://github.com/nonebot/adapter-ding",
"tags": [],
"is_official": true
@@ -24,7 +24,7 @@
"project_link": "nonebot-adapter-feishu",
"name": "飞书",
"desc": "飞书协议",
"author": "StarHeartHunt",
"author_id": 14922941,
"homepage": "https://github.com/nonebot/adapter-feishu",
"tags": [],
"is_official": true
@@ -34,7 +34,7 @@
"project_link": "nonebot-adapter-telegram",
"name": "Telegram",
"desc": "Telegram 协议",
"author": "j1g5awi",
"author_id": 50312681,
"homepage": "https://github.com/nonebot/adapter-telegram",
"tags": [],
"is_official": true
@@ -44,7 +44,7 @@
"project_link": "nonebot-adapter-qq",
"name": "QQ",
"desc": "QQ 官方机器人",
"author": "yanyongyu",
"author_id": 42488585,
"homepage": "https://github.com/nonebot/adapter-qq",
"tags": [],
"is_official": true
@@ -54,27 +54,27 @@
"project_link": "nonebot-adapter-kaiheila",
"name": "开黑啦",
"desc": "开黑啦协议适配",
"author": "Tian-que",
"author_id": 37477320,
"homepage": "https://github.com/Tian-que/nonebot-adapter-kaiheila",
"tags": [],
"is_official": false
},
{
"module_name": "nonebot.adapters.mirai2",
"project_link": "nonebot_adapter_mirai2",
"name": "mirai2",
"desc": "为 nonebot2 添加 mirai_api_http2.x的兼容适配",
"author": "ieew",
"homepage": "https://github.com/ieew/nonebot_adapter_mirai2",
"module_name": "nonebot.adapters.mirai",
"project_link": "nonebot-adapter-mirai",
"name": "Mirai",
"desc": "mirai-api-http v2 协议适配",
"author_id": 42648639,
"homepage": "https://github.com/nonebot/adapter-mirai",
"tags": [],
"is_official": false
"is_official": true
},
{
"module_name": "nonebot.adapters.onebot.v12",
"project_link": "nonebot-adapter-onebot",
"name": "OneBot V12",
"desc": "OneBot V12 协议",
"author": "yanyongyu",
"author_id": 42488585,
"homepage": "https://onebot.adapters.nonebot.dev/",
"tags": [],
"is_official": true
@@ -84,7 +84,7 @@
"project_link": "nonebot-adapter-console",
"name": "Console",
"desc": "基于终端的交互式适配器",
"author": "Melodyknit",
"author_id": 50488999,
"homepage": "https://github.com/nonebot/adapter-console",
"tags": [],
"is_official": true
@@ -94,7 +94,7 @@
"project_link": "nonebot-adapter-github",
"name": "GitHub",
"desc": "GitHub APP & OAuth APP integration",
"author": "yanyongyu",
"author_id": 42488585,
"homepage": "https://github.com/nonebot/adapter-github",
"tags": [],
"is_official": true
@@ -104,7 +104,7 @@
"project_link": "nonebot-adapter-ntchat",
"name": "Ntchat",
"desc": "pc hook的微信客户端适配",
"author": "JustUndertaker",
"author_id": 37363867,
"homepage": "https://github.com/JustUndertaker/adapter-ntchat",
"tags": [
{
@@ -119,7 +119,7 @@
"project_link": "nonebot-adapter-minecraft",
"name": "Minecraft",
"desc": "MineCraft通信适配支持Rcon",
"author": "17TheWord",
"author_id": 54731914,
"homepage": "https://github.com/17TheWord/nonebot-adapter-minecraft",
"tags": [
{
@@ -134,7 +134,7 @@
"project_link": "nonebot-adapter-bilibili",
"name": "BilibiliLive",
"desc": "b站直播间ws协议",
"author": "wwweww",
"author_id": 39620657,
"homepage": "https://github.com/wwweww/adapter-bilibili",
"tags": [],
"is_official": false
@@ -144,7 +144,7 @@
"project_link": "nonebot-adapter-walleq",
"name": "Walle-Q",
"desc": "内置 QQ 协议实现",
"author": "abrahum",
"author_id": 18395948,
"homepage": "https://github.com/onebot-walle/nonebot_adapter_walleq",
"tags": [
{
@@ -159,7 +159,7 @@
"project_link": "nonebot-adapter-villa",
"name": "大别野",
"desc": "米游社大别野官方Bot适配",
"author": "CMHopeSunshine",
"author_id": 63870437,
"homepage": "https://github.com/CMHopeSunshine/nonebot-adapter-villa",
"tags": [
{
@@ -174,7 +174,7 @@
"project_link": "nonebot-adapter-red",
"name": "RedProtocol",
"desc": "QQNT RedProtocol 适配",
"author": "zhaomaoniu",
"author_id": 55650833,
"homepage": "https://github.com/nonebot/adapter-red",
"tags": [],
"is_official": true
@@ -184,7 +184,7 @@
"project_link": "nonebot-adapter-discord",
"name": "Discord",
"desc": "Discord 官方 Bot 协议适配",
"author": "CMHopeSunshine",
"author_id": 63870437,
"homepage": "https://github.com/nonebot/adapter-discord",
"tags": [],
"is_official": true
@@ -194,7 +194,7 @@
"project_link": "nonebot-adapter-satori",
"name": "Satori",
"desc": "Satori 协议适配器",
"author": "RF-Tar-Railt",
"author_id": 42648639,
"homepage": "https://github.com/nonebot/adapter-satori",
"tags": [
{
@@ -209,9 +209,54 @@
"project_link": "nonebot-adapter-dodo",
"name": "DoDo",
"desc": "DoDo Bot 协议适配器",
"author": "CMHopeSunshine",
"author_id": 63870437,
"homepage": "https://github.com/nonebot/adapter-dodo",
"tags": [],
"is_official": true
},
{
"module_name": "nonebot.adapters.rocketchat",
"project_link": "nonebot-adapter-rocketchat",
"name": "RocketChat",
"desc": "RocketChat adapter for nonebot2",
"author_id": 78360471,
"homepage": "https://github.com/IUnlimit/nonebot-adapter-rocketchat",
"tags": [],
"is_official": false
},
{
"module_name": "nonebot.adapters.kritor",
"project_link": "nonebot-adapter-kritor",
"name": "Kritor",
"desc": "Kritor 协议适配",
"author_id": 42648639,
"homepage": "https://github.com/nonebot/adapter-kritor",
"tags": [
{
"label": "QQNT",
"color": "#35a7c9"
}
],
"is_official": true
},
{
"module_name": "nonebot_adapter_tailchat",
"project_link": "nonebot-adapter-tailchat",
"name": "Tailchat",
"desc": "Tailchat 适配器",
"author_id": 61458340,
"homepage": "https://github.com/eya46/nonebot-adapter-tailchat",
"tags": [],
"is_official": false
},
{
"module_name": "nonebot.adapters.mail",
"project_link": "nonebot-adapter-mail",
"name": "Mail",
"desc": "邮件收发协议",
"author_id": 44370805,
"homepage": "https://github.com/mobyw/nonebot-adapter-mail",
"tags": [],
"is_official": false
},
]

View File

@@ -2,7 +2,7 @@
{
"name": "HarukaBot",
"desc": "将B站UP主的动态和直播信息推送至QQ",
"author": "SK-415",
"author_id": 36433929,
"homepage": "https://github.com/SK-415/HarukaBot",
"tags": [],
"is_official": false
@@ -10,7 +10,7 @@
{
"name": "Omega Miya",
"desc": "B站推送Pixiv搜图识番求签抽卡表情包还有其他杂七杂八的功能",
"author": "Ailitonia",
"author_id": 41713304,
"homepage": "https://github.com/Ailitonia/omega-miya",
"tags": [],
"is_official": false
@@ -18,7 +18,7 @@
{
"name": "Github Bot",
"desc": "在QQ获取/处理Github repo/pr/issue",
"author": "yanyongyu",
"author_id": 42488585,
"homepage": "https://github.com/cscs181/QQ-GitHub-Bot",
"tags": [],
"is_official": false
@@ -26,7 +26,7 @@
{
"name": "YanXiBot",
"desc": "动漫资源查找与娱乐机器人",
"author": "Melodyknit",
"author_id": 50488999,
"homepage": "https://github.com/Melodyknit/YanXiBot",
"tags": [],
"is_official": false
@@ -34,7 +34,7 @@
{
"name": "绪山真寻bot",
"desc": "含有不少的娱乐功能同时稍稍有一些实用的功能 :P",
"author": "HibiKier",
"author_id": 45528451,
"homepage": "https://github.com/HibiKier/zhenxun_bot",
"tags": [],
"is_official": false
@@ -42,7 +42,7 @@
{
"name": "ATRI",
"desc": "高性能文爱萝卜子,糅杂了各类有趣小功能",
"author": "Kyomotoi",
"author_id": 37587870,
"homepage": "https://github.com/Kyomotoi/ATRI",
"tags": [],
"is_official": false
@@ -50,7 +50,7 @@
{
"name": "dumbot傻瓜机器人",
"desc": "猜一猜游戏、新闻一览、英文每日一词一短语等等含一键启动及docker容器部署就绪",
"author": "ffreemt",
"author_id": 52522252,
"homepage": "https://github.com/ffreemt/koyeb-nb2",
"tags": [],
"is_official": false
@@ -58,7 +58,7 @@
{
"name": "DicePP",
"desc": "TRPG骰娘, 带先攻, 查询等功能, 主要面向DND5E. 面对骰主推出的船新版本, 内置Windows/Linux详细部署指南以及方便的自定义骰娘方法, 从回复文本到查询资料库都可轻松配置~",
"author": "pear-studio",
"author_id": 88259371,
"homepage": "https://github.com/pear-studio/nonebot-dicepp",
"tags": [],
"is_official": false
@@ -66,7 +66,7 @@
{
"name": "SetuBot",
"desc": "每个群配置文件独立,可以控制频率,socks http代理,R18开关,支持多tag,自建API lolicon Pixiv热度榜",
"author": "yuban10703",
"author_id": 39484884,
"homepage": "https://github.com/yuban10703/setu-nonebot2",
"tags": [],
"is_official": false
@@ -74,7 +74,7 @@
{
"name": "剑网三bot",
"desc": "网络游戏《剑侠情缘三》的群聊机器人数据使用www.jx3api.com",
"author": "JustUndertaker",
"author_id": 37363867,
"homepage": "https://github.com/JustUndertaker/mini_jx3_bot",
"tags": [
{
@@ -87,7 +87,7 @@
{
"name": "PixivBot",
"desc": "顾名思义是Pixiv的bot随机推荐插画、随机指定关键词插画、随机书签、查看排行榜、查看指定id插画",
"author": "ssttkkl",
"author_id": 17331698,
"homepage": "https://github.com/ssttkkl/PixivBot",
"tags": [],
"is_official": false
@@ -95,7 +95,7 @@
{
"name": "SeaBot_QQ",
"desc": "一个能够获取新闻资讯并推送至QQ的群聊机器人。",
"author": "B1ue1nWh1te",
"author_id": 31682561,
"homepage": "https://github.com/B1ue1nWh1te/SeaBot_QQ",
"tags": [],
"is_official": false
@@ -103,7 +103,7 @@
{
"name": "琪露诺Bot",
"desc": "用QQ机器人控制Minecraft服务器服务器状态查询/服务器白名单/插件列表/玩家查询/转发服务器消息/执行指令... 其他实用娱乐功能三步即可成功部署的QQ bot",
"author": "summerkirakira",
"author_id": 56951617,
"homepage": "https://github.com/summerkirakira/CirnoBot",
"tags": [
{
@@ -116,7 +116,7 @@
{
"name": "Inkar Suki",
"desc": "一个十分方便的Bot支持包括Webhook、群管、剑网3等一系列功能持续更新中……",
"author": "HornCopper",
"author_id": 68726147,
"homepage": "https://github.com/HornCopper/Inkar-Suki",
"tags": [
{
@@ -137,7 +137,7 @@
{
"name": "屑岛风Bot",
"desc": "自家用屑Bot",
"author": "kexue-z",
"author_id": 71873002,
"homepage": "https://github.com/kexue-z/Dao-bot",
"tags": [],
"is_official": false
@@ -145,7 +145,7 @@
{
"name": "LiteyukiBot-轻雪机器人",
"desc": "一个有各种琐事功能的bot有AI接口能陪聊",
"author": "snowyfirefly",
"author_id": 79104275,
"homepage": "https://github.com/snowyfirefly/Liteyuki",
"tags": [
{
@@ -162,7 +162,7 @@
{
"name": "nya_bot",
"desc": "喵服——战魂铭人联机服务器兼机器人",
"author": "nikissXI",
"author_id": 31379266,
"homepage": "https://github.com/nikissXI/nya_bot",
"tags": [
{
@@ -175,7 +175,7 @@
{
"name": "真宵Bot",
"desc": "专注群聊的QQ机器人",
"author": "Shine-Light",
"author_id": 71173418,
"homepage": "https://github.com/Shine-Light/Nonebot_Bot_MayaFey",
"tags": [
{
@@ -196,7 +196,7 @@
{
"name": "SkadiBot",
"desc": "明日方舟主题机器人—斯卡蒂",
"author": "yuyuziYYZ",
"author_id": 101615359,
"homepage": "https://github.com/yuyuziYYZ/skadi_bot",
"tags": [
{
@@ -217,7 +217,7 @@
{
"name": "小白机器人",
"desc": "一个高度依赖数据库的群管理机器人",
"author": "SDIJF1521",
"author_id": 69745333,
"homepage": "https://github.com/SDIJF1521/qqai",
"tags": [
{
@@ -234,7 +234,7 @@
{
"name": "LittlePaimon",
"desc": "小派蒙,多功能原神机器人。",
"author": "CMHopeSunshine",
"author_id": 63870437,
"homepage": "https://github.com/CMHopeSunshine/LittlePaimon",
"tags": [
{
@@ -247,7 +247,7 @@
{
"name": "IdhagnBot",
"desc": "🐱🤖 一个以娱乐功能为主的缝合怪划掉QQ机器人包含一定Furry要素但是不会卖萌就是逊啦",
"author": "su226",
"author_id": 17371317,
"homepage": "https://github.com/su226/IdhagnBot",
"tags": [],
"is_official": false
@@ -255,7 +255,7 @@
{
"name": "hsbot",
"desc": "服务于《炉石传说》玩家的机器人,上线至今已有加入十余个个炉石相关群聊,上千名用户使用,响应请求数万次。 数据使用HSreplay, Fbigame, Hearthstone API",
"author": "gzy02",
"author_id": 67055520,
"homepage": "https://github.com/gzy02/hsbot",
"tags": [
{
@@ -268,7 +268,7 @@
{
"name": "Bread Dog Bot",
"desc": "Terraria TShock QQ 机器人",
"author": "Qianyiovo",
"author_id": 160252668,
"homepage": "https://github.com/Qianyiovo/bread_dog_bot",
"tags": [
{
@@ -289,7 +289,7 @@
{
"name": "RanBot",
"desc": "不@会很安静的Bot",
"author": "IAXRetailer",
"author_id": 88923783,
"homepage": "https://github.com/Hecatia-Hell-Workshop/RanBot",
"tags": [],
"is_official": false
@@ -297,7 +297,7 @@
{
"name": "辞辞(cici)Bot",
"desc": "一个集成娱乐和群管为一体的机器人",
"author": "mengxinyuan638",
"author_id": 90902259,
"homepage": "https://github.com/mengxinyuan638/cici-bot",
"tags": [
{
@@ -318,7 +318,7 @@
{
"name": "SuzunoBot",
"desc": "多功能音游bot主要服务maimaiDX、Arcaea",
"author": "Rinfair-CSP-A016",
"author_id": 29980586,
"homepage": "https://github.com/Rinfair-CSP-A016/SuzunoBot-AGLAS",
"tags": [
{
@@ -339,7 +339,7 @@
{
"name": "青岚",
"desc": "基于NoneBot的与Minecraft Server互通消息的机器人",
"author": "17TheWord",
"author_id": 54731914,
"homepage": "https://github.com/17TheWord/qinglan_bot",
"tags": [
{
@@ -352,7 +352,7 @@
{
"name": "ChensQBOTv2",
"desc": "多功能QQ群机器人权限管理/联ban/社工等等等等,以及拥有一个强大的开发者",
"author": "cnchens",
"author_id": 116929900,
"homepage": "https://github.com/cnchens/ChensQBOTv2",
"tags": [],
"is_official": false
@@ -360,7 +360,7 @@
{
"name": "koishi",
"desc": "支持爬取 codeforces, atcoder, 牛客上程序设计赛事的 bot。",
"author": "CupidsBow",
"author_id": 71639222,
"homepage": "https://github.com/CupidsBow/koishi",
"tags": [
{
@@ -381,7 +381,7 @@
{
"name": "脑积水",
"desc": "一个超级缝合怪...",
"author": "zhulinyv",
"author_id": 66541860,
"homepage": "https://github.com/zhulinyv/NJS",
"tags": [
{
@@ -394,7 +394,7 @@
{
"name": "LOVE酱",
"desc": "为铁锈战争游戏群服务的虚拟少女,内置了爬取铁锈房间列表功能,以及游戏内单位查询功能,并制作了教学系统以及铁锈相关游戏群的收集功能。",
"author": "allureluoli",
"author_id": 106828088,
"homepage": "https://github.com/allureluoli/LOVE-",
"tags": [
{
@@ -411,7 +411,7 @@
{
"name": "fubot",
"desc": "基于nonebot与go-cqhttp的QQ娱乐bot提供群日常娱乐功能与舞萌DX游戏相关的信息查询功能。",
"author": "HCskia",
"author_id": 54059896,
"homepage": "https://github.com/HCskia/fu-Bot",
"tags": [
{
@@ -424,7 +424,7 @@
{
"name": "桃桃酱",
"desc": "一个会拆家的高性能缝合萝卜子",
"author": "tkgs0",
"author_id": 107618388,
"homepage": "https://github.com/tkgs0/Momoko",
"tags": [],
"is_official": false
@@ -432,7 +432,7 @@
{
"name": "CoolQBot",
"desc": "基于 NoneBot2 的聊天机器人",
"author": "he0119",
"author_id": 5219550,
"homepage": "https://github.com/he0119/CoolQBot",
"tags": [],
"is_official": false
@@ -440,7 +440,7 @@
{
"name": "XDbot2",
"desc": "简单的QQ功能型机器人",
"author": "This-is-XiaoDeng",
"author_id": 104149371,
"homepage": "https://github.com/ITCraftDevelopmentTeam/XDbot2",
"tags": [],
"is_official": false
@@ -448,7 +448,7 @@
{
"name": "March7th",
"desc": "三月七 - 崩坏:星穹铁道机器人",
"author": "mobyw",
"author_id": 44370805,
"homepage": "https://github.com/Mar-7th/March7th",
"tags": [
{
@@ -465,7 +465,7 @@
{
"name": "ay机器人",
"desc": "codeforces和洛谷卷王监视、股票监控、ai聊天",
"author": "863109569",
"author_id": 77315378,
"homepage": "https://github.com/863109569/qqbot",
"tags": [
{
@@ -486,7 +486,7 @@
{
"name": "狐尾",
"desc": "一个整合了兽云祭api的机器人支持账号令牌操作以及上传兽图",
"author": "bingqiu456",
"author_id": 99388013,
"homepage": "https://github.com/bingqiu456/shouyun",
"tags": [
{
@@ -499,7 +499,7 @@
{
"name": "ReimeiBot-黎明机器人",
"desc": "流星飞逝,黎明终将到来。",
"author": "ThirdBlood",
"author_id": 65395090,
"homepage": "https://github.com/3rdBit/ReimeiBot",
"tags": [],
"is_official": false
@@ -507,7 +507,7 @@
{
"name": "web_bot",
"desc": "把机器人搬到网络上",
"author": "wsdtl",
"author_id": 63489103,
"homepage": "https://github.com/wsdtl/web_bot",
"tags": [
{
@@ -520,7 +520,7 @@
{
"name": "林汐",
"desc": "多平台功能型Bot",
"author": "mute23-code",
"author_id": 110453675,
"homepage": "https://github.com/netsora/SoraBot",
"tags": [
{
@@ -537,7 +537,7 @@
{
"name": "米缸",
"desc": "基于nonebot2的米缸Bot",
"author": "LambdaYH",
"author_id": 13503375,
"homepage": "https://github.com/LambdaYH/MigangBot",
"tags": [],
"is_official": false
@@ -545,7 +545,7 @@
{
"name": "不正经的妹妹",
"desc": "一款功能丰富、简单易用、自定义性强、扩展性强的可爱的QQ娱乐机器人",
"author": "itsevin",
"author_id": 104713034,
"homepage": "https://github.com/itsevin/sister_bot",
"tags": [],
"is_official": false
@@ -553,7 +553,7 @@
{
"name": "星见Kirami",
"desc": "🌟 读作 Kirami写作星见简明轻快的聊天机器人应用。",
"author": "A-kirami",
"author_id": 66513481,
"homepage": "https://kiramibot.dev/",
"tags": [],
"is_official": false
@@ -561,7 +561,7 @@
{
"name": "OCNbot",
"desc": "OI Contest Notifier bot一个可以推送洛谷、cf、atcoder、牛客比赛通知的bot",
"author": "ACnoway",
"author_id": 91535478,
"homepage": "https://github.com/ACnoway/OCNbot",
"tags": [
{
@@ -578,7 +578,7 @@
{
"name": "妃爱",
"desc": "超可爱的妃爱QQ群聊机器人",
"author": "jiangyuxiaoxiao",
"author_id": 52267304,
"homepage": "https://github.com/jiangyuxiaoxiao/Hiyori",
"tags": [],
"is_official": false
@@ -586,7 +586,7 @@
{
"name": "芙芙",
"desc": "供 Mooncell Wiki 协作使用的跨平台机器人",
"author": "StarHeartHunt",
"author_id": 14922941,
"homepage": "https://github.com/MooncellWiki/BotFooChan",
"tags": [],
"is_official": false
@@ -594,7 +594,7 @@
{
"name": "Sakiko",
"desc": "基于 LiteLoaderBDS 的 Minecraft 基岩版 Bot",
"author": "zhaomaoniu",
"author_id": 55650833,
"homepage": "https://github.com/zhaomaoniu/Sakiko",
"tags": [
{
@@ -607,5 +607,60 @@
}
],
"is_official": false
},
{
"name": "Minecraft_QQBot",
"desc": "基于 NoneBot2 的 Minecraft 群服互联 QQ 机器人,支持多服务器多种方式连接。",
"author_id": 90964775,
"homepage": "https://github.com/Minecraft-QQBot/BotServer",
"tags": [
{
"label": "Minecraft",
"color": "#ea5252"
},
{
"label": "娱乐",
"color": "#37a7e7"
}
],
"is_official": false
},
{
"name": "小安提Bot",
"desc": "服务于音游 舞萌DX 的多功能Bot",
"author_id": 186144551,
"homepage": "https://github.com/Ant1816/Ant1Bot",
"tags": [
{
"label": "maimaiDX",
"color": "#52ea9a"
},
{
"label": "音游",
"color": "#f74b18"
}
],
"is_official": false
},
{
"name": "CanrotBot",
"desc": "有很多实用功能的bot也有很多没什么用的娱乐功能接入了大模型并且有一部分功能可以被大模型调用。主打一个全都有",
"author_id": 18070676,
"homepage": "https://github.com/wangyw15/CanrotBot",
"tags": [],
"is_official": false
},
{
"name": "Mio澪",
"desc": "超可爱多功能Qbot",
"author_id": 50508678,
"homepage": "https://github.com/EienSakura/mio",
"tags": [
{
"label": "娱乐",
"color": "#ea5252"
}
],
"is_official": false
},
]

View File

@@ -4,7 +4,7 @@
"project_link": "",
"name": "None",
"desc": "None 驱动器",
"author": "yanyongyu",
"author_id": 42488585,
"homepage": "/docs/advanced/driver",
"tags": [],
"is_official": true
@@ -14,7 +14,7 @@
"project_link": "nonebot2[fastapi]",
"name": "FastAPI",
"desc": "FastAPI 驱动器",
"author": "yanyongyu",
"author_id": 42488585,
"homepage": "/docs/advanced/driver",
"tags": [],
"is_official": true
@@ -24,7 +24,7 @@
"project_link": "nonebot2[quart]",
"name": "Quart",
"desc": "Quart 驱动器",
"author": "yanyongyu",
"author_id": 42488585,
"homepage": "/docs/advanced/driver",
"tags": [],
"is_official": true
@@ -34,7 +34,7 @@
"project_link": "nonebot2[httpx]",
"name": "HTTPX",
"desc": "HTTPX 驱动器",
"author": "yanyongyu",
"author_id": 42488585,
"homepage": "/docs/advanced/driver",
"tags": [],
"is_official": true
@@ -44,7 +44,7 @@
"project_link": "nonebot2[websockets]",
"name": "websockets",
"desc": "websockets 驱动器",
"author": "yanyongyu",
"author_id": 42488585,
"homepage": "/docs/advanced/driver",
"tags": [],
"is_official": true
@@ -54,9 +54,9 @@
"project_link": "nonebot2[aiohttp]",
"name": "AIOHTTP",
"desc": "AIOHTTP 驱动器",
"author": "yanyongyu",
"author_id": 42488585,
"homepage": "/docs/advanced/driver",
"tags": [],
"is_official": true
}
},
]

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -6,7 +6,7 @@ authors = ["yanyongyu <yyy@nonebot.dev>"]
license = "MIT"
[tool.poetry.dependencies]
python = "^3.8"
python = "^3.9"
[tool.poetry.group.dev.dependencies]
pydantic = "^1.0.0"

File diff suppressed because it is too large Load Diff

View File

@@ -6,7 +6,7 @@ authors = ["yanyongyu <yyy@nonebot.dev>"]
license = "MIT"
[tool.poetry.dependencies]
python = "^3.8"
python = "^3.9"
[tool.poetry.group.dev.dependencies]
pydantic = "^2.0.0"

1545
envs/test/poetry.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -7,12 +7,12 @@ license = "MIT"
packages = [{ include = "nonebot-test.py" }]
[tool.poetry.dependencies]
python = "^3.8"
nonebug = "^0.3.0"
python = "^3.9"
trio = "^0.27.0"
nonebug = "^0.4.1"
wsproto = "^1.2.0"
pytest-cov = "^4.0.0"
pytest-cov = "^6.0.0"
pytest-xdist = "^3.0.2"
pytest-asyncio = "^0.23.2"
werkzeug = ">=2.3.6,<4.0.0"
coverage-conditional-plugin = "^0.9.0"

View File

@@ -39,22 +39,24 @@
- `require` => {ref}``require` <nonebot.plugin.load.require>`
FrontMatter:
mdx:
format: md
sidebar_position: 0
description: nonebot 模块
"""
import os
from importlib.metadata import version
from typing import Any, Dict, Type, Union, TypeVar, Optional, overload
import os
from typing import Any, Optional, TypeVar, Union, overload
import loguru
from nonebot.adapters import Adapter, Bot
from nonebot.compat import model_dump
from nonebot.config import DOTENV_TYPE, Config, Env
from nonebot.drivers import ASGIMixin, Driver, combine_driver
from nonebot.log import logger as logger
from nonebot.adapters import Bot, Adapter
from nonebot.config import DOTENV_TYPE, Env, Config
from nonebot.utils import escape_tag, resolve_dot_notation
from nonebot.drivers import Driver, ASGIMixin, combine_driver
try:
__version__ = version("nonebot2")
@@ -100,7 +102,7 @@ def get_adapter(name: str) -> Adapter:
@overload
def get_adapter(name: Type[A]) -> A:
def get_adapter(name: type[A]) -> A:
"""
参数:
name: 适配器类型
@@ -110,7 +112,7 @@ def get_adapter(name: Type[A]) -> A:
"""
def get_adapter(name: Union[str, Type[Adapter]]) -> Adapter:
def get_adapter(name: Union[str, type[Adapter]]) -> Adapter:
"""获取已注册的 {ref}`nonebot.adapters.Adapter` 实例。
异常:
@@ -131,7 +133,7 @@ def get_adapter(name: Union[str, Type[Adapter]]) -> Adapter:
return adapters[target]
def get_adapters() -> Dict[str, Adapter]:
def get_adapters() -> dict[str, Adapter]:
"""获取所有已注册的 {ref}`nonebot.adapters.Adapter` 实例。
返回:
@@ -230,7 +232,7 @@ def get_bot(self_id: Optional[str] = None) -> Bot:
raise ValueError("There are no bots to get.")
def get_bots() -> Dict[str, Bot]:
def get_bots() -> dict[str, Bot]:
"""获取所有连接到 NoneBot 的 {ref}`nonebot.adapters.Bot` 对象。
返回:
@@ -249,7 +251,7 @@ def get_bots() -> Dict[str, Bot]:
return get_driver().bots
def _resolve_combine_expr(obj_str: str) -> Type[Driver]:
def _resolve_combine_expr(obj_str: str) -> type[Driver]:
drivers = obj_str.split("+")
DriverClass = resolve_dot_notation(
drivers[0], "Driver", default_prefix="nonebot.drivers."
@@ -266,11 +268,12 @@ def _resolve_combine_expr(obj_str: str) -> Type[Driver]:
def _log_patcher(record: "loguru.Record"):
"""使用插件标识优化日志展示"""
record["name"] = (
plugin.name
plugin.id_
if (module_name := record["name"])
and (plugin := get_plugin_by_module_name(module_name))
else (module_name and module_name.split(".")[0])
else (module_name and module_name.split(".", maxsplit=1)[0])
)
@@ -334,31 +337,31 @@ def run(*args: Any, **kwargs: Any) -> None:
get_driver().run(*args, **kwargs)
from nonebot.plugin import on as on
from nonebot.plugin import on_type as on_type
from nonebot.plugin import require as require
from nonebot.plugin import on_regex as on_regex
from nonebot.plugin import on_notice as on_notice
from nonebot.plugin import get_plugin as get_plugin
from nonebot.plugin import on_command as on_command
from nonebot.plugin import on_keyword as on_keyword
from nonebot.plugin import on_message as on_message
from nonebot.plugin import on_request as on_request
from nonebot.plugin import load_plugin as load_plugin
from nonebot.plugin import on_endswith as on_endswith
from nonebot.plugin import CommandGroup as CommandGroup
from nonebot.plugin import MatcherGroup as MatcherGroup
from nonebot.plugin import load_plugins as load_plugins
from nonebot.plugin import on_fullmatch as on_fullmatch
from nonebot.plugin import on_metaevent as on_metaevent
from nonebot.plugin import on_startswith as on_startswith
from nonebot.plugin import load_from_json as load_from_json
from nonebot.plugin import load_from_toml as load_from_toml
from nonebot.plugin import load_all_plugins as load_all_plugins
from nonebot.plugin import on_shell_command as on_shell_command
from nonebot.plugin import get_plugin_config as get_plugin_config
from nonebot.plugin import get_available_plugin_names as get_available_plugin_names
from nonebot.plugin import get_loaded_plugins as get_loaded_plugins
from nonebot.plugin import get_plugin as get_plugin
from nonebot.plugin import get_plugin_by_module_name as get_plugin_by_module_name
from nonebot.plugin import get_plugin_config as get_plugin_config
from nonebot.plugin import load_all_plugins as load_all_plugins
from nonebot.plugin import load_builtin_plugin as load_builtin_plugin
from nonebot.plugin import load_builtin_plugins as load_builtin_plugins
from nonebot.plugin import get_plugin_by_module_name as get_plugin_by_module_name
from nonebot.plugin import get_available_plugin_names as get_available_plugin_names
from nonebot.plugin import load_from_json as load_from_json
from nonebot.plugin import load_from_toml as load_from_toml
from nonebot.plugin import load_plugin as load_plugin
from nonebot.plugin import load_plugins as load_plugins
from nonebot.plugin import on as on
from nonebot.plugin import on_command as on_command
from nonebot.plugin import on_endswith as on_endswith
from nonebot.plugin import on_fullmatch as on_fullmatch
from nonebot.plugin import on_keyword as on_keyword
from nonebot.plugin import on_message as on_message
from nonebot.plugin import on_metaevent as on_metaevent
from nonebot.plugin import on_notice as on_notice
from nonebot.plugin import on_regex as on_regex
from nonebot.plugin import on_request as on_request
from nonebot.plugin import on_shell_command as on_shell_command
from nonebot.plugin import on_startswith as on_startswith
from nonebot.plugin import on_type as on_type
from nonebot.plugin import require as require

View File

@@ -3,13 +3,15 @@
使用 {ref}`nonebot.drivers.Driver.register_adapter` 注册适配器。
FrontMatter:
mdx:
format: md
sidebar_position: 0
description: nonebot.adapters 模块
"""
from nonebot.internal.adapter import Adapter as Adapter
from nonebot.internal.adapter import Bot as Bot
from nonebot.internal.adapter import Event as Event
from nonebot.internal.adapter import Adapter as Adapter
from nonebot.internal.adapter import Message as Message
from nonebot.internal.adapter import MessageSegment as MessageSegment
from nonebot.internal.adapter import MessageTemplate as MessageTemplate

View File

@@ -3,26 +3,28 @@
为兼容 Pydantic V1 与 V2 版本,定义了一系列兼容函数与类供使用。
FrontMatter:
mdx:
format: md
sidebar_position: 16
description: nonebot.compat 模块
"""
from collections.abc import Generator
from dataclasses import dataclass, is_dataclass
from typing_extensions import Self, Annotated, get_args, get_origin, is_typeddict
from functools import cached_property
from typing import (
TYPE_CHECKING,
Annotated,
Any,
Set,
Dict,
List,
Type,
Union,
TypeVar,
Callable,
Generic,
Optional,
Protocol,
Generator,
TypeVar,
Union,
overload,
)
from typing_extensions import Self, get_args, get_origin, is_typeddict
from pydantic import VERSION, BaseModel
@@ -42,21 +44,21 @@ if TYPE_CHECKING:
__all__ = (
"Required",
"PydanticUndefined",
"PydanticUndefinedType",
"ConfigDict",
"DEFAULT_CONFIG",
"ConfigDict",
"FieldInfo",
"ModelField",
"PydanticUndefined",
"PydanticUndefinedType",
"Required",
"TypeAdapter",
"custom_validation",
"extract_field_info",
"model_field_validate",
"model_fields",
"model_config",
"model_dump",
"type_validate_python",
"model_fields",
"type_validate_json",
"custom_validation",
"type_validate_python",
)
__autodoc__ = {
@@ -66,10 +68,11 @@ __autodoc__ = {
if PYDANTIC_V2: # pragma: pydantic-v2
from pydantic_core import CoreSchema, core_schema
from pydantic import GetCoreSchemaHandler
from pydantic import TypeAdapter as TypeAdapter
from pydantic._internal._repr import display_as_type
from pydantic import TypeAdapter, GetCoreSchemaHandler
from pydantic.fields import FieldInfo as BaseFieldInfo
from pydantic_core import CoreSchema, core_schema
Required = Ellipsis
"""Alias of Ellipsis for compatibility with pydantic v1"""
@@ -94,7 +97,7 @@ if PYDANTIC_V2: # pragma: pydantic-v2
super().__init__(default=default, **kwargs)
@property
def extra(self) -> Dict[str, Any]:
def extra(self) -> dict[str, Any]:
"""Extra data that is not part of the standard pydantic fields.
For compatibility with pydantic v1.
@@ -128,6 +131,25 @@ if PYDANTIC_V2: # pragma: pydantic-v2
"""Construct a ModelField from given infos."""
return cls._construct(name, annotation, field_info or FieldInfo())
def __hash__(self) -> int:
# Each ModelField is unique for our purposes,
# to allow store them in a set.
return id(self)
@cached_property
def type_adapter(self) -> TypeAdapter:
"""TypeAdapter of the field.
Cache the TypeAdapter to avoid creating it multiple times.
Pydantic v2 uses too much cpu time to create TypeAdapter.
See: https://github.com/pydantic/pydantic/issues/9834
"""
return TypeAdapter(
Annotated[self.annotation, self.field_info],
config=None if self._annotation_has_config() else DEFAULT_CONFIG,
)
def _annotation_has_config(self) -> bool:
"""Check if the annotation has config.
@@ -155,28 +177,18 @@ if PYDANTIC_V2: # pragma: pydantic-v2
"""Get the display of the type of the field."""
return display_as_type(self.annotation)
def __hash__(self) -> int:
# Each ModelField is unique for our purposes,
# to allow store them in a set.
return id(self)
def validate_value(self, value: Any) -> Any:
"""Validate the value pass to the field."""
return self.type_adapter.validate_python(value)
def extract_field_info(field_info: BaseFieldInfo) -> Dict[str, Any]:
def extract_field_info(field_info: BaseFieldInfo) -> dict[str, Any]:
"""Get FieldInfo init kwargs from a FieldInfo instance."""
kwargs = field_info._attributes_set.copy()
kwargs["annotation"] = field_info.rebuild_annotation()
return kwargs
def model_field_validate(
model_field: ModelField, value: Any, config: Optional[ConfigDict] = None
) -> Any:
"""Validate the value pass to the field."""
type: Any = Annotated[model_field.annotation, model_field.field_info]
return TypeAdapter(
type, config=None if model_field._annotation_has_config() else config
).validate_python(value)
def model_fields(model: Type[BaseModel]) -> List[ModelField]:
def model_fields(model: type[BaseModel]) -> list[ModelField]:
"""Get field list of a model."""
return [
@@ -188,19 +200,19 @@ if PYDANTIC_V2: # pragma: pydantic-v2
for name, field_info in model.model_fields.items()
]
def model_config(model: Type[BaseModel]) -> Any:
def model_config(model: type[BaseModel]) -> Any:
"""Get config of a model."""
return model.model_config
def model_dump(
model: BaseModel,
include: Optional[Set[str]] = None,
exclude: Optional[Set[str]] = None,
include: Optional[set[str]] = None,
exclude: Optional[set[str]] = None,
by_alias: bool = False,
exclude_unset: bool = False,
exclude_defaults: bool = False,
exclude_none: bool = False,
) -> Dict[str, Any]:
) -> dict[str, Any]:
return model.model_dump(
include=include,
exclude=exclude,
@@ -210,16 +222,16 @@ if PYDANTIC_V2: # pragma: pydantic-v2
exclude_none=exclude_none,
)
def type_validate_python(type_: Type[T], data: Any) -> T:
def type_validate_python(type_: type[T], data: Any) -> T:
"""Validate data with given type."""
return TypeAdapter(type_).validate_python(data)
def type_validate_json(type_: Type[T], data: Union[str, bytes]) -> T:
def type_validate_json(type_: type[T], data: Union[str, bytes]) -> T:
"""Validate JSON with given type."""
return TypeAdapter(type_).validate_json(data)
def __get_pydantic_core_schema__(
cls: Type["_CustomValidationClass"],
cls: type["_CustomValidationClass"],
source_type: Any,
handler: GetCoreSchemaHandler,
) -> CoreSchema:
@@ -230,7 +242,7 @@ if PYDANTIC_V2: # pragma: pydantic-v2
[core_schema.no_info_plain_validator_function(func) for func in validators]
)
def custom_validation(class_: Type["CVC"]) -> Type["CVC"]:
def custom_validation(class_: type["CVC"]) -> type["CVC"]:
"""Use pydantic v1 like validator generator in pydantic v2"""
setattr(
@@ -241,9 +253,8 @@ if PYDANTIC_V2: # pragma: pydantic-v2
return class_
else: # pragma: pydantic-v1
from pydantic import Extra
from pydantic import parse_obj_as, parse_raw_as
from pydantic import BaseConfig as PydanticConfig
from pydantic import Extra, parse_obj_as, parse_raw_as
from pydantic.fields import FieldInfo as BaseFieldInfo
from pydantic.fields import ModelField as BaseModelField
from pydantic.schema import get_annotation_from_field_info
@@ -308,7 +319,46 @@ else: # pragma: pydantic-v1
)
return cls._construct(name, annotation, field_info or FieldInfo())
def extract_field_info(field_info: BaseFieldInfo) -> Dict[str, Any]:
def validate_value(self, value: Any) -> Any:
"""Validate the value pass to the field."""
v, errs_ = self.validate(value, {}, loc=())
if errs_:
raise ValueError(value, self)
return v
class TypeAdapter(Generic[T]):
@overload
def __init__(
self,
type: type[T],
*,
config: Optional[ConfigDict] = ...,
) -> None: ...
@overload
def __init__(
self,
type: Any,
*,
config: Optional[ConfigDict] = ...,
) -> None: ...
def __init__(
self,
type: Any,
*,
config: Optional[ConfigDict] = None,
) -> None:
self.type = type
self.config = config
def validate_python(self, value: Any) -> T:
return type_validate_python(self.type, value)
def validate_json(self, value: Union[str, bytes]) -> T:
return type_validate_json(self.type, value)
def extract_field_info(field_info: BaseFieldInfo) -> dict[str, Any]:
"""Get FieldInfo init kwargs from a FieldInfo instance."""
kwargs = {
@@ -317,23 +367,7 @@ else: # pragma: pydantic-v1
kwargs.update(field_info.extra)
return kwargs
def model_field_validate(
model_field: ModelField, value: Any, config: Optional[Type[ConfigDict]] = None
) -> Any:
"""Validate the value pass to the field.
Set config before validate to ensure validate correctly.
"""
if model_field.model_config is not config:
model_field.set_config(config or ConfigDict)
v, errs_ = model_field.validate(value, {}, loc=())
if errs_:
raise ValueError(value, model_field)
return v
def model_fields(model: Type[BaseModel]) -> List[ModelField]:
def model_fields(model: type[BaseModel]) -> list[ModelField]:
"""Get field list of a model."""
# construct the model field without preprocess to avoid error
@@ -348,19 +382,19 @@ else: # pragma: pydantic-v1
for model_field in model.__fields__.values()
]
def model_config(model: Type[BaseModel]) -> Any:
def model_config(model: type[BaseModel]) -> Any:
"""Get config of a model."""
return model.__config__
def model_dump(
model: BaseModel,
include: Optional[Set[str]] = None,
exclude: Optional[Set[str]] = None,
include: Optional[set[str]] = None,
exclude: Optional[set[str]] = None,
by_alias: bool = False,
exclude_unset: bool = False,
exclude_defaults: bool = False,
exclude_none: bool = False,
) -> Dict[str, Any]:
) -> dict[str, Any]:
return model.dict(
include=include,
exclude=exclude,
@@ -370,14 +404,14 @@ else: # pragma: pydantic-v1
exclude_none=exclude_none,
)
def type_validate_python(type_: Type[T], data: Any) -> T:
def type_validate_python(type_: type[T], data: Any) -> T:
"""Validate data with given type."""
return parse_obj_as(type_, data)
def type_validate_json(type_: Type[T], data: Union[str, bytes]) -> T:
def type_validate_json(type_: type[T], data: Union[str, bytes]) -> T:
"""Validate JSON with given type."""
return parse_raw_as(type_, data)
def custom_validation(class_: Type["CVC"]) -> Type["CVC"]:
def custom_validation(class_: type["CVC"]) -> type["CVC"]:
"""Do nothing in pydantic v1"""
return class_

View File

@@ -7,37 +7,26 @@ NoneBot 使用 [`pydantic`](https://pydantic-docs.helpmanual.io/) 以及
详情见 [`pydantic Field Type`](https://pydantic-docs.helpmanual.io/usage/types/) 文档。
FrontMatter:
mdx:
format: md
sidebar_position: 1
description: nonebot.config 模块
"""
import os
import abc
import json
from pathlib import Path
from collections.abc import Mapping
from datetime import timedelta
from ipaddress import IPv4Address
import json
import os
from pathlib import Path
from typing import TYPE_CHECKING, Any, Optional, Union
from typing_extensions import TypeAlias, get_args, get_origin
from typing import (
TYPE_CHECKING,
Any,
Set,
Dict,
List,
Type,
Tuple,
Union,
Mapping,
Optional,
)
from dotenv import dotenv_values
from pydantic import Field, BaseModel
from pydantic import BaseModel, Field
from pydantic.networks import IPvAnyAddress
from nonebot.log import logger
from nonebot.typing import origin_is_union
from nonebot.utils import deep_update, type_is_complex, lenient_issubclass
from nonebot.compat import (
PYDANTIC_V2,
ConfigDict,
@@ -47,9 +36,12 @@ from nonebot.compat import (
model_config,
model_fields,
)
from nonebot.log import logger
from nonebot.typing import origin_is_union
from nonebot.utils import deep_update, lenient_issubclass, type_is_complex
DOTENV_TYPE: TypeAlias = Union[
Path, str, List[Union[Path, str]], Tuple[Union[Path, str], ...]
Path, str, list[Union[Path, str]], tuple[Union[Path, str], ...]
]
ENV_FILE_SENTINEL = Path("")
@@ -59,7 +51,7 @@ class SettingsError(ValueError): ...
class BaseSettingsSource(abc.ABC):
def __init__(self, settings_cls: Type["BaseSettings"]) -> None:
def __init__(self, settings_cls: type["BaseSettings"]) -> None:
self.settings_cls = settings_cls
@property
@@ -67,7 +59,7 @@ class BaseSettingsSource(abc.ABC):
return model_config(self.settings_cls)
@abc.abstractmethod
def __call__(self) -> Dict[str, Any]:
def __call__(self) -> dict[str, Any]:
raise NotImplementedError
@@ -75,12 +67,12 @@ class InitSettingsSource(BaseSettingsSource):
__slots__ = ("init_kwargs",)
def __init__(
self, settings_cls: Type["BaseSettings"], init_kwargs: Dict[str, Any]
self, settings_cls: type["BaseSettings"], init_kwargs: dict[str, Any]
) -> None:
self.init_kwargs = init_kwargs
super().__init__(settings_cls)
def __call__(self) -> Dict[str, Any]:
def __call__(self) -> dict[str, Any]:
return self.init_kwargs
def __repr__(self) -> str:
@@ -90,7 +82,7 @@ class InitSettingsSource(BaseSettingsSource):
class DotEnvSettingsSource(BaseSettingsSource):
def __init__(
self,
settings_cls: Type["BaseSettings"],
settings_cls: type["BaseSettings"],
env_file: Optional[DOTENV_TYPE] = ENV_FILE_SENTINEL,
env_file_encoding: Optional[str] = None,
case_sensitive: Optional[bool] = None,
@@ -121,7 +113,7 @@ class DotEnvSettingsSource(BaseSettingsSource):
def _apply_case_sensitive(self, var_name: str) -> str:
return var_name if self.case_sensitive else var_name.lower()
def _field_is_complex(self, field: ModelField) -> Tuple[bool, bool]:
def _field_is_complex(self, field: ModelField) -> tuple[bool, bool]:
if type_is_complex(field.annotation):
return True, False
elif origin_is_union(get_origin(field.annotation)) and any(
@@ -132,16 +124,16 @@ class DotEnvSettingsSource(BaseSettingsSource):
def _parse_env_vars(
self, env_vars: Mapping[str, Optional[str]]
) -> Dict[str, Optional[str]]:
) -> dict[str, Optional[str]]:
return {
self._apply_case_sensitive(key): value for key, value in env_vars.items()
}
def _read_env_file(self, file_path: Path) -> Dict[str, Optional[str]]:
def _read_env_file(self, file_path: Path) -> dict[str, Optional[str]]:
file_vars = dotenv_values(file_path, encoding=self.env_file_encoding)
return self._parse_env_vars(file_vars)
def _read_env_files(self) -> Dict[str, Optional[str]]:
def _read_env_files(self) -> dict[str, Optional[str]]:
env_files = self.env_file
if env_files is None:
return {}
@@ -149,7 +141,7 @@ class DotEnvSettingsSource(BaseSettingsSource):
if isinstance(env_files, (str, os.PathLike)):
env_files = [env_files]
dotenv_vars: Dict[str, Optional[str]] = {}
dotenv_vars: dict[str, Optional[str]] = {}
for env_file in env_files:
env_path = Path(env_file).expanduser()
if env_path.is_file():
@@ -170,14 +162,14 @@ class DotEnvSettingsSource(BaseSettingsSource):
def _explode_env_vars(
self,
field: ModelField,
env_vars: Dict[str, Optional[str]],
env_file_vars: Dict[str, Optional[str]],
) -> Dict[str, Any]:
env_vars: dict[str, Optional[str]],
env_file_vars: dict[str, Optional[str]],
) -> dict[str, Any]:
if self.env_nested_delimiter is None:
return {}
prefix = f"{field.name}{self.env_nested_delimiter}"
result: Dict[str, Any] = {}
result: dict[str, Any] = {}
for env_name, env_val in env_vars.items():
if not env_name.startswith(prefix):
continue
@@ -209,10 +201,10 @@ class DotEnvSettingsSource(BaseSettingsSource):
return result
def __call__(self) -> Dict[str, Any]:
def __call__(self) -> dict[str, Any]:
"""从环境变量和 dotenv 配置文件中读取配置项。"""
d: Dict[str, Any] = {}
d: dict[str, Any] = {}
env_vars = self._parse_env_vars(os.environ)
env_file_vars = self._read_env_files()
@@ -317,7 +309,7 @@ class BaseSettings(BaseModel):
return self.__dict__.get(name)
if PYDANTIC_V2: # pragma: pydantic-v2
model_config: SettingsConfig = SettingsConfig(
model_config = SettingsConfig(
extra="allow",
env_file=".env",
env_file_encoding="utf-8",
@@ -351,11 +343,11 @@ class BaseSettings(BaseModel):
def _settings_build_values(
self,
init_kwargs: Dict[str, Any],
init_kwargs: dict[str, Any],
env_file: Optional[DOTENV_TYPE] = None,
env_file_encoding: Optional[str] = None,
env_nested_delimiter: Optional[str] = None,
) -> Dict[str, Any]:
) -> dict[str, Any]:
init_settings = InitSettingsSource(self.__class__, init_kwargs=init_kwargs)
env_settings = DotEnvSettingsSource(
self.__class__,
@@ -426,7 +418,7 @@ class Config(BaseSettings):
"""API 请求超时时间,单位: 秒。"""
# bot runtime configs
superusers: Set[str] = set()
superusers: set[str] = set()
"""机器人超级用户。
用法:
@@ -434,9 +426,9 @@ class Config(BaseSettings):
SUPERUSERS=["12345789"]
```
"""
nickname: Set[str] = set()
nickname: set[str] = set()
"""机器人昵称。"""
command_start: Set[str] = {"/"}
command_start: set[str] = {"/"}
"""命令的起始标记,用于判断一条消息是不是命令。
参考[命令响应规则](https://nonebot.dev/docs/advanced/matcher#command)。
@@ -446,7 +438,7 @@ class Config(BaseSettings):
COMMAND_START=["/", ""]
```
"""
command_sep: Set[str] = {"."}
command_sep: set[str] = {"."}
"""命令的分隔标记,用于将文本形式的命令切分为元组(实际的命令名)。
参考[命令响应规则](https://nonebot.dev/docs/advanced/matcher#command)。
@@ -477,7 +469,9 @@ class Config(BaseSettings):
model_config = SettingsConfig(env_file=(".env", ".env.prod"))
else: # pragma: pydantic-v1
class Config(SettingsConfig):
class Config( # pyright: ignore[reportIncompatibleVariableOverride]
SettingsConfig
):
env_file = ".env", ".env.prod"

View File

@@ -1,6 +1,8 @@
"""本模块包含了 NoneBot 事件处理过程中使用到的常量。
FrontMatter:
mdx:
format: md
sidebar_position: 9
description: nonebot.consts 模块
"""
@@ -20,6 +22,10 @@ REJECT_TARGET: Literal["_current_target"] = "_current_target"
"""当前 `reject` 目标存储 key"""
REJECT_CACHE_TARGET: Literal["_next_target"] = "_next_target"
"""下一个 `reject` 目标存储 key"""
PAUSE_PROMPT_RESULT_KEY: Literal["_pause_result"] = "_pause_result"
"""`pause` prompt 发送结果存储 key"""
REJECT_PROMPT_RESULT_KEY: Literal["_reject_{key}_result"] = "_reject_{key}_result"
"""`reject` prompt 发送结果存储 key"""
# used by Rule
PREFIX_KEY: Literal["_prefix"] = "_prefix"

View File

@@ -1,34 +1,32 @@
"""本模块模块实现了依赖注入的定义与处理。
FrontMatter:
mdx:
format: md
sidebar_position: 0
description: nonebot.dependencies 模块
"""
import abc
import asyncio
from collections.abc import Awaitable, Iterable
from dataclasses import dataclass, field
from functools import partial
import inspect
from dataclasses import field, dataclass
from typing import (
Any,
Dict,
List,
Type,
Tuple,
Generic,
TypeVar,
Callable,
Iterable,
Optional,
Awaitable,
cast,
)
from typing import Any, Callable, Generic, Optional, TypeVar, cast
import anyio
from exceptiongroup import BaseExceptionGroup, catch
from nonebot.compat import FieldInfo, ModelField, PydanticUndefined
from nonebot.exception import SkippedException
from nonebot.log import logger
from nonebot.typing import _DependentCallable
from nonebot.exception import SkippedException
from nonebot.utils import run_sync, is_coroutine_callable
from nonebot.compat import FieldInfo, ModelField, PydanticUndefined
from nonebot.utils import (
flatten_exception_group,
is_coroutine_callable,
run_coro_with_shield,
run_sync,
)
from .utils import check_field_type, get_typed_signature
@@ -48,13 +46,13 @@ class Param(abc.ABC, FieldInfo):
@classmethod
def _check_param(
cls, param: inspect.Parameter, allow_types: Tuple[Type["Param"], ...]
cls, param: inspect.Parameter, allow_types: tuple[type["Param"], ...]
) -> Optional["Param"]:
return
@classmethod
def _check_parameterless(
cls, value: Any, allow_types: Tuple[Type["Param"], ...]
cls, value: Any, allow_types: tuple[type["Param"], ...]
) -> Optional["Param"]:
return
@@ -79,8 +77,8 @@ class Dependent(Generic[R]):
"""
call: _DependentCallable[R]
params: Tuple[ModelField, ...] = field(default_factory=tuple)
parameterless: Tuple[Param, ...] = field(default_factory=tuple)
params: tuple[ModelField, ...] = field(default_factory=tuple)
parameterless: tuple[Param, ...] = field(default_factory=tuple)
def __repr__(self) -> str:
if inspect.isfunction(self.call) or inspect.isclass(self.call):
@@ -94,7 +92,16 @@ class Dependent(Generic[R]):
)
async def __call__(self, **kwargs: Any) -> R:
try:
exception: Optional[BaseExceptionGroup[SkippedException]] = None
def _handle_skipped(exc_group: BaseExceptionGroup[SkippedException]):
nonlocal exception
exception = exc_group
# raise one of the exceptions instead
excs = list(flatten_exception_group(exc_group))
logger.trace(f"{self} skipped due to {excs}")
with catch({SkippedException: _handle_skipped}):
# do pre-check
await self.check(**kwargs)
@@ -106,15 +113,14 @@ class Dependent(Generic[R]):
return await cast(Callable[..., Awaitable[R]], self.call)(**values)
else:
return await run_sync(cast(Callable[..., R], self.call))(**values)
except SkippedException as e:
logger.trace(f"{self} skipped due to {e}")
raise
raise exception
@staticmethod
def parse_params(
call: _DependentCallable[R], allow_types: Tuple[Type[Param], ...]
) -> Tuple[ModelField, ...]:
fields: List[ModelField] = []
call: _DependentCallable[R], allow_types: tuple[type[Param], ...]
) -> tuple[ModelField, ...]:
fields: list[ModelField] = []
params = get_typed_signature(call).parameters.values()
for param in params:
@@ -144,9 +150,9 @@ class Dependent(Generic[R]):
@staticmethod
def parse_parameterless(
parameterless: Tuple[Any, ...], allow_types: Tuple[Type[Param], ...]
) -> Tuple[Param, ...]:
parameterless_params: List[Param] = []
parameterless: tuple[Any, ...], allow_types: tuple[type[Param], ...]
) -> tuple[Param, ...]:
parameterless_params: list[Param] = []
for value in parameterless:
for allow_type in allow_types:
if param := allow_type._check_parameterless(value, allow_types):
@@ -162,7 +168,7 @@ class Dependent(Generic[R]):
*,
call: _DependentCallable[R],
parameterless: Optional[Iterable[Any]] = None,
allow_types: Iterable[Type[Param]],
allow_types: Iterable[type[Param]],
) -> "Dependent[R]":
allow_types = tuple(allow_types)
@@ -176,12 +182,19 @@ class Dependent(Generic[R]):
return cls(call, params, parameterless_params)
async def check(self, **params: Any) -> None:
await asyncio.gather(*(param._check(**params) for param in self.parameterless))
await asyncio.gather(
*(cast(Param, param.field_info)._check(**params) for param in self.params)
if self.parameterless:
async with anyio.create_task_group() as tg:
for param in self.parameterless:
tg.start_soon(partial(param._check, **params))
if self.params:
async with anyio.create_task_group() as tg:
for param in self.params:
tg.start_soon(
partial(cast(Param, param.field_info)._check, **params)
)
async def _solve_field(self, field: ModelField, params: Dict[str, Any]) -> Any:
async def _solve_field(self, field: ModelField, params: dict[str, Any]) -> Any:
param = cast(Param, field.field_info)
value = await param._solve(**params)
if value is PydanticUndefined:
@@ -189,16 +202,28 @@ class Dependent(Generic[R]):
v = check_field_type(field, value)
return v if param.validate else value
async def solve(self, **params: Any) -> Dict[str, Any]:
async def solve(self, **params: Any) -> dict[str, Any]:
# solve parameterless
for param in self.parameterless:
await param._solve(**params)
# solve param values
values = await asyncio.gather(
*(self._solve_field(field, params) for field in self.params)
)
return {field.name: value for field, value in zip(self.params, values)}
result: dict[str, Any] = {}
if not self.params:
return result
async def _solve_field(field: ModelField, params: dict[str, Any]) -> None:
value = await self._solve_field(field, params)
result[field.name] = value
async with anyio.create_task_group() as tg:
for field in self.params:
# shield the task to prevent cancellation
# when one of the tasks raises an exception
# this will improve the dependency cache reusability
tg.start_soon(run_coro_with_shield, _solve_field(field, params))
return result
__autodoc__ = {"CustomConfig": False}

View File

@@ -1,17 +1,19 @@
"""
FrontMatter:
mdx:
format: md
sidebar_position: 1
description: nonebot.dependencies.utils 模块
"""
import inspect
from typing import Any, Dict, Callable, ForwardRef
from typing import Any, Callable, ForwardRef
from loguru import logger
from nonebot.compat import ModelField
from nonebot.exception import TypeMisMatch
from nonebot.typing import evaluate_forwardref
from nonebot.compat import DEFAULT_CONFIG, ModelField, model_field_validate
def get_typed_signature(call: Callable[..., Any]) -> inspect.Signature:
@@ -31,7 +33,7 @@ def get_typed_signature(call: Callable[..., Any]) -> inspect.Signature:
return inspect.Signature(typed_params)
def get_typed_annotation(param: inspect.Parameter, globalns: Dict[str, Any]) -> Any:
def get_typed_annotation(param: inspect.Parameter, globalns: dict[str, Any]) -> Any:
"""获取参数的类型注解"""
annotation = param.annotation
@@ -51,6 +53,6 @@ def check_field_type(field: ModelField, value: Any) -> Any:
"""检查字段类型是否匹配"""
try:
return model_field_validate(field, value, DEFAULT_CONFIG)
return field.validate_value(value)
except ValueError:
raise TypeMisMatch(field, value)

View File

@@ -3,28 +3,31 @@
各驱动请继承以下基类。
FrontMatter:
mdx:
format: md
sidebar_position: 0
description: nonebot.drivers 模块
"""
from nonebot.internal.driver import URL as URL
from nonebot.internal.driver import Mixin as Mixin
from nonebot.internal.driver import Driver as Driver
from nonebot.internal.driver import ASGIMixin as ASGIMixin
from nonebot.internal.driver import Cookies as Cookies
from nonebot.internal.driver import Driver as Driver
from nonebot.internal.driver import ForwardDriver as ForwardDriver
from nonebot.internal.driver import ForwardMixin as ForwardMixin
from nonebot.internal.driver import HTTPClientMixin as HTTPClientMixin
from nonebot.internal.driver import HTTPClientSession as HTTPClientSession
from nonebot.internal.driver import HTTPServerSetup as HTTPServerSetup
from nonebot.internal.driver import HTTPVersion as HTTPVersion
from nonebot.internal.driver import Mixin as Mixin
from nonebot.internal.driver import Request as Request
from nonebot.internal.driver import Response as Response
from nonebot.internal.driver import ASGIMixin as ASGIMixin
from nonebot.internal.driver import WebSocket as WebSocket
from nonebot.internal.driver import HTTPVersion as HTTPVersion
from nonebot.internal.driver import ForwardMixin as ForwardMixin
from nonebot.internal.driver import ReverseMixin as ReverseMixin
from nonebot.internal.driver import ForwardDriver as ForwardDriver
from nonebot.internal.driver import ReverseDriver as ReverseDriver
from nonebot.internal.driver import combine_driver as combine_driver
from nonebot.internal.driver import HTTPClientMixin as HTTPClientMixin
from nonebot.internal.driver import HTTPServerSetup as HTTPServerSetup
from nonebot.internal.driver import ReverseMixin as ReverseMixin
from nonebot.internal.driver import WebSocket as WebSocket
from nonebot.internal.driver import WebSocketClientMixin as WebSocketClientMixin
from nonebot.internal.driver import WebSocketServerSetup as WebSocketServerSetup
from nonebot.internal.driver import combine_driver as combine_driver
__autodoc__ = {
"URL": True,

View File

@@ -11,24 +11,33 @@ pip install nonebot2[aiohttp]
:::
FrontMatter:
mdx:
format: md
sidebar_position: 2
description: nonebot.drivers.aiohttp 模块
"""
from typing_extensions import override
from collections.abc import AsyncGenerator
from contextlib import asynccontextmanager
from typing import TYPE_CHECKING, AsyncGenerator
from typing import TYPE_CHECKING, Optional, Union
from typing_extensions import override
from multidict import CIMultiDict
from nonebot.drivers import Request, Response
from nonebot.exception import WebSocketClosed
from nonebot.drivers.none import Driver as NoneDriver
from nonebot.drivers import WebSocket as BaseWebSocket
from nonebot.drivers import (
HTTPVersion,
URL,
HTTPClientMixin,
HTTPClientSession,
HTTPVersion,
Request,
Response,
WebSocketClientMixin,
combine_driver,
)
from nonebot.drivers import WebSocket as BaseWebSocket
from nonebot.drivers.none import Driver as NoneDriver
from nonebot.exception import WebSocketClosed
from nonebot.internal.driver import Cookies, CookieTypes, HeaderTypes, QueryTypes
try:
import aiohttp
@@ -39,6 +48,105 @@ except ModuleNotFoundError as e: # pragma: no cover
) from e
class Session(HTTPClientSession):
@override
def __init__(
self,
params: QueryTypes = None,
headers: HeaderTypes = None,
cookies: CookieTypes = None,
version: Union[str, HTTPVersion] = HTTPVersion.H11,
timeout: Optional[float] = None,
proxy: Optional[str] = None,
):
self._client: Optional[aiohttp.ClientSession] = None
self._params = URL.build(query=params).query if params is not None else None
self._headers = CIMultiDict(headers) if headers is not None else None
self._cookies = tuple(
(cookie.name, cookie.value)
for cookie in Cookies(cookies)
if cookie.value is not None
)
version = HTTPVersion(version)
if version == HTTPVersion.H10:
self._version = aiohttp.HttpVersion10
elif version == HTTPVersion.H11:
self._version = aiohttp.HttpVersion11
else:
raise RuntimeError(f"Unsupported HTTP version: {version}")
self._timeout = timeout
self._proxy = proxy
@property
def client(self) -> aiohttp.ClientSession:
if self._client is None:
raise RuntimeError("Session is not initialized")
return self._client
@override
async def request(self, setup: Request) -> Response:
if self._params:
url = setup.url.with_query({**self._params, **setup.url.query})
else:
url = setup.url
data = setup.data
if setup.files:
data = aiohttp.FormData(data or {}, quote_fields=False)
for name, file in setup.files:
data.add_field(name, file[1], content_type=file[2], filename=file[0])
cookies = (
(cookie.name, cookie.value)
for cookie in setup.cookies
if cookie.value is not None
)
timeout = aiohttp.ClientTimeout(setup.timeout)
async with await self.client.request(
setup.method,
url,
data=setup.content or data,
json=setup.json,
cookies=cookies,
headers=setup.headers,
proxy=setup.proxy or self._proxy,
timeout=timeout,
) as response:
return Response(
response.status,
headers=response.headers.copy(),
content=await response.read(),
request=setup,
)
@override
async def setup(self) -> None:
if self._client is not None:
raise RuntimeError("Session has already been initialized")
self._client = aiohttp.ClientSession(
cookies=self._cookies,
headers=self._headers,
version=self._version,
timeout=self._timeout,
trust_env=True,
)
await self._client.__aenter__()
@override
async def close(self) -> None:
try:
if self._client is not None:
await self._client.close()
finally:
self._client = None
class Mixin(HTTPClientMixin, WebSocketClientMixin):
"""AIOHTTP Mixin"""
@@ -49,42 +157,8 @@ class Mixin(HTTPClientMixin, WebSocketClientMixin):
@override
async def request(self, setup: Request) -> Response:
if setup.version == HTTPVersion.H10:
version = aiohttp.HttpVersion10
elif setup.version == HTTPVersion.H11:
version = aiohttp.HttpVersion11
else:
raise RuntimeError(f"Unsupported HTTP version: {setup.version}")
timeout = aiohttp.ClientTimeout(setup.timeout)
data = setup.data
if setup.files:
data = aiohttp.FormData(data or {})
for name, file in setup.files:
data.add_field(name, file[1], content_type=file[2], filename=file[0])
cookies = {
cookie.name: cookie.value for cookie in setup.cookies if cookie.value
}
async with aiohttp.ClientSession(
cookies=cookies, version=version, trust_env=True
) as session:
async with session.request(
setup.method,
setup.url,
data=setup.content or data,
json=setup.json,
headers=setup.headers,
timeout=timeout,
proxy=setup.proxy,
) as response:
return Response(
response.status,
headers=response.headers.copy(),
content=await response.read(),
request=setup,
)
async with self.get_session() as session:
return await session.request(setup)
@override
@asynccontextmanager
@@ -96,16 +170,37 @@ class Mixin(HTTPClientMixin, WebSocketClientMixin):
else:
raise RuntimeError(f"Unsupported HTTP version: {setup.version}")
timeout = aiohttp.ClientWSTimeout(ws_close=setup.timeout or 10.0) # type: ignore
async with aiohttp.ClientSession(version=version, trust_env=True) as session:
async with session.ws_connect(
setup.url,
method=setup.method,
timeout=setup.timeout or 10,
timeout=timeout,
headers=setup.headers,
proxy=setup.proxy,
) as ws:
yield WebSocket(request=setup, session=session, websocket=ws)
@override
def get_session(
self,
params: QueryTypes = None,
headers: HeaderTypes = None,
cookies: CookieTypes = None,
version: Union[str, HTTPVersion] = HTTPVersion.H11,
timeout: Optional[float] = None,
proxy: Optional[str] = None,
) -> Session:
return Session(
params=params,
headers=headers,
cookies=cookies,
version=version,
timeout=timeout,
proxy=proxy,
)
class WebSocket(BaseWebSocket):
"""AIOHTTP Websocket Wrapper"""
@@ -131,8 +226,8 @@ class WebSocket(BaseWebSocket):
raise NotImplementedError
@override
async def close(self, code: int = 1000):
await self.websocket.close(code=code)
async def close(self, code: int = 1000, reason: str = ""):
await self.websocket.close(code=code, message=reason.encode("utf-8"))
await self.session.close()
async def _receive(self) -> aiohttp.WSMessage:

View File

@@ -11,34 +11,35 @@ pip install nonebot2[fastapi]
:::
FrontMatter:
mdx:
format: md
sidebar_position: 1
description: nonebot.drivers.fastapi 模块
"""
import logging
import contextlib
from functools import wraps
import logging
from typing import Any, Optional, Union
from typing_extensions import override
from typing import Any, Dict, List, Tuple, Union, Optional
from pydantic import BaseModel
from nonebot.config import Env
from nonebot.drivers import ASGIMixin
from nonebot.exception import WebSocketClosed
from nonebot.internal.driver import FileTypes
from nonebot.drivers import Driver as BaseDriver
from nonebot.compat import model_dump, type_validate_python
from nonebot.config import Config as NoneBotConfig
from nonebot.config import Env
from nonebot.drivers import ASGIMixin, HTTPServerSetup, WebSocketServerSetup
from nonebot.drivers import Driver as BaseDriver
from nonebot.drivers import Request as BaseRequest
from nonebot.drivers import WebSocket as BaseWebSocket
from nonebot.compat import model_dump, type_validate_python
from nonebot.drivers import HTTPServerSetup, WebSocketServerSetup
from nonebot.exception import WebSocketClosed
from nonebot.internal.driver import FileTypes
try:
import uvicorn
from fastapi.responses import Response
from fastapi import FastAPI, Request, UploadFile, status
from starlette.websockets import WebSocket, WebSocketState, WebSocketDisconnect
from fastapi.responses import Response
from starlette.websockets import WebSocket, WebSocketDisconnect, WebSocketState
import uvicorn
except ModuleNotFoundError as e: # pragma: no cover
raise ImportError(
"Please install FastAPI first to use this driver. "
@@ -72,15 +73,15 @@ class Config(BaseModel):
"""是否包含适配器路由的 schema默认为 `True`"""
fastapi_reload: bool = False
"""开启/关闭冷重载"""
fastapi_reload_dirs: Optional[List[str]] = None
fastapi_reload_dirs: Optional[list[str]] = None
"""重载监控文件夹列表,默认为 uvicorn 默认值"""
fastapi_reload_delay: float = 0.25
"""重载延迟,默认为 uvicorn 默认值"""
fastapi_reload_includes: Optional[List[str]] = None
fastapi_reload_includes: Optional[list[str]] = None
"""要监听的文件列表,支持 glob pattern默认为 uvicorn 默认值"""
fastapi_reload_excludes: Optional[List[str]] = None
fastapi_reload_excludes: Optional[list[str]] = None
"""不要监听的文件列表,支持 glob pattern默认为 uvicorn 默认值"""
fastapi_extra: Dict[str, Any] = {}
fastapi_extra: dict[str, Any] = {}
"""传递给 `FastAPI` 的其他参数。"""
@@ -161,7 +162,7 @@ class Driver(BaseDriver, ASGIMixin):
self,
host: Optional[str] = None,
port: Optional[int] = None,
*,
*args,
app: Optional[str] = None,
**kwargs,
):
@@ -206,7 +207,7 @@ class Driver(BaseDriver, ASGIMixin):
json = await request.json()
data: Optional[dict] = None
files: Optional[List[Tuple[str, FileTypes]]] = None
files: Optional[list[tuple[str, FileTypes]]] = None
with contextlib.suppress(Exception):
form = await request.form()
data = {}

View File

@@ -11,21 +11,28 @@ pip install nonebot2[httpx]
:::
FrontMatter:
mdx:
format: md
sidebar_position: 3
description: nonebot.drivers.httpx 模块
"""
from typing import TYPE_CHECKING
from typing import TYPE_CHECKING, Optional, Union
from typing_extensions import override
from nonebot.drivers.none import Driver as NoneDriver
from multidict import CIMultiDict
from nonebot.drivers import (
URL,
HTTPClientMixin,
HTTPClientSession,
HTTPVersion,
Request,
Response,
HTTPVersion,
HTTPClientMixin,
combine_driver,
)
from nonebot.drivers.none import Driver as NoneDriver
from nonebot.internal.driver import Cookies, CookieTypes, HeaderTypes, QueryTypes
try:
import httpx
@@ -36,6 +43,81 @@ except ModuleNotFoundError as e: # pragma: no cover
) from e
class Session(HTTPClientSession):
@override
def __init__(
self,
params: QueryTypes = None,
headers: HeaderTypes = None,
cookies: CookieTypes = None,
version: Union[str, HTTPVersion] = HTTPVersion.H11,
timeout: Optional[float] = None,
proxy: Optional[str] = None,
):
self._client: Optional[httpx.AsyncClient] = None
self._params = (
tuple(URL.build(query=params).query.items()) if params is not None else None
)
self._headers = (
tuple(CIMultiDict(headers).items()) if headers is not None else None
)
self._cookies = Cookies(cookies)
self._version = HTTPVersion(version)
self._timeout = timeout
self._proxy = proxy
@property
def client(self) -> httpx.AsyncClient:
if self._client is None:
raise RuntimeError("Session is not initialized")
return self._client
@override
async def request(self, setup: Request) -> Response:
response = await self.client.request(
setup.method,
str(setup.url),
content=setup.content,
data=setup.data,
files=setup.files,
json=setup.json,
# ensure the params priority
params=setup.url.raw_query_string,
headers=tuple(setup.headers.items()),
cookies=setup.cookies.jar,
timeout=setup.timeout,
)
return Response(
response.status_code,
headers=response.headers.multi_items(),
content=response.content,
request=setup,
)
@override
async def setup(self) -> None:
if self._client is not None:
raise RuntimeError("Session has already been initialized")
self._client = httpx.AsyncClient(
params=self._params,
headers=self._headers,
cookies=self._cookies.jar,
http2=self._version == HTTPVersion.H2,
proxy=self._proxy,
follow_redirects=True,
)
await self._client.__aenter__()
@override
async def close(self) -> None:
try:
if self._client is not None:
await self._client.aclose()
finally:
self._client = None
class Mixin(HTTPClientMixin):
"""HTTPX Mixin"""
@@ -46,27 +128,28 @@ class Mixin(HTTPClientMixin):
@override
async def request(self, setup: Request) -> Response:
async with httpx.AsyncClient(
cookies=setup.cookies.jar,
http2=setup.version == HTTPVersion.H2,
proxies=setup.proxy,
follow_redirects=True,
) as client:
response = await client.request(
setup.method,
str(setup.url),
content=setup.content,
data=setup.data,
json=setup.json,
files=setup.files,
headers=tuple(setup.headers.items()),
timeout=setup.timeout,
)
return Response(
response.status_code,
headers=response.headers.multi_items(),
content=response.content,
request=setup,
async with self.get_session(
version=setup.version, proxy=setup.proxy
) as session:
return await session.request(setup)
@override
def get_session(
self,
params: QueryTypes = None,
headers: HeaderTypes = None,
cookies: CookieTypes = None,
version: Union[str, HTTPVersion] = HTTPVersion.H11,
timeout: Optional[float] = None,
proxy: Optional[str] = None,
) -> Session:
return Session(
params=params,
headers=headers,
cookies=cookies,
version=version,
timeout=timeout,
proxy=proxy,
)

View File

@@ -5,19 +5,25 @@
:::
FrontMatter:
mdx:
format: md
sidebar_position: 6
description: nonebot.drivers.none 模块
"""
import signal
import asyncio
import threading
from typing import Optional
from typing_extensions import override
from nonebot.log import logger
import anyio
from anyio.abc import TaskGroup
from exceptiongroup import BaseExceptionGroup, catch
from nonebot.config import Config, Env
from nonebot.consts import WINDOWS
from nonebot.config import Env, Config
from nonebot.drivers import Driver as BaseDriver
from nonebot.log import logger
from nonebot.utils import flatten_exception_group
HANDLED_SIGNALS = (
signal.SIGINT, # Unix signal 2. Sent by Ctrl+C.
@@ -33,8 +39,8 @@ class Driver(BaseDriver):
def __init__(self, env: Env, config: Config):
super().__init__(env, config)
self.should_exit: asyncio.Event = asyncio.Event()
self.force_exit: bool = False
self.should_exit: anyio.Event = anyio.Event()
self.force_exit: anyio.Event = anyio.Event()
@property
@override
@@ -52,83 +58,98 @@ class Driver(BaseDriver):
def run(self, *args, **kwargs):
"""启动 none driver"""
super().run(*args, **kwargs)
loop = asyncio.get_event_loop()
loop.run_until_complete(self._serve())
anyio.run(self._serve)
async def _serve(self):
self._install_signal_handlers()
await self._startup()
if self.should_exit.is_set():
return
await self._main_loop()
await self._shutdown()
async with anyio.create_task_group() as driver_tg:
driver_tg.start_soon(self._handle_signals)
driver_tg.start_soon(self._listen_force_exit, driver_tg)
driver_tg.start_soon(self._handle_lifespan, driver_tg)
async def _startup(self):
async def _handle_signals(self):
try:
await self._lifespan.startup()
except Exception as e:
logger.opt(colors=True, exception=e).error(
"<r><bg #f8bbd0>Error when running startup function. "
"Ignored!</bg #f8bbd0></r>"
)
logger.info("Application startup completed.")
async def _main_loop(self):
await self.should_exit.wait()
async def _shutdown(self):
logger.info("Shutting down")
logger.info("Waiting for application shutdown.")
try:
await self._lifespan.shutdown()
except Exception as e:
logger.opt(colors=True, exception=e).error(
"<r><bg #f8bbd0>Error when running shutdown function. "
"Ignored!</bg #f8bbd0></r>"
)
for task in asyncio.all_tasks():
if task is not asyncio.current_task() and not task.done():
task.cancel()
await asyncio.sleep(0.1)
tasks = [t for t in asyncio.all_tasks() if t is not asyncio.current_task()]
if tasks and not self.force_exit:
logger.info("Waiting for tasks to finish. (CTRL+C to force quit)")
while tasks and not self.force_exit:
await asyncio.sleep(0.1)
tasks = [t for t in asyncio.all_tasks() if t is not asyncio.current_task()]
for task in tasks:
task.cancel()
await asyncio.gather(*tasks, return_exceptions=True)
logger.info("Application shutdown complete.")
loop = asyncio.get_event_loop()
loop.stop()
def _install_signal_handlers(self) -> None:
if threading.current_thread() is not threading.main_thread():
# Signals can only be listened to from the main thread.
return
loop = asyncio.get_event_loop()
try:
for sig in HANDLED_SIGNALS:
loop.add_signal_handler(sig, self._handle_exit, sig, None)
with anyio.open_signal_receiver(*HANDLED_SIGNALS) as signal_receiver:
async for sig in signal_receiver:
self.exit(force=self.should_exit.is_set())
except NotImplementedError:
# Windows
for sig in HANDLED_SIGNALS:
signal.signal(sig, self._handle_exit)
signal.signal(sig, self._handle_legacy_signal)
def _handle_exit(self, sig, frame):
# backport for Windows signal handling
def _handle_legacy_signal(self, sig, frame):
self.exit(force=self.should_exit.is_set())
async def _handle_lifespan(self, tg: TaskGroup):
try:
await self._startup()
if self.should_exit.is_set():
return
await self._listen_exit()
await self._shutdown()
finally:
tg.cancel_scope.cancel()
async def _startup(self):
def handle_exception(exc_group: BaseExceptionGroup[Exception]) -> None:
self.should_exit.set()
for exc in flatten_exception_group(exc_group):
logger.opt(colors=True, exception=exc).error(
"<r><bg #f8bbd0>Error occurred while running startup hook."
"</bg #f8bbd0></r>"
)
logger.error(
"<r><bg #f8bbd0>Application startup failed. "
"Exiting.</bg #f8bbd0></r>"
)
with catch({Exception: handle_exception}):
await self._lifespan.startup()
if not self.should_exit.is_set():
logger.info("Application startup completed.")
async def _listen_exit(self, tg: Optional[TaskGroup] = None):
await self.should_exit.wait()
if tg is not None:
tg.cancel_scope.cancel()
async def _shutdown(self):
logger.info("Shutting down")
logger.info("Waiting for application shutdown. (CTRL+C to force quit)")
error_occurred: bool = False
def handle_exception(exc_group: BaseExceptionGroup[Exception]) -> None:
nonlocal error_occurred
error_occurred = True
for exc in flatten_exception_group(exc_group):
logger.opt(colors=True, exception=exc).error(
"<r><bg #f8bbd0>Error occurred while running shutdown hook."
"</bg #f8bbd0></r>"
)
logger.error(
"<r><bg #f8bbd0>Application shutdown failed. "
"Exiting.</bg #f8bbd0></r>"
)
with catch({Exception: handle_exception}):
await self._lifespan.shutdown()
if not error_occurred:
logger.info("Application shutdown complete.")
async def _listen_force_exit(self, tg: TaskGroup):
await self.force_exit.wait()
tg.cancel_scope.cancel()
def exit(self, force: bool = False):
"""退出 none driver
@@ -138,4 +159,4 @@ class Driver(BaseDriver):
if not self.should_exit.is_set():
self.should_exit.set()
if force:
self.force_exit = True
self.force_exit.set()

View File

@@ -11,36 +11,37 @@ pip install nonebot2[quart]
:::
FrontMatter:
mdx:
format: md
sidebar_position: 5
description: nonebot.drivers.quart 模块
"""
import asyncio
from functools import wraps
from typing import Any, Optional, Union, cast
from typing_extensions import override
from typing import Any, Dict, List, Tuple, Union, Optional, cast
from pydantic import BaseModel
from nonebot.config import Env
from nonebot.drivers import ASGIMixin
from nonebot.exception import WebSocketClosed
from nonebot.internal.driver import FileTypes
from nonebot.drivers import Driver as BaseDriver
from nonebot.compat import model_dump, type_validate_python
from nonebot.config import Config as NoneBotConfig
from nonebot.config import Env
from nonebot.drivers import ASGIMixin, HTTPServerSetup, WebSocketServerSetup
from nonebot.drivers import Driver as BaseDriver
from nonebot.drivers import Request as BaseRequest
from nonebot.drivers import WebSocket as BaseWebSocket
from nonebot.compat import model_dump, type_validate_python
from nonebot.drivers import HTTPServerSetup, WebSocketServerSetup
from nonebot.exception import WebSocketClosed
from nonebot.internal.driver import FileTypes
try:
import uvicorn
from quart import Quart, Request, Response
from quart import Websocket as QuartWebSocket
from quart import request as _request
from quart.ctx import WebsocketContext
from quart.globals import websocket_ctx
from quart import Quart, Request, Response
from quart.datastructures import FileStorage
from quart import Websocket as QuartWebSocket
from quart.globals import websocket_ctx
import uvicorn
except ModuleNotFoundError as e: # pragma: no cover
raise ImportError(
"Please install Quart first to use this driver. "
@@ -64,15 +65,15 @@ class Config(BaseModel):
quart_reload: bool = False
"""开启/关闭冷重载"""
quart_reload_dirs: Optional[List[str]] = None
quart_reload_dirs: Optional[list[str]] = None
"""重载监控文件夹列表,默认为 uvicorn 默认值"""
quart_reload_delay: float = 0.25
"""重载延迟,默认为 uvicorn 默认值"""
quart_reload_includes: Optional[List[str]] = None
quart_reload_includes: Optional[list[str]] = None
"""要监听的文件列表,支持 glob pattern默认为 uvicorn 默认值"""
quart_reload_excludes: Optional[List[str]] = None
quart_reload_excludes: Optional[list[str]] = None
"""不要监听的文件列表,支持 glob pattern默认为 uvicorn 默认值"""
quart_extra: Dict[str, Any] = {}
quart_extra: dict[str, Any] = {}
"""传递给 `Quart` 的其他参数。"""
@@ -142,7 +143,7 @@ class Driver(BaseDriver, ASGIMixin):
self,
host: Optional[str] = None,
port: Optional[int] = None,
*,
*args,
app: Optional[str] = None,
**kwargs,
):
@@ -184,7 +185,7 @@ class Driver(BaseDriver, ASGIMixin):
data = await request.form
files_dict = await request.files
files: List[Tuple[str, FileTypes]] = []
files: list[tuple[str, FileTypes]] = []
key: str
value: FileStorage
for key, value in files_dict.items():

View File

@@ -11,22 +11,24 @@ pip install nonebot2[websockets]
:::
FrontMatter:
mdx:
format: md
sidebar_position: 4
description: nonebot.drivers.websockets 模块
"""
import logging
from functools import wraps
from collections.abc import AsyncGenerator, Coroutine
from contextlib import asynccontextmanager
from functools import wraps
import logging
from typing import TYPE_CHECKING, Any, Callable, TypeVar, Union
from typing_extensions import ParamSpec, override
from typing import TYPE_CHECKING, Union, TypeVar, Callable, Awaitable, AsyncGenerator
from nonebot.drivers import Request
from nonebot.log import LoguruHandler
from nonebot.exception import WebSocketClosed
from nonebot.drivers.none import Driver as NoneDriver
from nonebot.drivers import Request, WebSocketClientMixin, combine_driver
from nonebot.drivers import WebSocket as BaseWebSocket
from nonebot.drivers import WebSocketClientMixin, combine_driver
from nonebot.drivers.none import Driver as NoneDriver
from nonebot.exception import WebSocketClosed
from nonebot.log import LoguruHandler
try:
from websockets.exceptions import ConnectionClosed
@@ -44,7 +46,9 @@ logger = logging.Logger("websockets.client", "INFO")
logger.addHandler(LoguruHandler())
def catch_closed(func: Callable[P, Awaitable[T]]) -> Callable[P, Awaitable[T]]:
def catch_closed(
func: Callable[P, Coroutine[Any, Any, T]],
) -> Callable[P, Coroutine[Any, Any, T]]:
@wraps(func)
async def decorator(*args: P.args, **kwargs: P.kwargs) -> T:
try:
@@ -66,6 +70,8 @@ class Mixin(WebSocketClientMixin):
@override
@asynccontextmanager
async def websocket(self, setup: Request) -> AsyncGenerator["WebSocket", None]:
if setup.proxy is not None:
logger.warning("proxy is not supported by websockets driver")
connection = Connect(
str(setup.url),
extra_headers={**setup.headers, **setup.cookies.as_header(setup)},

View File

@@ -25,6 +25,8 @@ NoneBotException
```
FrontMatter:
mdx:
format: md
sidebar_position: 10
description: nonebot.exception 模块
"""

View File

@@ -1,6 +1,6 @@
from .adapter import Adapter as Adapter
from .bot import Bot as Bot
from .event import Event as Event
from .adapter import Adapter as Adapter
from .message import Message as Message
from .message import MessageSegment as MessageSegment
from .template import MessageTemplate as MessageTemplate

View File

@@ -1,20 +1,21 @@
import abc
from collections.abc import AsyncGenerator
from contextlib import asynccontextmanager
from typing import Any, Dict, AsyncGenerator
from typing import Any
from nonebot.config import Config
from nonebot.internal.driver._lifespan import LIFESPAN_FUNC
from nonebot.internal.driver import (
Driver,
Request,
Response,
ASGIMixin,
WebSocket,
Driver,
HTTPClientMixin,
HTTPServerSetup,
Request,
Response,
WebSocket,
WebSocketClientMixin,
WebSocketServerSetup,
)
from nonebot.internal.driver._lifespan import LIFESPAN_FUNC
from .bot import Bot
@@ -32,7 +33,7 @@ class Adapter(abc.ABC):
def __init__(self, driver: Driver, **kwargs: Any):
self.driver: Driver = driver
"""{ref}`nonebot.drivers.Driver` 实例"""
self.bots: Dict[str, Bot] = {}
self.bots: dict[str, Bot] = {}
"""本协议适配器已建立连接的 {ref}`nonebot.adapters.Bot` 实例"""
def __repr__(self) -> str:

View File

@@ -1,16 +1,19 @@
import abc
import asyncio
from functools import partial
from typing import TYPE_CHECKING, Any, Set, Union, Optional, Protocol
from typing import TYPE_CHECKING, Any, ClassVar, Optional, Protocol, Union
import anyio
from exceptiongroup import BaseExceptionGroup, catch
from nonebot.log import logger
from nonebot.config import Config
from nonebot.exception import MockApiException
from nonebot.log import logger
from nonebot.typing import T_CalledAPIHook, T_CallingAPIHook
from nonebot.utils import flatten_exception_group
if TYPE_CHECKING:
from .event import Event
from .adapter import Adapter
from .event import Event
from .message import Message, MessageSegment
class _ApiCall(Protocol):
@@ -27,9 +30,9 @@ class Bot(abc.ABC):
self_id: 机器人 ID
"""
_calling_api_hook: Set[T_CallingAPIHook] = set()
_calling_api_hook: ClassVar[set[T_CallingAPIHook]] = set()
"""call_api 时执行的函数"""
_called_api_hook: Set[T_CalledAPIHook] = set()
_called_api_hook: ClassVar[set[T_CalledAPIHook]] = set()
"""call_api 后执行的函数"""
def __init__(self, adapter: "Adapter", self_id: str):
@@ -76,48 +79,99 @@ class Bot(abc.ABC):
skip_calling_api: bool = False
exception: Optional[Exception] = None
if coros := [hook(self, api, data) for hook in self._calling_api_hook]:
try:
if self._calling_api_hook:
logger.debug("Running CallingAPI hooks...")
await asyncio.gather(*coros)
except MockApiException as e:
skip_calling_api = True
result = e.result
logger.debug(
f"Calling API {api} is cancelled. Return {result} instead."
def _handle_mock_api_exception(
exc_group: BaseExceptionGroup[MockApiException],
) -> None:
nonlocal skip_calling_api, result
excs = [
exc
for exc in flatten_exception_group(exc_group)
if isinstance(exc, MockApiException)
]
if not excs:
return
elif len(excs) > 1:
logger.warning(
"Multiple hooks want to mock API result. Use the first one."
)
except Exception as e:
logger.opt(colors=True, exception=e).error(
skip_calling_api = True
result = excs[0].result
logger.debug(
f"Calling API {api} is cancelled. Return {result!r} instead."
)
def _handle_exception(exc_group: BaseExceptionGroup[Exception]) -> None:
for exc in flatten_exception_group(exc_group):
logger.opt(colors=True, exception=exc).error(
"<r><bg #f8bbd0>Error when running CallingAPI hook. "
"Running cancelled!</bg #f8bbd0></r>"
)
with catch(
{
MockApiException: _handle_mock_api_exception,
Exception: _handle_exception,
}
):
async with anyio.create_task_group() as tg:
for hook in self._calling_api_hook:
tg.start_soon(hook, self, api, data)
if not skip_calling_api:
try:
result = await self.adapter._call_api(self, api, **data)
except Exception as e:
exception = e
if coros := [
hook(self, exception, api, data, result) for hook in self._called_api_hook
]:
try:
if self._called_api_hook:
logger.debug("Running CalledAPI hooks...")
await asyncio.gather(*coros)
except MockApiException as e:
# mock api result
result = e.result
# ignore exception
def _handle_mock_api_exception(
exc_group: BaseExceptionGroup[MockApiException],
) -> None:
nonlocal result, exception
excs = [
exc
for exc in flatten_exception_group(exc_group)
if isinstance(exc, MockApiException)
]
if not excs:
return
elif len(excs) > 1:
logger.warning(
"Multiple hooks want to mock API result. Use the first one."
)
result = excs[0].result
exception = None
logger.debug(
f"Calling API {api} result is mocked. Return {result} instead."
)
except Exception as e:
logger.opt(colors=True, exception=e).error(
def _handle_exception(exc_group: BaseExceptionGroup[Exception]) -> None:
for exc in flatten_exception_group(exc_group):
logger.opt(colors=True, exception=exc).error(
"<r><bg #f8bbd0>Error when running CalledAPI hook. "
"Running cancelled!</bg #f8bbd0></r>"
)
with catch(
{
MockApiException: _handle_mock_api_exception,
Exception: _handle_exception,
}
):
async with anyio.create_task_group() as tg:
for hook in self._called_api_hook:
tg.start_soon(hook, self, exception, api, data, result)
if exception:
raise exception
return result

View File

@@ -1,10 +1,10 @@
import abc
from typing import Any, Type, TypeVar
from typing import Any, TypeVar
from pydantic import BaseModel
from nonebot.utils import DataclassEncoder
from nonebot.compat import PYDANTIC_V2, ConfigDict
from nonebot.utils import DataclassEncoder
from .message import Message
@@ -20,12 +20,12 @@ class Event(abc.ABC, BaseModel):
class Config(ConfigDict):
extra = "allow" # type: ignore
json_encoders = {Message: DataclassEncoder}
json_encoders = {Message: DataclassEncoder} # noqa: RUF012
if not PYDANTIC_V2: # pragma: pydantic-v1
@classmethod
def validate(cls: Type["E"], value: Any) -> "E":
def validate(cls: type["E"], value: Any) -> "E":
if isinstance(value, Event) and not isinstance(value, cls):
raise TypeError(f"{value} is incompatible with Event type {cls}")
return super().validate(value)

View File

@@ -1,21 +1,18 @@
import abc
from collections.abc import Iterable
from copy import deepcopy
from typing_extensions import Self
from dataclasses import field, asdict, dataclass
from typing import (
from dataclasses import asdict, dataclass, field
from typing import ( # noqa: UP035
Any,
Dict,
List,
Type,
Tuple,
Union,
Generic,
TypeVar,
Iterable,
Optional,
SupportsIndex,
Type,
TypeVar,
Union,
overload,
)
from typing_extensions import Self
from nonebot.compat import custom_validation, type_validate_python
@@ -32,12 +29,12 @@ class MessageSegment(abc.ABC, Generic[TM]):
type: str
"""消息段类型"""
data: Dict[str, Any] = field(default_factory=dict)
data: dict[str, Any] = field(default_factory=dict)
"""消息段数据"""
@classmethod
@abc.abstractmethod
def get_message_class(cls) -> Type[TM]:
def get_message_class(cls) -> Type[TM]: # noqa: UP006
"""获取消息数组类型"""
raise NotImplementedError
@@ -49,7 +46,9 @@ class MessageSegment(abc.ABC, Generic[TM]):
def __len__(self) -> int:
return len(str(self))
def __ne__(self, other: Self) -> bool:
def __ne__( # pyright: ignore[reportIncompatibleMethodOverride]
self, other: Self
) -> bool:
return not self == other
def __add__(self: TMS, other: Union[str, TMS, Iterable[TMS]]) -> TM:
@@ -101,7 +100,7 @@ class MessageSegment(abc.ABC, Generic[TM]):
@custom_validation
class Message(List[TMS], abc.ABC):
class Message(list[TMS], abc.ABC):
"""消息序列
参数:
@@ -142,7 +141,7 @@ class Message(List[TMS], abc.ABC):
@classmethod
@abc.abstractmethod
def get_segment_class(cls) -> Type[TMS]:
def get_segment_class(cls) -> type[TMS]:
"""获取消息段类型"""
raise NotImplementedError
@@ -177,7 +176,9 @@ class Message(List[TMS], abc.ABC):
"""构造消息数组"""
raise NotImplementedError
def __add__(self, other: Union[str, TMS, Iterable[TMS]]) -> Self:
def __add__( # pyright: ignore[reportIncompatibleMethodOverride]
self, other: Union[str, TMS, Iterable[TMS]]
) -> Self:
result = self.copy()
result += other
return result
@@ -209,7 +210,7 @@ class Message(List[TMS], abc.ABC):
"""
@overload
def __getitem__(self, args: Tuple[str, int]) -> TMS:
def __getitem__(self, args: tuple[str, int]) -> TMS:
"""索引指定类型的消息段
参数:
@@ -220,7 +221,7 @@ class Message(List[TMS], abc.ABC):
"""
@overload
def __getitem__(self, args: Tuple[str, slice]) -> Self:
def __getitem__(self, args: tuple[str, slice]) -> Self:
"""切片指定类型的消息段
参数:
@@ -252,12 +253,12 @@ class Message(List[TMS], abc.ABC):
消息切片 `args`
"""
def __getitem__(
def __getitem__( # pyright: ignore[reportIncompatibleMethodOverride]
self,
args: Union[
str,
Tuple[str, int],
Tuple[str, slice],
tuple[str, int],
tuple[str, slice],
int,
slice,
],
@@ -276,7 +277,9 @@ class Message(List[TMS], abc.ABC):
else:
raise ValueError("Incorrect arguments to slice") # pragma: no cover
def __contains__(self, value: Union[TMS, str]) -> bool:
def __contains__( # pyright: ignore[reportIncompatibleMethodOverride]
self, value: Union[TMS, str]
) -> bool:
"""检查消息段是否存在
参数:
@@ -326,8 +329,9 @@ class Message(List[TMS], abc.ABC):
return self[type_]
iterator, filtered = (
seg for seg in self if seg.type == type_
), self.__class__()
(seg for seg in self if seg.type == type_),
self.__class__(),
)
for _ in range(count):
seg = next(iterator, None)
if seg is None:
@@ -359,7 +363,9 @@ class Message(List[TMS], abc.ABC):
return all(seg.type == value for seg in self)
return all(seg == value for seg in self)
def append(self, obj: Union[str, TMS]) -> Self:
def append( # pyright: ignore[reportIncompatibleMethodOverride]
self, obj: Union[str, TMS]
) -> Self:
"""添加一个消息段到消息数组末尾。
参数:
@@ -373,7 +379,9 @@ class Message(List[TMS], abc.ABC):
raise ValueError(f"Unexpected type: {type(obj)} {obj}") # pragma: no cover
return self
def extend(self, obj: Union[Self, Iterable[TMS]]) -> Self:
def extend( # pyright: ignore[reportIncompatibleMethodOverride]
self, obj: Union[Self, Iterable[TMS]]
) -> Self:
"""拼接一个消息数组或多个消息段到消息数组末尾。
参数:

View File

@@ -1,33 +1,26 @@
from _string import formatter_field_name_split # type: ignore
from collections.abc import Mapping, Sequence
import functools
from string import Formatter
from typing_extensions import TypeAlias
from typing import (
TYPE_CHECKING,
Any,
Set,
Dict,
List,
Type,
Tuple,
Union,
Generic,
Mapping,
TypeVar,
Callable,
Generic,
Optional,
Sequence,
TypeVar,
Union,
cast,
overload,
)
from _string import formatter_field_name_split # type: ignore
from typing_extensions import TypeAlias
if TYPE_CHECKING:
from .message import Message, MessageSegment
def formatter_field_name_split( # noqa: F811
def formatter_field_name_split(
field_name: str,
) -> Tuple[str, List[Tuple[bool, str]]]: ...
) -> tuple[str, list[tuple[bool, str]]]: ...
TM = TypeVar("TM", bound="Message")
@@ -50,7 +43,7 @@ class MessageTemplate(Formatter, Generic[TF]):
def __init__(
self: "MessageTemplate[str]",
template: str,
factory: Type[str] = str,
factory: type[str] = str,
private_getattr: bool = False,
) -> None: ...
@@ -58,19 +51,19 @@ class MessageTemplate(Formatter, Generic[TF]):
def __init__(
self: "MessageTemplate[TM]",
template: Union[str, TM],
factory: Type[TM],
factory: type[TM],
private_getattr: bool = False,
) -> None: ...
def __init__(
self,
template: Union[str, TM],
factory: Union[Type[str], Type[TM]] = str,
factory: Union[type[str], type[TM]] = str,
private_getattr: bool = False,
) -> None:
self.template: TF = template # type: ignore
self.factory: Type[TF] = factory # type: ignore
self.format_specs: Dict[str, FormatSpecFunc] = {}
self.factory: type[TF] = factory # type: ignore
self.format_specs: dict[str, FormatSpecFunc] = {}
self.private_getattr = private_getattr
def __repr__(self) -> str:
@@ -85,7 +78,9 @@ class MessageTemplate(Formatter, Generic[TF]):
self.format_specs[name] = spec
return spec
def format(self, *args, **kwargs):
def format( # pyright: ignore[reportIncompatibleMethodOverride]
self, *args, **kwargs
) -> TF:
"""根据传入参数和模板生成消息对象"""
return self._format(args, kwargs)
@@ -118,7 +113,7 @@ class MessageTemplate(Formatter, Generic[TF]):
self.check_unused_args(used_args, args, kwargs)
return cast(TF, full_message)
def vformat(
def vformat( # pyright: ignore[reportIncompatibleMethodOverride]
self,
format_string: str,
args: Sequence[Any],
@@ -126,15 +121,15 @@ class MessageTemplate(Formatter, Generic[TF]):
) -> TF:
raise NotImplementedError("`vformat` has merged into `_format`")
def _vformat(
def _vformat( # pyright: ignore[reportIncompatibleMethodOverride]
self,
format_string: str,
args: Sequence[Any],
kwargs: Mapping[str, Any],
used_args: Set[Union[int, str]],
used_args: set[Union[int, str]],
auto_arg_index: int = 0,
) -> Tuple[TF, int]:
results: List[Any] = [self.factory()]
) -> tuple[TF, int]:
results: list[Any] = [self.factory()]
for literal_text, field_name, format_spec, conversion in self.parse(
format_string
@@ -185,7 +180,7 @@ class MessageTemplate(Formatter, Generic[TF]):
def get_field(
self, field_name: str, args: Sequence[Any], kwargs: Mapping[str, Any]
) -> Tuple[Any, Union[int, str]]:
) -> tuple[Any, Union[int, str]]:
first, rest = formatter_field_name_split(field_name)
obj = self.get_value(first, args, kwargs)
@@ -199,7 +194,7 @@ class MessageTemplate(Formatter, Generic[TF]):
def format_field(self, value: Any, format_spec: str) -> Any:
formatter: Optional[FormatSpecFunc] = self.format_specs.get(format_spec)
if formatter is None and not issubclass(self.factory, str):
segment_class: Type["MessageSegment"] = self.factory.get_segment_class()
segment_class: type["MessageSegment"] = self.factory.get_segment_class()
method = getattr(segment_class, format_spec, None)
if callable(method) and not cast(str, method.__name__).startswith("_"):
formatter = getattr(segment_class, format_spec)

View File

@@ -1,30 +1,31 @@
from .model import URL as URL
from .model import RawURL as RawURL
from .abstract import Mixin as Mixin
from .model import Cookies as Cookies
from .model import Request as Request
from .abstract import Driver as Driver
from .model import FileType as FileType
from .model import Response as Response
from .model import DataTypes as DataTypes
from .model import FileTypes as FileTypes
from .model import WebSocket as WebSocket
from .model import FilesTypes as FilesTypes
from .model import QueryTypes as QueryTypes
from .abstract import ASGIMixin as ASGIMixin
from .model import CookieTypes as CookieTypes
from .model import FileContent as FileContent
from .model import HTTPVersion as HTTPVersion
from .model import HeaderTypes as HeaderTypes
from .model import SimpleQuery as SimpleQuery
from .model import ContentTypes as ContentTypes
from .model import QueryVariable as QueryVariable
from .abstract import ForwardMixin as ForwardMixin
from .abstract import ReverseMixin as ReverseMixin
from .abstract import Driver as Driver
from .abstract import ForwardDriver as ForwardDriver
from .abstract import ReverseDriver as ReverseDriver
from .combine import combine_driver as combine_driver
from .model import HTTPServerSetup as HTTPServerSetup
from .abstract import ForwardMixin as ForwardMixin
from .abstract import HTTPClientMixin as HTTPClientMixin
from .model import WebSocketServerSetup as WebSocketServerSetup
from .abstract import HTTPClientSession as HTTPClientSession
from .abstract import Mixin as Mixin
from .abstract import ReverseDriver as ReverseDriver
from .abstract import ReverseMixin as ReverseMixin
from .abstract import WebSocketClientMixin as WebSocketClientMixin
from .combine import combine_driver as combine_driver
from .model import URL as URL
from .model import ContentTypes as ContentTypes
from .model import Cookies as Cookies
from .model import CookieTypes as CookieTypes
from .model import DataTypes as DataTypes
from .model import FileContent as FileContent
from .model import FilesTypes as FilesTypes
from .model import FileType as FileType
from .model import FileTypes as FileTypes
from .model import HeaderTypes as HeaderTypes
from .model import HTTPServerSetup as HTTPServerSetup
from .model import HTTPVersion as HTTPVersion
from .model import QueryTypes as QueryTypes
from .model import QueryVariable as QueryVariable
from .model import RawURL as RawURL
from .model import Request as Request
from .model import Response as Response
from .model import SimpleQuery as SimpleQuery
from .model import WebSocket as WebSocket
from .model import WebSocketServerSetup as WebSocketServerSetup

View File

@@ -1,7 +1,13 @@
from collections.abc import Awaitable, Iterable
from types import TracebackType
from typing import Any, Callable, Optional, Union, cast
from typing_extensions import TypeAlias
from typing import Any, List, Union, Callable, Awaitable, cast
from nonebot.utils import run_sync, is_coroutine_callable
import anyio
from anyio.abc import TaskGroup
from exceptiongroup import suppress
from nonebot.utils import is_coroutine_callable, run_sync
SYNC_LIFESPAN_FUNC: TypeAlias = Callable[[], Any]
ASYNC_LIFESPAN_FUNC: TypeAlias = Callable[[], Awaitable[Any]]
@@ -10,9 +16,23 @@ LIFESPAN_FUNC: TypeAlias = Union[SYNC_LIFESPAN_FUNC, ASYNC_LIFESPAN_FUNC]
class Lifespan:
def __init__(self) -> None:
self._startup_funcs: List[LIFESPAN_FUNC] = []
self._ready_funcs: List[LIFESPAN_FUNC] = []
self._shutdown_funcs: List[LIFESPAN_FUNC] = []
self._task_group: Optional[TaskGroup] = None
self._startup_funcs: list[LIFESPAN_FUNC] = []
self._ready_funcs: list[LIFESPAN_FUNC] = []
self._shutdown_funcs: list[LIFESPAN_FUNC] = []
@property
def task_group(self) -> TaskGroup:
if self._task_group is None:
raise RuntimeError("Lifespan not started")
return self._task_group
@task_group.setter
def task_group(self, task_group: TaskGroup) -> None:
if self._task_group is not None:
raise RuntimeError("Lifespan already started")
self._task_group = task_group
def on_startup(self, func: LIFESPAN_FUNC) -> LIFESPAN_FUNC:
self._startup_funcs.append(func)
@@ -28,7 +48,7 @@ class Lifespan:
@staticmethod
async def _run_lifespan_func(
funcs: List[LIFESPAN_FUNC],
funcs: Iterable[LIFESPAN_FUNC],
) -> None:
for func in funcs:
if is_coroutine_callable(func):
@@ -37,18 +57,44 @@ class Lifespan:
await run_sync(cast(SYNC_LIFESPAN_FUNC, func))()
async def startup(self) -> None:
# create background task group
self.task_group = anyio.create_task_group()
await self.task_group.__aenter__()
# run startup funcs
if self._startup_funcs:
await self._run_lifespan_func(self._startup_funcs)
# run ready funcs
if self._ready_funcs:
await self._run_lifespan_func(self._ready_funcs)
async def shutdown(self) -> None:
async def shutdown(
self,
*,
exc_type: Optional[type[BaseException]] = None,
exc_val: Optional[BaseException] = None,
exc_tb: Optional[TracebackType] = None,
) -> None:
if self._shutdown_funcs:
await self._run_lifespan_func(self._shutdown_funcs)
# reverse shutdown funcs to ensure stack order
await self._run_lifespan_func(reversed(self._shutdown_funcs))
# shutdown background task group
self.task_group.cancel_scope.cancel()
with suppress(Exception):
await self.task_group.__aexit__(exc_type, exc_val, exc_tb)
self._task_group = None
async def __aenter__(self) -> None:
await self.startup()
async def __aexit__(self, exc_type, exc_val, exc_tb) -> None:
await self.shutdown()
async def __aexit__(
self,
exc_type: Optional[type[BaseException]],
exc_val: Optional[BaseException],
exc_tb: Optional[TracebackType],
) -> None:
await self.shutdown(exc_type=exc_type, exc_val=exc_val, exc_tb=exc_tb)

View File

@@ -1,26 +1,41 @@
import abc
import asyncio
from typing_extensions import TypeAlias
from collections.abc import AsyncGenerator
from contextlib import AsyncExitStack, asynccontextmanager
from typing import TYPE_CHECKING, Any, Set, Dict, Type, AsyncGenerator
from types import TracebackType
from typing import TYPE_CHECKING, Any, ClassVar, Optional, Union
from typing_extensions import Self, TypeAlias
from nonebot.log import logger
from nonebot.config import Env, Config
from anyio import CancelScope, create_task_group
from anyio.abc import TaskGroup
from exceptiongroup import BaseExceptionGroup, catch
from nonebot.config import Config, Env
from nonebot.dependencies import Dependent
from nonebot.exception import SkippedException
from nonebot.utils import escape_tag, run_coro_with_catch
from nonebot.internal.params import BotParam, DependParam, DefaultParam
from nonebot.internal.params import BotParam, DefaultParam, DependParam
from nonebot.log import logger
from nonebot.typing import (
T_DependencyCache,
T_BotConnectionHook,
T_BotDisconnectionHook,
T_DependencyCache,
)
from nonebot.utils import escape_tag, flatten_exception_group, run_coro_with_catch
from ._lifespan import LIFESPAN_FUNC, Lifespan
from .model import Request, Response, WebSocket, HTTPServerSetup, WebSocketServerSetup
from .model import (
CookieTypes,
HeaderTypes,
HTTPServerSetup,
HTTPVersion,
QueryTypes,
Request,
Response,
WebSocket,
WebSocketServerSetup,
)
if TYPE_CHECKING:
from nonebot.internal.adapter import Bot, Adapter
from nonebot.internal.adapter import Adapter, Bot
BOT_HOOK_PARAMS = [DependParam, BotParam, DefaultParam]
@@ -36,11 +51,11 @@ class Driver(abc.ABC):
config: 包含配置信息的 Config 对象
"""
_adapters: Dict[str, "Adapter"] = {}
_adapters: ClassVar[dict[str, "Adapter"]] = {}
"""已注册的适配器列表"""
_bot_connection_hook: Set[Dependent[Any]] = set()
_bot_connection_hook: ClassVar[set[Dependent[Any]]] = set()
"""Bot 连接建立时执行的函数"""
_bot_disconnection_hook: Set[Dependent[Any]] = set()
_bot_disconnection_hook: ClassVar[set[Dependent[Any]]] = set()
"""Bot 连接断开时执行的函数"""
def __init__(self, env: Env, config: Config):
@@ -48,8 +63,7 @@ class Driver(abc.ABC):
"""环境名称"""
self.config: Config = config
"""全局配置对象"""
self._bots: Dict[str, "Bot"] = {}
self._bot_tasks: Set[asyncio.Task] = set()
self._bots: dict[str, "Bot"] = {}
self._lifespan = Lifespan()
def __repr__(self) -> str:
@@ -59,11 +73,15 @@ class Driver(abc.ABC):
)
@property
def bots(self) -> Dict[str, "Bot"]:
def bots(self) -> dict[str, "Bot"]:
"""获取当前所有已连接的 Bot"""
return self._bots
def register_adapter(self, adapter: Type["Adapter"], **kwargs) -> None:
@property
def task_group(self) -> TaskGroup:
return self._lifespan.task_group
def register_adapter(self, adapter: type["Adapter"], **kwargs) -> None:
"""注册一个协议适配器
参数:
@@ -96,12 +114,10 @@ class Driver(abc.ABC):
@abc.abstractmethod
def run(self, *args, **kwargs):
"""启动驱动框架"""
logger.opt(colors=True).debug(
logger.opt(colors=True).success(
f"<g>Loaded adapters: {escape_tag(', '.join(self._adapters))}</g>"
)
self.on_shutdown(self._cleanup)
def on_startup(self, func: LIFESPAN_FUNC) -> LIFESPAN_FUNC:
"""注册一个启动时执行的函数"""
return self._lifespan.on_startup(func)
@@ -142,66 +158,63 @@ class Driver(abc.ABC):
raise RuntimeError(f"Duplicate bot connection with id {bot.self_id}")
self._bots[bot.self_id] = bot
async def _run_hook(bot: "Bot") -> None:
dependency_cache: T_DependencyCache = {}
async with AsyncExitStack() as stack:
if coros := [
run_coro_with_catch(
hook(bot=bot, stack=stack, dependency_cache=dependency_cache),
(SkippedException,),
)
for hook in self._bot_connection_hook
]:
try:
await asyncio.gather(*coros)
except Exception as e:
logger.opt(colors=True, exception=e).error(
if not self._bot_connection_hook:
return
def handle_exception(exc_group: BaseExceptionGroup) -> None:
for exc in flatten_exception_group(exc_group):
logger.opt(colors=True, exception=exc).error(
"<r><bg #f8bbd0>"
"Error when running WebSocketConnection hook. "
"Running cancelled!"
"Error when running WebSocketConnection hook:"
"</bg #f8bbd0></r>"
)
task = asyncio.create_task(_run_hook(bot))
task.add_done_callback(self._bot_tasks.discard)
self._bot_tasks.add(task)
async def _run_hook(bot: "Bot") -> None:
dependency_cache: T_DependencyCache = {}
with CancelScope(shield=True), catch({Exception: handle_exception}):
async with AsyncExitStack() as stack, create_task_group() as tg:
for hook in self._bot_connection_hook:
tg.start_soon(
run_coro_with_catch,
hook(
bot=bot, stack=stack, dependency_cache=dependency_cache
),
(SkippedException,),
)
self.task_group.start_soon(_run_hook, bot)
def _bot_disconnect(self, bot: "Bot") -> None:
"""在连接断开后,调用该函数来注销 bot 对象"""
if bot.self_id in self._bots:
del self._bots[bot.self_id]
async def _run_hook(bot: "Bot") -> None:
dependency_cache: T_DependencyCache = {}
async with AsyncExitStack() as stack:
if coros := [
run_coro_with_catch(
hook(bot=bot, stack=stack, dependency_cache=dependency_cache),
(SkippedException,),
)
for hook in self._bot_disconnection_hook
]:
try:
await asyncio.gather(*coros)
except Exception as e:
logger.opt(colors=True, exception=e).error(
if not self._bot_disconnection_hook:
return
def handle_exception(exc_group: BaseExceptionGroup) -> None:
for exc in flatten_exception_group(exc_group):
logger.opt(colors=True, exception=exc).error(
"<r><bg #f8bbd0>"
"Error when running WebSocketDisConnection hook. "
"Running cancelled!"
"Error when running WebSocketDisConnection hook:"
"</bg #f8bbd0></r>"
)
task = asyncio.create_task(_run_hook(bot))
task.add_done_callback(self._bot_tasks.discard)
self._bot_tasks.add(task)
async def _cleanup(self) -> None:
"""清理驱动器资源"""
if self._bot_tasks:
logger.opt(colors=True).debug(
"<y>Waiting for running bot connection hooks...</y>"
async def _run_hook(bot: "Bot") -> None:
dependency_cache: T_DependencyCache = {}
# shield cancellation to ensure bot disconnect hooks are always run
with CancelScope(shield=True), catch({Exception: handle_exception}):
async with create_task_group() as tg, AsyncExitStack() as stack:
for hook in self._bot_disconnection_hook:
tg.start_soon(
run_coro_with_catch,
hook(
bot=bot, stack=stack, dependency_cache=dependency_cache
),
(SkippedException,),
)
await asyncio.gather(*self._bot_tasks, return_exceptions=True)
self.task_group.start_soon(_run_hook, bot)
class Mixin(abc.ABC):
@@ -222,6 +235,49 @@ class ReverseMixin(Mixin):
"""服务端混入基类。"""
class HTTPClientSession(abc.ABC):
"""HTTP 客户端会话基类。"""
@abc.abstractmethod
def __init__(
self,
params: QueryTypes = None,
headers: HeaderTypes = None,
cookies: CookieTypes = None,
version: Union[str, HTTPVersion] = HTTPVersion.H11,
timeout: Optional[float] = None,
proxy: Optional[str] = None,
):
raise NotImplementedError
@abc.abstractmethod
async def request(self, setup: Request) -> Response:
"""发送一个 HTTP 请求"""
raise NotImplementedError
@abc.abstractmethod
async def setup(self) -> None:
"""初始化会话"""
raise NotImplementedError
@abc.abstractmethod
async def close(self) -> None:
"""关闭会话"""
raise NotImplementedError
async def __aenter__(self) -> Self:
await self.setup()
return self
async def __aexit__(
self,
exc_type: Optional[type[BaseException]],
exc: Optional[BaseException],
tb: Optional[TracebackType],
) -> None:
await self.close()
class HTTPClientMixin(ForwardMixin):
"""HTTP 客户端混入基类。"""
@@ -230,6 +286,19 @@ class HTTPClientMixin(ForwardMixin):
"""发送一个 HTTP 请求"""
raise NotImplementedError
@abc.abstractmethod
def get_session(
self,
params: QueryTypes = None,
headers: HeaderTypes = None,
cookies: CookieTypes = None,
version: Union[str, HTTPVersion] = HTTPVersion.H11,
timeout: Optional[float] = None,
proxy: Optional[str] = None,
) -> HTTPClientSession:
"""获取一个 HTTP 会话"""
raise NotImplementedError
class WebSocketClientMixin(ForwardMixin):
"""WebSocket 客户端混入基类。"""

View File

@@ -1,6 +1,6 @@
from typing import TYPE_CHECKING, Type, Union, TypeVar, overload
from typing import TYPE_CHECKING, TypeVar, Union, overload
from .abstract import Mixin, Driver
from .abstract import Driver, Mixin
D = TypeVar("D", bound="Driver")
@@ -10,16 +10,18 @@ if TYPE_CHECKING:
@overload
def combine_driver(driver: Type[D]) -> Type[D]: ...
def combine_driver(driver: type[D]) -> type[D]: ...
@overload
def combine_driver(driver: Type[D], *mixins: Type[Mixin]) -> Type["CombinedDriver"]: ...
def combine_driver(
driver: type[D], __m: type[Mixin], /, *mixins: type[Mixin]
) -> type["CombinedDriver"]: ...
def combine_driver(
driver: Type[D], *mixins: Type[Mixin]
) -> Union[Type[D], Type["CombinedDriver"]]:
driver: type[D], *mixins: type[Mixin]
) -> Union[type[D], type["CombinedDriver"]]:
"""将一个驱动器和多个混入类合并。"""
# check first
if not issubclass(driver, Driver):
@@ -37,6 +39,4 @@ def combine_driver(
+ "+".join(x.type.__get__(self) for x in mixins) # type: ignore
)
return type(
"CombinedDriver", (*mixins, driver), {"type": property(type_)}
) # type: ignore
return type("CombinedDriver", (*mixins, driver), {"type": property(type_)}) # type: ignore

View File

@@ -1,59 +1,47 @@
import abc
import urllib.request
from enum import Enum
from collections.abc import Awaitable, Iterator, Mapping, MutableMapping
from dataclasses import dataclass
from typing_extensions import TypeAlias
from enum import Enum
from http.cookiejar import Cookie, CookieJar
from typing import (
IO,
Any,
Dict,
List,
Tuple,
Union,
Mapping,
Callable,
Iterator,
Optional,
Awaitable,
MutableMapping,
)
from typing import IO, Any, Callable, Optional, Union
from typing_extensions import TypeAlias
import urllib.request
from yarl import URL as URL
from multidict import CIMultiDict
from yarl import URL as URL
RawURL: TypeAlias = Tuple[bytes, bytes, Optional[int], bytes]
RawURL: TypeAlias = tuple[bytes, bytes, Optional[int], bytes]
SimpleQuery: TypeAlias = Union[str, int, float]
QueryVariable: TypeAlias = Union[SimpleQuery, List[SimpleQuery]]
QueryVariable: TypeAlias = Union[SimpleQuery, list[SimpleQuery]]
QueryTypes: TypeAlias = Union[
None, str, Mapping[str, QueryVariable], List[Tuple[str, QueryVariable]]
None, str, Mapping[str, QueryVariable], list[tuple[str, SimpleQuery]]
]
HeaderTypes: TypeAlias = Union[
None,
CIMultiDict[str],
Dict[str, str],
List[Tuple[str, str]],
dict[str, str],
list[tuple[str, str]],
]
CookieTypes: TypeAlias = Union[
None, "Cookies", CookieJar, Dict[str, str], List[Tuple[str, str]]
None, "Cookies", CookieJar, dict[str, str], list[tuple[str, str]]
]
ContentTypes: TypeAlias = Union[str, bytes, None]
DataTypes: TypeAlias = Union[dict, None]
FileContent: TypeAlias = Union[IO[bytes], bytes]
FileType: TypeAlias = Tuple[Optional[str], FileContent, Optional[str]]
FileType: TypeAlias = tuple[Optional[str], FileContent, Optional[str]]
FileTypes: TypeAlias = Union[
# file (or bytes)
FileContent,
# (filename, file (or bytes))
Tuple[Optional[str], FileContent],
tuple[Optional[str], FileContent],
# (filename, file (or bytes), content_type)
FileType,
]
FilesTypes: TypeAlias = Union[Dict[str, FileTypes], List[Tuple[str, FileTypes]], None]
FilesTypes: TypeAlias = Union[dict[str, FileTypes], list[tuple[str, FileTypes]], None]
class HTTPVersion(Enum):
@@ -119,7 +107,7 @@ class Request:
self.content: ContentTypes = content
self.data: DataTypes = data
self.json: Any = json
self.files: Optional[List[Tuple[str, FileType]]] = None
self.files: Optional[list[tuple[str, FileType]]] = None
if files:
self.files = []
files_ = files.items() if isinstance(files, dict) else files
@@ -257,7 +245,7 @@ class Cookies(MutableMapping):
)
self.jar.set_cookie(cookie)
def get(
def get( # pyright: ignore[reportIncompatibleMethodOverride]
self,
name: str,
default: Optional[str] = None,
@@ -298,12 +286,14 @@ class Cookies(MutableMapping):
def clear(self, domain: Optional[str] = None, path: Optional[str] = None) -> None:
self.jar.clear(domain, path)
def update(self, cookies: CookieTypes = None) -> None:
def update( # pyright: ignore[reportIncompatibleMethodOverride]
self, cookies: CookieTypes = None
) -> None:
cookies = Cookies(cookies)
for cookie in cookies.jar:
self.jar.set_cookie(cookie)
def as_header(self, request: Request) -> Dict[str, str]:
def as_header(self, request: Request) -> dict[str, str]:
urllib_request = self._CookieCompatRequest(request)
self.jar.add_cookie_header(urllib_request)
return urllib_request.added_headers
@@ -341,9 +331,11 @@ class Cookies(MutableMapping):
method=request.method,
)
self.request = request
self.added_headers: Dict[str, str] = {}
self.added_headers: dict[str, str] = {}
def add_unredirected_header(self, key: str, value: str) -> None:
def add_unredirected_header( # pyright: ignore[reportIncompatibleMethodOverride]
self, key: str, value: str
) -> None:
super().add_unredirected_header(key, value)
self.added_headers[key] = value

View File

@@ -1,12 +1,12 @@
from .manager import MatcherManager as MatcherManager
from .provider import MatcherProvider as MatcherProvider
from .provider import DEFAULT_PROVIDER_CLASS as DEFAULT_PROVIDER_CLASS
from .provider import MatcherProvider as MatcherProvider
matchers = MatcherManager()
from .matcher import Matcher as Matcher
from .matcher import current_bot as current_bot
from .matcher import MatcherSource as MatcherSource
from .matcher import current_bot as current_bot
from .matcher import current_event as current_event
from .matcher import current_handler as current_handler
from .matcher import current_matcher as current_matcher

View File

@@ -1,18 +1,5 @@
from typing import (
TYPE_CHECKING,
List,
Type,
Tuple,
Union,
TypeVar,
Iterator,
KeysView,
Optional,
ItemsView,
ValuesView,
MutableMapping,
overload,
)
from collections.abc import ItemsView, Iterator, KeysView, MutableMapping, ValuesView
from typing import TYPE_CHECKING, Optional, TypeVar, Union, overload
from .provider import DEFAULT_PROVIDER_CLASS, MatcherProvider
@@ -22,7 +9,7 @@ if TYPE_CHECKING:
T = TypeVar("T")
class MatcherManager(MutableMapping[int, List[Type["Matcher"]]]):
class MatcherManager(MutableMapping[int, list[type["Matcher"]]]):
"""事件响应器管理器
实现了常用字典操作,用于管理事件响应器。
@@ -43,10 +30,10 @@ class MatcherManager(MutableMapping[int, List[Type["Matcher"]]]):
def __len__(self) -> int:
return len(self.provider)
def __getitem__(self, key: int) -> List[Type["Matcher"]]:
def __getitem__(self, key: int) -> list[type["Matcher"]]:
return self.provider[key]
def __setitem__(self, key: int, value: List[Type["Matcher"]]) -> None:
def __setitem__(self, key: int, value: list[type["Matcher"]]) -> None:
self.provider[key] = value
def __delitem__(self, key: int) -> None:
@@ -58,41 +45,45 @@ class MatcherManager(MutableMapping[int, List[Type["Matcher"]]]):
def keys(self) -> KeysView[int]:
return self.provider.keys()
def values(self) -> ValuesView[List[Type["Matcher"]]]:
def values(self) -> ValuesView[list[type["Matcher"]]]:
return self.provider.values()
def items(self) -> ItemsView[int, List[Type["Matcher"]]]:
def items(self) -> ItemsView[int, list[type["Matcher"]]]:
return self.provider.items()
@overload
def get(self, key: int) -> Optional[List[Type["Matcher"]]]: ...
def get(self, key: int) -> Optional[list[type["Matcher"]]]: ...
@overload
def get(self, key: int, default: T) -> Union[List[Type["Matcher"]], T]: ...
def get(self, key: int, default: T) -> Union[list[type["Matcher"]], T]: ...
def get(
self, key: int, default: Optional[T] = None
) -> Optional[Union[List[Type["Matcher"]], T]]:
) -> Optional[Union[list[type["Matcher"]], T]]:
return self.provider.get(key, default)
def pop(self, key: int) -> List[Type["Matcher"]]:
def pop( # pyright: ignore[reportIncompatibleMethodOverride]
self, key: int
) -> list[type["Matcher"]]:
return self.provider.pop(key)
def popitem(self) -> Tuple[int, List[Type["Matcher"]]]:
def popitem(self) -> tuple[int, list[type["Matcher"]]]:
return self.provider.popitem()
def clear(self) -> None:
self.provider.clear()
def update(self, __m: MutableMapping[int, List[Type["Matcher"]]]) -> None:
self.provider.update(__m)
def update( # pyright: ignore[reportIncompatibleMethodOverride]
self, m: MutableMapping[int, list[type["Matcher"]]], /
) -> None:
self.provider.update(m)
def setdefault(
self, key: int, default: List[Type["Matcher"]]
) -> List[Type["Matcher"]]:
self, key: int, default: list[type["Matcher"]]
) -> list[type["Matcher"]]:
return self.provider.setdefault(key, default)
def set_provider(self, provider_class: Type[MatcherProvider]) -> None:
def set_provider(self, provider_class: type[MatcherProvider]) -> None:
"""设置事件响应器存储器
参数:

View File

@@ -1,34 +1,46 @@
import sys
import inspect
import warnings
from pathlib import Path
from types import ModuleType
from dataclasses import dataclass
from contextvars import ContextVar
from typing_extensions import Self
from datetime import datetime, timedelta
from collections.abc import Iterable
from contextlib import AsyncExitStack, contextmanager
from typing import (
from contextvars import ContextVar
from dataclasses import dataclass
from datetime import datetime, timedelta
import inspect
from pathlib import Path
import sys
from types import ModuleType
from typing import ( # noqa: UP035
TYPE_CHECKING,
Any,
List,
Type,
Tuple,
Union,
TypeVar,
Callable,
ClassVar,
Iterable,
NoReturn,
Optional,
Type,
TypeVar,
Union,
overload,
)
from typing_extensions import Self
import warnings
from nonebot.log import logger
from nonebot.internal.rule import Rule
from nonebot.utils import classproperty
from nonebot.dependencies import Param, Dependent
from nonebot.internal.permission import User, Permission
from exceptiongroup import BaseExceptionGroup, catch
from nonebot.consts import (
ARG_KEY,
LAST_RECEIVE_KEY,
PAUSE_PROMPT_RESULT_KEY,
RECEIVE_KEY,
REJECT_CACHE_TARGET,
REJECT_PROMPT_RESULT_KEY,
REJECT_TARGET,
)
from nonebot.dependencies import Dependent, Param
from nonebot.exception import (
FinishedException,
PausedException,
RejectedException,
SkippedException,
StopPropagation,
)
from nonebot.internal.adapter import (
Bot,
Event,
@@ -36,37 +48,27 @@ from nonebot.internal.adapter import (
MessageSegment,
MessageTemplate,
)
from nonebot.typing import (
T_State,
T_Handler,
T_TypeUpdater,
T_DependencyCache,
T_PermissionUpdater,
)
from nonebot.consts import (
ARG_KEY,
RECEIVE_KEY,
REJECT_TARGET,
LAST_RECEIVE_KEY,
REJECT_CACHE_TARGET,
)
from nonebot.exception import (
PausedException,
StopPropagation,
SkippedException,
FinishedException,
RejectedException,
)
from nonebot.internal.params import (
Depends,
ArgParam,
BotParam,
EventParam,
StateParam,
DependParam,
DefaultParam,
DependParam,
Depends,
EventParam,
MatcherParam,
StateParam,
)
from nonebot.internal.permission import Permission, User
from nonebot.internal.rule import Rule
from nonebot.log import logger
from nonebot.typing import (
T_DependencyCache,
T_Handler,
T_PermissionUpdater,
T_State,
T_TypeUpdater,
)
from nonebot.utils import classproperty, flatten_exception_group
from . import matchers
@@ -78,15 +80,15 @@ T = TypeVar("T")
current_bot: ContextVar[Bot] = ContextVar("current_bot")
current_event: ContextVar[Event] = ContextVar("current_event")
current_matcher: ContextVar["Matcher"] = ContextVar("current_matcher")
current_handler: ContextVar[Dependent] = ContextVar("current_handler")
current_handler: ContextVar[Dependent[Any]] = ContextVar("current_handler")
@dataclass
class MatcherSource:
"""Matcher 源代码上下文信息"""
plugin_name: Optional[str] = None
"""事件响应器所在插件名称"""
plugin_id: Optional[str] = None
"""事件响应器所在插件标识符"""
module_name: Optional[str] = None
"""事件响应器所在插件模块的路径名"""
lineno: Optional[int] = None
@@ -97,8 +99,13 @@ class MatcherSource:
"""事件响应器所在插件"""
from nonebot.plugin import get_plugin
if self.plugin_name is not None:
return get_plugin(self.plugin_name)
if self.plugin_id is not None:
return get_plugin(self.plugin_id)
@property
def plugin_name(self) -> Optional[str]:
"""事件响应器所在插件名"""
return self.plugin and self.plugin.name
@property
def module(self) -> Optional[ModuleType]:
@@ -141,7 +148,7 @@ class Matcher(metaclass=MatcherMeta):
"""事件响应器匹配规则"""
permission: ClassVar[Permission] = Permission()
"""事件响应器触发权限"""
handlers: List[Dependent[Any]] = []
handlers: ClassVar[list[Dependent[Any]]] = []
"""事件响应器拥有的事件处理函数列表"""
priority: ClassVar[int] = 1
"""事件响应器优先级"""
@@ -160,7 +167,7 @@ class Matcher(metaclass=MatcherMeta):
_default_permission_updater: ClassVar[Optional[Dependent[Permission]]] = None
"""事件响应器权限更新函数"""
HANDLER_PARAM_TYPES: ClassVar[Tuple[Type[Param], ...]] = (
HANDLER_PARAM_TYPES: ClassVar[tuple[Type[Param], ...]] = ( # noqa: UP006
DependParam,
BotParam,
EventParam,
@@ -171,7 +178,7 @@ class Matcher(metaclass=MatcherMeta):
)
def __init__(self):
self.handlers = self.handlers.copy()
self.remain_handlers: list[Dependent[Any]] = self.handlers.copy()
self.state = self._default_state.copy()
def __repr__(self) -> str:
@@ -192,7 +199,7 @@ class Matcher(metaclass=MatcherMeta):
type_: str = "",
rule: Optional[Rule] = None,
permission: Optional[Permission] = None,
handlers: Optional[List[Union[T_Handler, Dependent[Any]]]] = None,
handlers: Optional[list[Union[T_Handler, Dependent[Any]]]] = None,
temp: bool = False,
priority: int = 1,
block: bool = False,
@@ -206,7 +213,7 @@ class Matcher(metaclass=MatcherMeta):
default_permission_updater: Optional[
Union[T_PermissionUpdater, Dependent[Permission]]
] = None,
) -> Type[Self]:
) -> Type[Self]: # noqa: UP006
"""
创建一个新的事件响应器,并存储至 `matchers <#matchers>`_
@@ -247,7 +254,7 @@ class Matcher(metaclass=MatcherMeta):
)
source = source or (
MatcherSource(
plugin_name=plugin and plugin.name,
plugin_id=plugin and plugin.id_,
module_name=module and module.__name__,
)
if plugin is not None or module is not None
@@ -330,15 +337,20 @@ class Matcher(metaclass=MatcherMeta):
return cls._source and cls._source.plugin
@classproperty
def module(cls) -> Optional[ModuleType]:
"""事件响应器所在插件模块"""
return cls._source and cls._source.module
def plugin_id(cls) -> Optional[str]:
"""事件响应器所在插件标识符"""
return cls._source and cls._source.plugin_id
@classproperty
def plugin_name(cls) -> Optional[str]:
"""事件响应器所在插件名"""
return cls._source and cls._source.plugin_name
@classproperty
def module(cls) -> Optional[ModuleType]:
"""事件响应器所在插件模块"""
return cls._source and cls._source.module
@classproperty
def module_name(cls) -> Optional[str]:
"""事件响应器所在插件模块路径"""
@@ -457,7 +469,7 @@ class Matcher(metaclass=MatcherMeta):
parameterless: 非参数类型依赖列表
"""
async def _receive(event: Event, matcher: "Matcher") -> Union[None, NoReturn]:
async def _receive(event: Event, matcher: "Matcher") -> None:
matcher.set_target(RECEIVE_KEY.format(id=id))
if matcher.get_target() == RECEIVE_KEY.format(id=id):
matcher.set_receive(id, event)
@@ -550,8 +562,8 @@ class Matcher(metaclass=MatcherMeta):
"""
bot = current_bot.get()
event = current_event.get()
state = current_matcher.get().state
if isinstance(message, MessageTemplate):
state = current_matcher.get().state
_message = message.format(**state)
else:
_message = message
@@ -587,8 +599,15 @@ class Matcher(metaclass=MatcherMeta):
kwargs: {ref}`nonebot.adapters.Bot.send` 的参数,
请参考对应 adapter 的 bot 对象 api
"""
try:
matcher = current_matcher.get()
except Exception:
matcher = None
if prompt is not None:
await cls.send(prompt, **kwargs)
result = await cls.send(prompt, **kwargs)
if matcher is not None:
matcher.state[PAUSE_PROMPT_RESULT_KEY] = result
raise PausedException
@classmethod
@@ -605,8 +624,19 @@ class Matcher(metaclass=MatcherMeta):
kwargs: {ref}`nonebot.adapters.Bot.send` 的参数,
请参考对应 adapter 的 bot 对象 api
"""
try:
matcher = current_matcher.get()
key = matcher.get_target()
except Exception:
matcher = None
key = None
key = REJECT_PROMPT_RESULT_KEY.format(key=key) if key is not None else None
if prompt is not None:
await cls.send(prompt, **kwargs)
result = await cls.send(prompt, **kwargs)
if key is not None and matcher:
matcher.state[key] = result
raise RejectedException
@classmethod
@@ -626,9 +656,12 @@ class Matcher(metaclass=MatcherMeta):
请参考对应 adapter 的 bot 对象 api
"""
matcher = current_matcher.get()
matcher.set_target(ARG_KEY.format(key=key))
arg_key = ARG_KEY.format(key=key)
matcher.set_target(arg_key)
if prompt is not None:
await cls.send(prompt, **kwargs)
result = await cls.send(prompt, **kwargs)
matcher.state[REJECT_PROMPT_RESULT_KEY.format(key=arg_key)] = result
raise RejectedException
@classmethod
@@ -648,9 +681,12 @@ class Matcher(metaclass=MatcherMeta):
请参考对应 adapter 的 bot 对象 api
"""
matcher = current_matcher.get()
matcher.set_target(RECEIVE_KEY.format(id=id))
receive_key = RECEIVE_KEY.format(id=id)
matcher.set_target(receive_key)
if prompt is not None:
await cls.send(prompt, **kwargs)
result = await cls.send(prompt, **kwargs)
matcher.state[REJECT_PROMPT_RESULT_KEY.format(key=receive_key)] = result
raise RejectedException
@classmethod
@@ -775,7 +811,7 @@ class Matcher(metaclass=MatcherMeta):
async def resolve_reject(self):
handler = current_handler.get()
self.handlers.insert(0, handler)
self.remain_handlers.insert(0, handler)
if REJECT_CACHE_TARGET in self.state:
self.state[REJECT_TARGET] = self.state[REJECT_CACHE_TARGET]
@@ -804,16 +840,26 @@ class Matcher(metaclass=MatcherMeta):
f"bot={bot}, event={event!r}, state={state!r}"
)
def _handle_stop_propagation(exc_group: BaseExceptionGroup[StopPropagation]):
self.block = True
with self.ensure_context(bot, event):
try:
with catch({StopPropagation: _handle_stop_propagation}):
# Refresh preprocess state
self.state.update(state)
while self.handlers:
handler = self.handlers.pop(0)
while self.remain_handlers:
handler = self.remain_handlers.pop(0)
current_handler.set(handler)
logger.debug(f"Running handler {handler}")
try:
def _handle_skipped(
exc_group: BaseExceptionGroup[SkippedException],
):
logger.debug(f"Handler {handler} skipped")
with catch({SkippedException: _handle_skipped}):
await handler(
matcher=self,
bot=bot,
@@ -822,10 +868,6 @@ class Matcher(metaclass=MatcherMeta):
stack=stack,
dependency_cache=dependency_cache,
)
except SkippedException:
logger.debug(f"Handler {handler} skipped")
except StopPropagation:
self.block = True
finally:
logger.info(f"{self} running complete")
@@ -838,10 +880,54 @@ class Matcher(metaclass=MatcherMeta):
stack: Optional[AsyncExitStack] = None,
dependency_cache: Optional[T_DependencyCache] = None,
):
try:
exc: Optional[Union[FinishedException, RejectedException, PausedException]] = (
None
)
def _handle_special_exception(
exc_group: BaseExceptionGroup[
Union[FinishedException, RejectedException, PausedException]
],
):
nonlocal exc
excs = list(flatten_exception_group(exc_group))
if len(excs) > 1:
logger.warning(
"Multiple session control exceptions occurred. "
"NoneBot will choose the proper one."
)
finished_exc = next(
(e for e in excs if isinstance(e, FinishedException)),
None,
)
rejected_exc = next(
(e for e in excs if isinstance(e, RejectedException)),
None,
)
paused_exc = next(
(e for e in excs if isinstance(e, PausedException)),
None,
)
exc = finished_exc or rejected_exc or paused_exc
elif isinstance(
excs[0], (FinishedException, RejectedException, PausedException)
):
exc = excs[0]
with catch(
{
(
FinishedException,
RejectedException,
PausedException,
): _handle_special_exception
}
):
await self.simple_run(bot, event, state, stack, dependency_cache)
except RejectedException:
if isinstance(exc, FinishedException):
pass
elif isinstance(exc, RejectedException):
await self.resolve_reject()
type_ = await self.update_type(bot, event, stack, dependency_cache)
permission = await self.update_permission(
@@ -852,7 +938,7 @@ class Matcher(metaclass=MatcherMeta):
type_,
Rule(),
permission,
self.handlers,
self.remain_handlers,
temp=True,
priority=0,
block=True,
@@ -862,7 +948,7 @@ class Matcher(metaclass=MatcherMeta):
default_type_updater=self.__class__._default_type_updater,
default_permission_updater=self.__class__._default_permission_updater,
)
except PausedException:
elif isinstance(exc, PausedException):
type_ = await self.update_type(bot, event, stack, dependency_cache)
permission = await self.update_permission(
bot, event, stack, dependency_cache
@@ -872,7 +958,7 @@ class Matcher(metaclass=MatcherMeta):
type_,
Rule(),
permission,
self.handlers,
self.remain_handlers,
temp=True,
priority=0,
block=True,
@@ -882,5 +968,3 @@ class Matcher(metaclass=MatcherMeta):
default_type_updater=self.__class__._default_type_updater,
default_permission_updater=self.__class__._default_permission_updater,
)
except FinishedException:
pass

View File

@@ -1,12 +1,13 @@
import abc
from collections import defaultdict
from typing import TYPE_CHECKING, List, Type, Mapping, MutableMapping
from collections.abc import Mapping, MutableMapping
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from .matcher import Matcher
class MatcherProvider(abc.ABC, MutableMapping[int, List[Type["Matcher"]]]):
class MatcherProvider(abc.ABC, MutableMapping[int, list[type["Matcher"]]]):
"""事件响应器存储器基类
参数:
@@ -14,12 +15,12 @@ class MatcherProvider(abc.ABC, MutableMapping[int, List[Type["Matcher"]]]):
"""
@abc.abstractmethod
def __init__(self, matchers: Mapping[int, List[Type["Matcher"]]]):
def __init__(self, matchers: Mapping[int, list[type["Matcher"]]]):
raise NotImplementedError
class _DictProvider(defaultdict, MatcherProvider):
def __init__(self, matchers: Mapping[int, List[Type["Matcher"]]]):
def __init__(self, matchers: Mapping[int, list[type["Matcher"]]]):
super().__init__(list, matchers)

View File

@@ -1,38 +1,47 @@
import asyncio
from contextlib import AsyncExitStack, asynccontextmanager, contextmanager
from enum import Enum
import inspect
from contextlib import AsyncExitStack, contextmanager, asynccontextmanager
from typing_extensions import Self, Annotated, get_args, override, get_origin
from typing import (
TYPE_CHECKING,
Annotated,
Any,
Type,
Tuple,
Union,
Literal,
Callable,
Literal,
Optional,
Union,
cast,
)
from typing_extensions import Self, get_args, get_origin, override
import anyio
from exceptiongroup import BaseExceptionGroup, catch
from pydantic.fields import FieldInfo as PydanticFieldInfo
from nonebot.dependencies import Param, Dependent
from nonebot.dependencies.utils import check_field_type
from nonebot.typing import T_State, T_Handler, T_DependencyCache
from nonebot.compat import FieldInfo, ModelField, PydanticUndefined, extract_field_info
from nonebot.consts import ARG_KEY, REJECT_PROMPT_RESULT_KEY
from nonebot.dependencies import Dependent, Param
from nonebot.dependencies.utils import check_field_type
from nonebot.exception import SkippedException
from nonebot.typing import (
_STATE_FLAG,
T_DependencyCache,
T_Handler,
T_State,
origin_is_annotated,
)
from nonebot.utils import (
generic_check_issubclass,
get_name,
run_sync,
is_gen_callable,
run_sync_ctx_manager,
is_async_gen_callable,
is_coroutine_callable,
generic_check_issubclass,
is_gen_callable,
run_sync,
run_sync_ctx_manager,
)
if TYPE_CHECKING:
from nonebot.adapters import Bot, Event, Message
from nonebot.matcher import Matcher
from nonebot.adapters import Bot, Event
class DependsInner:
@@ -88,6 +97,78 @@ def Depends(
return DependsInner(dependency, use_cache=use_cache, validate=validate)
class CacheState(str, Enum):
"""子依赖缓存状态"""
PENDING = "PENDING"
FINISHED = "FINISHED"
class DependencyCache:
"""子依赖结果缓存。
用于缓存子依赖的结果,以避免重复计算。
"""
def __init__(self):
self._state = CacheState.PENDING
self._result: Any = None
self._exception: Optional[BaseException] = None
self._waiter = anyio.Event()
def done(self) -> bool:
return self._state == CacheState.FINISHED
def result(self) -> Any:
"""获取子依赖结果"""
if self._state != CacheState.FINISHED:
raise RuntimeError("Result is not ready")
if self._exception is not None:
raise self._exception
return self._result
def exception(self) -> Optional[BaseException]:
"""获取子依赖异常"""
if self._state != CacheState.FINISHED:
raise RuntimeError("Result is not ready")
return self._exception
def set_result(self, result: Any) -> None:
"""设置子依赖结果"""
if self._state != CacheState.PENDING:
raise RuntimeError(f"Cache state invalid: {self._state}")
self._result = result
self._state = CacheState.FINISHED
self._waiter.set()
def set_exception(self, exception: BaseException) -> None:
"""设置子依赖异常"""
if self._state != CacheState.PENDING:
raise RuntimeError(f"Cache state invalid: {self._state}")
self._exception = exception
self._state = CacheState.FINISHED
self._waiter.set()
async def wait(self):
"""等待子依赖结果"""
await self._waiter.wait()
if self._state != CacheState.FINISHED:
raise RuntimeError("Invalid cache state")
if self._exception is not None:
raise self._exception
return self._result
class DependParam(Param):
"""子依赖注入参数。
@@ -97,7 +178,7 @@ class DependParam(Param):
"""
def __init__(
self, *args, dependent: Dependent, use_cache: bool, **kwargs: Any
self, *args, dependent: Dependent[Any], use_cache: bool, **kwargs: Any
) -> None:
super().__init__(*args, **kwargs)
self.dependent = dependent
@@ -109,7 +190,7 @@ class DependParam(Param):
@classmethod
def _from_field(
cls,
sub_dependent: Dependent,
sub_dependent: Dependent[Any],
use_cache: bool,
validate: Union[bool, PydanticFieldInfo],
) -> Self:
@@ -126,7 +207,7 @@ class DependParam(Param):
@classmethod
@override
def _check_param(
cls, param: inspect.Parameter, allow_types: Tuple[Type[Param], ...]
cls, param: inspect.Parameter, allow_types: tuple[type[Param], ...]
) -> Optional[Self]:
type_annotation, depends_inner = param.annotation, None
# extract type annotation and dependency from Annotated
@@ -166,7 +247,7 @@ class DependParam(Param):
@classmethod
@override
def _check_parameterless(
cls, value: Any, allow_types: Tuple[Type[Param], ...]
cls, value: Any, allow_types: tuple[type[Param], ...]
) -> Optional["Param"]:
if isinstance(value, DependsInner):
assert value.dependency, "Dependency cannot be empty"
@@ -185,21 +266,31 @@ class DependParam(Param):
use_cache: bool = self.use_cache
dependency_cache = {} if dependency_cache is None else dependency_cache
sub_dependent: Dependent = self.dependent
sub_dependent = self.dependent
call = cast(Callable[..., Any], sub_dependent.call)
# solve sub dependency with current cache
exc: Optional[BaseExceptionGroup[SkippedException]] = None
def _handle_skipped(exc_group: BaseExceptionGroup[SkippedException]):
nonlocal exc
exc = exc_group
with catch({SkippedException: _handle_skipped}):
sub_values = await sub_dependent.solve(
stack=stack,
dependency_cache=dependency_cache,
**kwargs,
)
if exc is not None:
raise exc
# run dependency function
task: asyncio.Task[Any]
if use_cache and call in dependency_cache:
return await dependency_cache[call]
elif is_gen_callable(call) or is_async_gen_callable(call):
return await dependency_cache[call].wait()
if is_gen_callable(call) or is_async_gen_callable(call):
assert isinstance(
stack, AsyncExitStack
), "Generator dependency should be called in context"
@@ -207,17 +298,28 @@ class DependParam(Param):
cm = run_sync_ctx_manager(contextmanager(call)(**sub_values))
else:
cm = asynccontextmanager(call)(**sub_values)
task = asyncio.create_task(stack.enter_async_context(cm))
dependency_cache[call] = task
return await task
target = stack.enter_async_context(cm)
elif is_coroutine_callable(call):
task = asyncio.create_task(call(**sub_values))
dependency_cache[call] = task
return await task
target = call(**sub_values)
else:
task = asyncio.create_task(run_sync(call)(**sub_values))
dependency_cache[call] = task
return await task
target = run_sync(call)(**sub_values)
dependency_cache[call] = cache = DependencyCache()
try:
result = await target
except Exception as e:
cache.set_exception(e)
raise
except BaseException as e:
cache.set_exception(e)
# remove cache when base exception occurs
# e.g. CancelledError
dependency_cache.pop(call, None)
raise
else:
cache.set_result(result)
return result
@override
async def _check(self, **kwargs: Any) -> None:
@@ -249,7 +351,7 @@ class BotParam(Param):
@classmethod
@override
def _check_param(
cls, param: inspect.Parameter, allow_types: Tuple[Type[Param], ...]
cls, param: inspect.Parameter, allow_types: tuple[type[Param], ...]
) -> Optional[Self]:
from nonebot.adapters import Bot
@@ -266,11 +368,15 @@ class BotParam(Param):
return cls()
@override
async def _solve(self, bot: "Bot", **kwargs: Any) -> Any:
async def _solve( # pyright: ignore[reportIncompatibleMethodOverride]
self, bot: "Bot", **kwargs: Any
) -> Any:
return bot
@override
async def _check(self, bot: "Bot", **kwargs: Any) -> None:
async def _check( # pyright: ignore[reportIncompatibleMethodOverride]
self, bot: "Bot", **kwargs: Any
) -> None:
if self.checker is not None:
check_field_type(self.checker, bot)
@@ -299,7 +405,7 @@ class EventParam(Param):
@classmethod
@override
def _check_param(
cls, param: inspect.Parameter, allow_types: Tuple[Type[Param], ...]
cls, param: inspect.Parameter, allow_types: tuple[type[Param], ...]
) -> Optional[Self]:
from nonebot.adapters import Event
@@ -316,11 +422,15 @@ class EventParam(Param):
return cls()
@override
async def _solve(self, event: "Event", **kwargs: Any) -> Any:
async def _solve( # pyright: ignore[reportIncompatibleMethodOverride]
self, event: "Event", **kwargs: Any
) -> Any:
return event
@override
async def _check(self, event: "Event", **kwargs: Any) -> Any:
async def _check( # pyright: ignore[reportIncompatibleMethodOverride]
self, event: "Event", **kwargs: Any
) -> Any:
if self.checker is not None:
check_field_type(self.checker, event)
@@ -339,17 +449,21 @@ class StateParam(Param):
@classmethod
@override
def _check_param(
cls, param: inspect.Parameter, allow_types: Tuple[Type[Param], ...]
cls, param: inspect.Parameter, allow_types: tuple[type[Param], ...]
) -> Optional[Self]:
# param type is T_State
if param.annotation is T_State:
if origin_is_annotated(
get_origin(param.annotation)
) and _STATE_FLAG in get_args(param.annotation):
return cls()
# legacy: param is named "state" and has no type annotation
elif param.annotation == param.empty and param.name == "state":
return cls()
@override
async def _solve(self, state: T_State, **kwargs: Any) -> Any:
async def _solve( # pyright: ignore[reportIncompatibleMethodOverride]
self, state: T_State, **kwargs: Any
) -> Any:
return state
@@ -377,7 +491,7 @@ class MatcherParam(Param):
@classmethod
@override
def _check_param(
cls, param: inspect.Parameter, allow_types: Tuple[Type[Param], ...]
cls, param: inspect.Parameter, allow_types: tuple[type[Param], ...]
) -> Optional[Self]:
from nonebot.matcher import Matcher
@@ -394,21 +508,25 @@ class MatcherParam(Param):
return cls()
@override
async def _solve(self, matcher: "Matcher", **kwargs: Any) -> Any:
async def _solve( # pyright: ignore[reportIncompatibleMethodOverride]
self, matcher: "Matcher", **kwargs: Any
) -> Any:
return matcher
@override
async def _check(self, matcher: "Matcher", **kwargs: Any) -> Any:
async def _check( # pyright: ignore[reportIncompatibleMethodOverride]
self, matcher: "Matcher", **kwargs: Any
) -> Any:
if self.checker is not None:
check_field_type(self.checker, matcher)
class ArgInner:
def __init__(
self, key: Optional[str], type: Literal["message", "str", "plaintext"]
self, key: Optional[str], type: Literal["message", "str", "plaintext", "prompt"]
) -> None:
self.key: Optional[str] = key
self.type: Literal["message", "str", "plaintext"] = type
self.type: Literal["message", "str", "plaintext", "prompt"] = type
def __repr__(self) -> str:
return f"ArgInner(key={self.key!r}, type={self.type!r})"
@@ -429,6 +547,11 @@ def ArgPlainText(key: Optional[str] = None) -> str:
return ArgInner(key, "plaintext") # type: ignore
def ArgPromptResult(key: Optional[str] = None) -> Any:
"""`arg` prompt 发送结果"""
return ArgInner(key, "prompt")
class ArgParam(Param):
"""Arg 注入参数
@@ -442,7 +565,7 @@ class ArgParam(Param):
self,
*args,
key: str,
type: Literal["message", "str", "plaintext"],
type: Literal["message", "str", "plaintext", "prompt"],
**kwargs: Any,
) -> None:
super().__init__(*args, **kwargs)
@@ -455,7 +578,7 @@ class ArgParam(Param):
@classmethod
@override
def _check_param(
cls, param: inspect.Parameter, allow_types: Tuple[Type[Param], ...]
cls, param: inspect.Parameter, allow_types: tuple[type[Param], ...]
) -> Optional[Self]:
if isinstance(param.default, ArgInner):
return cls(key=param.default.key or param.name, type=param.default.type)
@@ -464,16 +587,35 @@ class ArgParam(Param):
if isinstance(arg, ArgInner):
return cls(key=arg.key or param.name, type=arg.type)
async def _solve(self, matcher: "Matcher", **kwargs: Any) -> Any:
message = matcher.get_arg(self.key)
if message is None:
return message
async def _solve( # pyright: ignore[reportIncompatibleMethodOverride]
self, matcher: "Matcher", **kwargs: Any
) -> Any:
if self.type == "message":
return message
return self._solve_message(matcher)
elif self.type == "str":
return str(message)
return self._solve_str(matcher)
elif self.type == "plaintext":
return self._solve_plaintext(matcher)
elif self.type == "prompt":
return self._solve_prompt(matcher)
else:
return message.extract_plain_text()
raise ValueError(f"Unknown Arg type: {self.type}")
def _solve_message(self, matcher: "Matcher") -> Optional["Message"]:
return matcher.get_arg(self.key)
def _solve_str(self, matcher: "Matcher") -> Optional[str]:
message = matcher.get_arg(self.key)
return str(message) if message is not None else None
def _solve_plaintext(self, matcher: "Matcher") -> Optional[str]:
message = matcher.get_arg(self.key)
return message.extract_plain_text() if message is not None else None
def _solve_prompt(self, matcher: "Matcher") -> Optional[Any]:
return matcher.state.get(
REJECT_PROMPT_RESULT_KEY.format(key=ARG_KEY.format(key=self.key))
)
class ExceptionParam(Param):
@@ -490,7 +632,7 @@ class ExceptionParam(Param):
@classmethod
@override
def _check_param(
cls, param: inspect.Parameter, allow_types: Tuple[Type[Param], ...]
cls, param: inspect.Parameter, allow_types: tuple[type[Param], ...]
) -> Optional[Self]:
# param type is Exception(s) or subclass(es) of Exception or None
if generic_check_issubclass(param.annotation, Exception):
@@ -518,7 +660,7 @@ class DefaultParam(Param):
@classmethod
@override
def _check_param(
cls, param: inspect.Parameter, allow_types: Tuple[Type[Param], ...]
cls, param: inspect.Parameter, allow_types: tuple[type[Param], ...]
) -> Optional[Self]:
if param.default != param.empty:
return cls(default=param.default)

View File

@@ -1,15 +1,16 @@
import asyncio
from typing_extensions import Self
from contextlib import AsyncExitStack
from typing import Set, Tuple, Union, NoReturn, Optional
from typing import ClassVar, NoReturn, Optional, Union
from typing_extensions import Self
import anyio
from nonebot.dependencies import Dependent
from nonebot.utils import run_coro_with_catch
from nonebot.exception import SkippedException
from nonebot.typing import T_DependencyCache, T_PermissionChecker
from nonebot.utils import run_coro_with_catch
from .adapter import Bot, Event
from .params import BotParam, EventParam, DependParam, DefaultParam
from .params import BotParam, DefaultParam, DependParam, EventParam, Param
class Permission:
@@ -30,7 +31,7 @@ class Permission:
__slots__ = ("checkers",)
HANDLER_PARAM_TYPES = [
HANDLER_PARAM_TYPES: ClassVar[list[type[Param]]] = [
DependParam,
BotParam,
EventParam,
@@ -38,7 +39,7 @@ class Permission:
]
def __init__(self, *checkers: Union[T_PermissionChecker, Dependent[bool]]) -> None:
self.checkers: Set[Dependent[bool]] = {
self.checkers: set[Dependent[bool]] = {
(
checker
if isinstance(checker, Dependent)
@@ -70,22 +71,26 @@ class Permission:
"""
if not self.checkers:
return True
results = await asyncio.gather(
*(
run_coro_with_catch(
result = False
async def _run_checker(checker: Dependent[bool]) -> None:
nonlocal result
# calculate the result first to avoid data racing
is_passed = await run_coro_with_catch(
checker(
bot=bot,
event=event,
stack=stack,
dependency_cache=dependency_cache,
bot=bot, event=event, stack=stack, dependency_cache=dependency_cache
),
(SkippedException,),
False,
)
for checker in self.checkers
),
)
return any(results)
result |= is_passed
async with anyio.create_task_group() as tg:
for checker in self.checkers:
tg.start_soon(_run_checker, checker)
return result
def __and__(self, other: object) -> NoReturn:
raise RuntimeError("And operation between Permissions is not allowed.")
@@ -119,10 +124,10 @@ class User:
perm: 需同时满足的权限
"""
__slots__ = ("users", "perm")
__slots__ = ("perm", "users")
def __init__(
self, users: Tuple[str, ...], perm: Optional[Permission] = None
self, users: tuple[str, ...], perm: Optional[Permission] = None
) -> None:
self.users = users
self.perm = perm
@@ -146,7 +151,7 @@ class User:
@classmethod
def _clean_permission(cls, perm: Permission) -> Optional[Permission]:
if len(perm.checkers) == 1 and isinstance(
user_perm := tuple(perm.checkers)[0].call, cls
user_perm := next(iter(perm.checkers)).call, cls
):
return user_perm.perm
return perm

View File

@@ -1,13 +1,15 @@
import asyncio
from contextlib import AsyncExitStack
from typing import Set, Union, NoReturn, Optional
from typing import ClassVar, NoReturn, Optional, Union
import anyio
from exceptiongroup import BaseExceptionGroup, catch
from nonebot.dependencies import Dependent
from nonebot.exception import SkippedException
from nonebot.typing import T_State, T_RuleChecker, T_DependencyCache
from nonebot.typing import T_DependencyCache, T_RuleChecker, T_State
from .adapter import Bot, Event
from .params import BotParam, EventParam, StateParam, DependParam, DefaultParam
from .params import BotParam, DefaultParam, DependParam, EventParam, Param, StateParam
class Rule:
@@ -28,7 +30,7 @@ class Rule:
__slots__ = ("checkers",)
HANDLER_PARAM_TYPES = [
HANDLER_PARAM_TYPES: ClassVar[list[type[Param]]] = [
DependParam,
BotParam,
EventParam,
@@ -37,7 +39,7 @@ class Rule:
]
def __init__(self, *checkers: Union[T_RuleChecker, Dependent[bool]]) -> None:
self.checkers: Set[Dependent[bool]] = {
self.checkers: set[Dependent[bool]] = {
(
checker
if isinstance(checker, Dependent)
@@ -71,22 +73,33 @@ class Rule:
"""
if not self.checkers:
return True
try:
results = await asyncio.gather(
*(
checker(
result = True
def _handle_skipped_exception(
exc_group: BaseExceptionGroup[SkippedException],
) -> None:
nonlocal result
result = False
async def _run_checker(checker: Dependent[bool]) -> None:
nonlocal result
# calculate the result first to avoid data racing
is_passed = await checker(
bot=bot,
event=event,
state=state,
stack=stack,
dependency_cache=dependency_cache,
)
for checker in self.checkers
)
)
except SkippedException:
return False
return all(results)
result &= is_passed
with catch({SkippedException: _handle_skipped_exception}):
async with anyio.create_task_group() as tg:
for checker in self.checkers:
tg.start_soon(_run_checker, checker)
return result
def __and__(self, other: Optional[Union["Rule", T_RuleChecker]]) -> "Rule":
if other is None:

View File

@@ -8,12 +8,15 @@ NoneBot 使用 [`loguru`][loguru] 来记录日志信息。
[loguru]: https://github.com/Delgan/loguru
FrontMatter:
mdx:
format: md
sidebar_position: 7
description: nonebot.log 模块
"""
import sys
import inspect
import logging
import sys
from typing import TYPE_CHECKING
import loguru
@@ -45,6 +48,7 @@ logger: "Logger" = loguru.logger
# logger.addHandler(default_handler)
# https://loguru.readthedocs.io/en/stable/overview.html#entirely-compatible-with-standard-logging
class LoguruHandler(logging.Handler): # pragma: no cover
"""logging 与 loguru 之间的桥梁,将 logging 的日志转发到 loguru。"""
@@ -54,8 +58,8 @@ class LoguruHandler(logging.Handler): # pragma: no cover
except ValueError:
level = record.levelno
frame, depth = sys._getframe(6), 6
while frame and frame.f_code.co_filename == logging.__file__:
frame, depth = inspect.currentframe(), 0
while frame and (depth == 0 or frame.f_code.co_filename == logging.__file__):
frame = frame.f_back
depth += 1

View File

@@ -1,20 +1,22 @@
"""本模块实现事件响应器的创建与运行,并提供一些快捷方法来帮助用户更好的与机器人进行对话。
FrontMatter:
mdx:
format: md
sidebar_position: 3
description: nonebot.matcher 模块
"""
from nonebot.internal.matcher import DEFAULT_PROVIDER_CLASS as DEFAULT_PROVIDER_CLASS
from nonebot.internal.matcher import Matcher as Matcher
from nonebot.internal.matcher import matchers as matchers
from nonebot.internal.matcher import current_bot as current_bot
from nonebot.internal.matcher import MatcherSource as MatcherSource
from nonebot.internal.matcher import current_event as current_event
from nonebot.internal.matcher import MatcherManager as MatcherManager
from nonebot.internal.matcher import MatcherProvider as MatcherProvider
from nonebot.internal.matcher import MatcherSource as MatcherSource
from nonebot.internal.matcher import current_bot as current_bot
from nonebot.internal.matcher import current_event as current_event
from nonebot.internal.matcher import current_handler as current_handler
from nonebot.internal.matcher import current_matcher as current_matcher
from nonebot.internal.matcher import DEFAULT_PROVIDER_CLASS as DEFAULT_PROVIDER_CLASS
from nonebot.internal.matcher import matchers as matchers
__autodoc__ = {
"Matcher": True,

View File

@@ -3,53 +3,62 @@
NoneBot 内部处理并按优先级分发事件给所有事件响应器,提供了多个插槽以进行事件的预处理等。
FrontMatter:
mdx:
format: md
sidebar_position: 2
description: nonebot.message 模块
"""
import asyncio
import contextlib
from datetime import datetime
from contextlib import AsyncExitStack
from typing import TYPE_CHECKING, Any, Set, Dict, Type, Optional
from datetime import datetime
from typing import TYPE_CHECKING, Any, Callable, Optional
import anyio
from exceptiongroup import BaseExceptionGroup, catch
from nonebot.log import logger
from nonebot.rule import TrieRule
from nonebot.dependencies import Dependent
from nonebot.matcher import Matcher, matchers
from nonebot.utils import escape_tag, run_coro_with_catch
from nonebot.exception import (
NoLogException,
StopPropagation,
IgnoredException,
NoLogException,
SkippedException,
)
from nonebot.typing import (
T_State,
T_DependencyCache,
T_RunPreProcessor,
T_RunPostProcessor,
T_EventPreProcessor,
T_EventPostProcessor,
StopPropagation,
)
from nonebot.internal.params import (
ArgParam,
BotParam,
EventParam,
StateParam,
DependParam,
DefaultParam,
MatcherParam,
DependParam,
EventParam,
ExceptionParam,
MatcherParam,
StateParam,
)
from nonebot.log import logger
from nonebot.matcher import Matcher, matchers
from nonebot.rule import TrieRule
from nonebot.typing import (
T_DependencyCache,
T_EventPostProcessor,
T_EventPreProcessor,
T_RunPostProcessor,
T_RunPreProcessor,
T_State,
)
from nonebot.utils import (
escape_tag,
flatten_exception_group,
run_coro_with_catch,
run_coro_with_shield,
)
if TYPE_CHECKING:
from nonebot.adapters import Bot, Event
_event_preprocessors: Set[Dependent[Any]] = set()
_event_postprocessors: Set[Dependent[Any]] = set()
_run_preprocessors: Set[Dependent[Any]] = set()
_run_postprocessors: Set[Dependent[Any]] = set()
_event_preprocessors: set[Dependent[Any]] = set()
_event_postprocessors: set[Dependent[Any]] = set()
_run_preprocessors: set[Dependent[Any]] = set()
_run_postprocessors: set[Dependent[Any]] = set()
EVENT_PCS_PARAMS = (
DependParam,
@@ -123,6 +132,21 @@ def run_postprocessor(func: T_RunPostProcessor) -> T_RunPostProcessor:
return func
def _handle_ignored_exception(msg: str) -> Callable[[BaseExceptionGroup], None]:
def _handle(exc_group: BaseExceptionGroup[IgnoredException]) -> None:
logger.opt(colors=True).info(msg)
return _handle
def _handle_exception(msg: str) -> Callable[[BaseExceptionGroup], None]:
def _handle(exc_group: BaseExceptionGroup[Exception]) -> None:
for exc in flatten_exception_group(exc_group):
logger.opt(colors=True, exception=exc).error(msg)
return _handle
async def _apply_event_preprocessors(
bot: "Bot",
event: "Event",
@@ -150,10 +174,21 @@ async def _apply_event_preprocessors(
if show_log:
logger.debug("Running PreProcessors...")
try:
await asyncio.gather(
*(
run_coro_with_catch(
with catch(
{
IgnoredException: _handle_ignored_exception(
f"Event {escape_tag(event.get_event_name())} is <b>ignored</b>"
),
Exception: _handle_exception(
"<r><bg #f8bbd0>Error when running EventPreProcessors. "
"Event ignored!</bg #f8bbd0></r>"
),
}
):
async with anyio.create_task_group() as tg:
for proc in _event_preprocessors:
tg.start_soon(
run_coro_with_catch,
proc(
bot=bot,
event=event,
@@ -163,23 +198,11 @@ async def _apply_event_preprocessors(
),
(SkippedException,),
)
for proc in _event_preprocessors
)
)
except IgnoredException:
logger.opt(colors=True).info(
f"Event {escape_tag(event.get_event_name())} is <b>ignored</b>"
)
return False
except Exception as e:
logger.opt(colors=True, exception=e).error(
"<r><bg #f8bbd0>Error when running EventPreProcessors. "
"Event ignored!</bg #f8bbd0></r>"
)
return False
return True
return False
async def _apply_event_postprocessors(
bot: "Bot",
@@ -205,10 +228,17 @@ async def _apply_event_postprocessors(
if show_log:
logger.debug("Running PostProcessors...")
try:
await asyncio.gather(
*(
run_coro_with_catch(
with catch(
{
Exception: _handle_exception(
"<r><bg #f8bbd0>Error when running EventPostProcessors</bg #f8bbd0></r>"
)
}
):
async with anyio.create_task_group() as tg:
for proc in _event_postprocessors:
tg.start_soon(
run_coro_with_catch,
proc(
bot=bot,
event=event,
@@ -218,13 +248,6 @@ async def _apply_event_postprocessors(
),
(SkippedException,),
)
for proc in _event_postprocessors
)
)
except Exception as e:
logger.opt(colors=True, exception=e).error(
"<r><bg #f8bbd0>Error when running EventPostProcessors</bg #f8bbd0></r>"
)
async def _apply_run_preprocessors(
@@ -252,11 +275,24 @@ async def _apply_run_preprocessors(
return True
# ensure matcher function can be correctly called
with matcher.ensure_context(bot, event):
try:
await asyncio.gather(
*(
run_coro_with_catch(
with (
matcher.ensure_context(bot, event),
catch(
{
IgnoredException: _handle_ignored_exception(
f"{matcher} running is <b>cancelled</b>"
),
Exception: _handle_exception(
"<r><bg #f8bbd0>Error when running RunPreProcessors. "
"Running cancelled!</bg #f8bbd0></r>"
),
}
),
):
async with anyio.create_task_group() as tg:
for proc in _run_preprocessors:
tg.start_soon(
run_coro_with_catch,
proc(
matcher=matcher,
bot=bot,
@@ -267,21 +303,11 @@ async def _apply_run_preprocessors(
),
(SkippedException,),
)
for proc in _run_preprocessors
)
)
except IgnoredException:
logger.opt(colors=True).info(f"{matcher} running is <b>cancelled</b>")
return False
except Exception as e:
logger.opt(colors=True, exception=e).error(
"<r><bg #f8bbd0>Error when running RunPreProcessors. "
"Running cancelled!</bg #f8bbd0></r>"
)
return False
return True
return False
async def _apply_run_postprocessors(
bot: "Bot",
@@ -304,11 +330,21 @@ async def _apply_run_postprocessors(
if not _run_postprocessors:
return
with matcher.ensure_context(bot, event):
try:
await asyncio.gather(
*(
run_coro_with_catch(
with (
matcher.ensure_context(bot, event),
catch(
{
Exception: _handle_exception(
"<r><bg #f8bbd0>Error when running RunPostProcessors"
"</bg #f8bbd0></r>"
)
}
),
):
async with anyio.create_task_group() as tg:
for proc in _run_postprocessors:
tg.start_soon(
run_coro_with_catch,
proc(
matcher=matcher,
exception=exception,
@@ -320,17 +356,10 @@ async def _apply_run_postprocessors(
),
(SkippedException,),
)
for proc in _run_postprocessors
)
)
except Exception as e:
logger.opt(colors=True, exception=e).error(
"<r><bg #f8bbd0>Error when running RunPostProcessors</bg #f8bbd0></r>"
)
async def _check_matcher(
Matcher: Type[Matcher],
Matcher: type[Matcher],
bot: "Bot",
event: "Event",
state: T_State,
@@ -381,7 +410,7 @@ async def _check_matcher(
async def _run_matcher(
Matcher: Type[Matcher],
Matcher: type[Matcher],
bot: "Bot",
event: "Event",
state: T_State,
@@ -423,8 +452,9 @@ async def _run_matcher(
exception = None
try:
logger.debug(f"Running {matcher}")
try:
await matcher.run(bot, event, state, stack, dependency_cache)
except Exception as e:
logger.opt(colors=True, exception=e).error(
@@ -446,7 +476,7 @@ async def _run_matcher(
async def check_and_run_matcher(
Matcher: Type[Matcher],
Matcher: type[Matcher],
bot: "Bot",
event: "Event",
state: T_State,
@@ -492,8 +522,7 @@ async def handle_event(bot: "Bot", event: "Event") -> None:
用法:
```python
import asyncio
asyncio.create_task(handle_event(bot, event))
driver.task_group.start_soon(handle_event, bot, event)
```
"""
show_log = True
@@ -505,7 +534,7 @@ async def handle_event(bot: "Bot", event: "Event") -> None:
if show_log:
logger.opt(colors=True).success(log_msg)
state: Dict[Any, Any] = {}
state: dict[Any, Any] = {}
dependency_cache: T_DependencyCache = {}
# create event scope context
@@ -528,6 +557,13 @@ async def handle_event(bot: "Bot", event: "Event") -> None:
)
break_flag = False
def _handle_stop_propagation(exc_group: BaseExceptionGroup) -> None:
nonlocal break_flag
break_flag = True
logger.debug("Stop event propagation")
# iterate through all priority until stop propagation
for priority in sorted(matchers.keys()):
if break_flag:
@@ -536,22 +572,29 @@ async def handle_event(bot: "Bot", event: "Event") -> None:
if show_log:
logger.debug(f"Checking for matchers in priority {priority}...")
pending_tasks = [
check_and_run_matcher(
matcher, bot, event, state.copy(), stack, dependency_cache
)
for matcher in matchers[priority]
]
results = await asyncio.gather(*pending_tasks, return_exceptions=True)
for result in results:
if not isinstance(result, Exception):
if not (priority_matchers := matchers[priority]):
continue
if isinstance(result, StopPropagation):
break_flag = True
logger.debug("Stop event propagation")
else:
logger.opt(colors=True, exception=result).error(
with catch(
{
StopPropagation: _handle_stop_propagation,
Exception: _handle_exception(
"<r><bg #f8bbd0>Error when checking Matcher.</bg #f8bbd0></r>"
),
}
):
async with anyio.create_task_group() as tg:
for matcher in priority_matchers:
tg.start_soon(
run_coro_with_shield,
check_and_run_matcher(
matcher,
bot,
event,
state.copy(),
stack,
dependency_cache,
),
)
if show_log:

View File

@@ -1,53 +1,49 @@
"""本模块定义了依赖注入的各类参数。
FrontMatter:
mdx:
format: md
sidebar_position: 4
description: nonebot.params 模块
"""
from typing import (
Any,
Dict,
List,
Match,
Tuple,
Union,
Literal,
Callable,
Optional,
overload,
)
from re import Match
from typing import Any, Callable, Literal, Optional, Union, overload
from nonebot.typing import T_State
from nonebot.matcher import Matcher
from nonebot.internal.params import Arg as Arg
from nonebot.internal.params import ArgStr as ArgStr
from nonebot.internal.params import Depends as Depends
from nonebot.internal.params import ArgParam as ArgParam
from nonebot.internal.params import BotParam as BotParam
from nonebot.adapters import Event, Message, MessageSegment
from nonebot.internal.params import EventParam as EventParam
from nonebot.internal.params import StateParam as StateParam
from nonebot.internal.params import DependParam as DependParam
from nonebot.internal.params import ArgPlainText as ArgPlainText
from nonebot.internal.params import DefaultParam as DefaultParam
from nonebot.internal.params import MatcherParam as MatcherParam
from nonebot.internal.params import ExceptionParam as ExceptionParam
from nonebot.consts import (
CMD_ARG_KEY,
CMD_KEY,
CMD_START_KEY,
CMD_WHITESPACE_KEY,
ENDSWITH_KEY,
FULLMATCH_KEY,
KEYWORD_KEY,
PAUSE_PROMPT_RESULT_KEY,
PREFIX_KEY,
RAW_CMD_KEY,
RECEIVE_KEY,
REGEX_MATCHED,
REJECT_PROMPT_RESULT_KEY,
SHELL_ARGS,
SHELL_ARGV,
CMD_ARG_KEY,
KEYWORD_KEY,
RAW_CMD_KEY,
ENDSWITH_KEY,
CMD_START_KEY,
FULLMATCH_KEY,
REGEX_MATCHED,
STARTSWITH_KEY,
CMD_WHITESPACE_KEY,
)
from nonebot.internal.params import Arg as Arg
from nonebot.internal.params import ArgParam as ArgParam
from nonebot.internal.params import ArgPlainText as ArgPlainText
from nonebot.internal.params import ArgPromptResult as ArgPromptResult
from nonebot.internal.params import ArgStr as ArgStr
from nonebot.internal.params import BotParam as BotParam
from nonebot.internal.params import DefaultParam as DefaultParam
from nonebot.internal.params import DependParam as DependParam
from nonebot.internal.params import Depends as Depends
from nonebot.internal.params import EventParam as EventParam
from nonebot.internal.params import ExceptionParam as ExceptionParam
from nonebot.internal.params import MatcherParam as MatcherParam
from nonebot.internal.params import StateParam as StateParam
from nonebot.matcher import Matcher
from nonebot.typing import T_State
async def _event_type(event: Event) -> str:
@@ -90,7 +86,7 @@ def _command(state: T_State) -> Message:
return state[PREFIX_KEY][CMD_KEY]
def Command() -> Tuple[str, ...]:
def Command() -> tuple[str, ...]:
"""消息命令元组"""
return Depends(_command)
@@ -140,7 +136,7 @@ def ShellCommandArgs() -> Any:
return Depends(_shell_command_args, use_cache=False)
def _shell_command_argv(state: T_State) -> List[Union[str, MessageSegment]]:
def _shell_command_argv(state: T_State) -> list[Union[str, MessageSegment]]:
return state[SHELL_ARGV]
@@ -159,49 +155,49 @@ def RegexMatched() -> Match[str]:
def _regex_str(
groups: Tuple[Union[str, int], ...]
) -> Callable[[T_State], Union[str, Tuple[Union[str, Any], ...], Any]]:
groups: tuple[Union[str, int], ...],
) -> Callable[[T_State], Union[str, tuple[Union[str, Any], ...], Any]]:
def _regex_str_dependency(
state: T_State,
) -> Union[str, Tuple[Union[str, Any], ...], Any]:
) -> Union[str, tuple[Union[str, Any], ...], Any]:
return _regex_matched(state).group(*groups)
return _regex_str_dependency
@overload
def RegexStr(__group: Literal[0] = 0) -> str: ...
def RegexStr(group: Literal[0] = 0, /) -> str: ...
@overload
def RegexStr(__group: Union[str, int]) -> Union[str, Any]: ...
def RegexStr(group: Union[str, int], /) -> Union[str, Any]: ...
@overload
def RegexStr(
__group1: Union[str, int], __group2: Union[str, int], *groups: Union[str, int]
) -> Tuple[Union[str, Any], ...]: ...
group1: Union[str, int], group2: Union[str, int], /, *groups: Union[str, int]
) -> tuple[Union[str, Any], ...]: ...
def RegexStr(*groups: Union[str, int]) -> Union[str, Tuple[Union[str, Any], ...], Any]:
def RegexStr(*groups: Union[str, int]) -> Union[str, tuple[Union[str, Any], ...], Any]:
"""正则匹配结果文本"""
return Depends(_regex_str(groups), use_cache=False)
def _regex_group(state: T_State) -> Tuple[Any, ...]:
def _regex_group(state: T_State) -> tuple[Any, ...]:
return _regex_matched(state).groups()
def RegexGroup() -> Tuple[Any, ...]:
def RegexGroup() -> tuple[Any, ...]:
"""正则匹配结果 group 元组"""
return Depends(_regex_group, use_cache=False)
def _regex_dict(state: T_State) -> Dict[str, Any]:
def _regex_dict(state: T_State) -> dict[str, Any]:
return _regex_matched(state).groupdict()
def RegexDict() -> Dict[str, Any]:
def RegexDict() -> dict[str, Any]:
"""正则匹配结果 group 字典"""
return Depends(_regex_dict, use_cache=False)
@@ -260,6 +256,26 @@ def LastReceived(default: Any = None) -> Any:
return Depends(_last_received, use_cache=False)
def ReceivePromptResult(id: Optional[str] = None) -> Any:
"""`receive` prompt 发送结果"""
def _receive_prompt_result(matcher: "Matcher") -> Any:
return matcher.state.get(
REJECT_PROMPT_RESULT_KEY.format(key=RECEIVE_KEY.format(id=id))
)
return Depends(_receive_prompt_result, use_cache=False)
def PausePromptResult() -> Any:
"""`pause` prompt 发送结果"""
def _pause_prompt_result(matcher: "Matcher") -> Any:
return matcher.state.get(PAUSE_PROMPT_RESULT_KEY)
return Depends(_pause_prompt_result, use_cache=False)
__autodoc__ = {
"Arg": True,
"ArgStr": True,
@@ -273,4 +289,5 @@ __autodoc__ = {
"DefaultParam": True,
"MatcherParam": True,
"ExceptionParam": True,
"ArgPromptResult": True,
}

View File

@@ -5,15 +5,17 @@
只要有一个 `PermissionChecker` 检查结果为 `True` 时就会继续运行。
FrontMatter:
mdx:
format: md
sidebar_position: 6
description: nonebot.permission 模块
"""
from nonebot.params import EventType
from nonebot.adapters import Bot, Event
from nonebot.internal.permission import USER as USER
from nonebot.internal.permission import User as User
from nonebot.internal.permission import Permission as Permission
from nonebot.internal.permission import User as User
from nonebot.params import EventType
class Message:

View File

@@ -32,14 +32,16 @@
- `PluginMetadata` => {ref}``PluginMetadata` <nonebot.plugin.model.PluginMetadata>`
FrontMatter:
mdx:
format: md
sidebar_position: 0
description: nonebot.plugin 模块
"""
from contextvars import ContextVar
from itertools import chain
from types import ModuleType
from contextvars import ContextVar
from typing import Set, Dict, List, Type, Tuple, TypeVar, Optional
from typing import Optional, TypeVar
from pydantic import BaseModel
@@ -48,10 +50,10 @@ from nonebot.compat import model_dump, type_validate_python
C = TypeVar("C", bound=BaseModel)
_plugins: Dict[str, "Plugin"] = {}
_managers: List["PluginManager"] = []
_current_plugin_chain: ContextVar[Tuple["Plugin", ...]] = ContextVar(
"_current_plugin_chain", default=()
_plugins: dict[str, "Plugin"] = {}
_managers: list["PluginManager"] = []
_current_plugin: ContextVar[Optional["Plugin"]] = ContextVar(
"_current_plugin", default=None
)
@@ -59,34 +61,87 @@ def _module_name_to_plugin_name(module_name: str) -> str:
return module_name.rsplit(".", 1)[-1]
def _controlled_modules() -> dict[str, str]:
return {
plugin_id: module_name
for manager in _managers
for plugin_id, module_name in manager.controlled_modules.items()
}
def _find_parent_plugin_id(
module_name: str, controlled_modules: Optional[dict[str, str]] = None
) -> Optional[str]:
if controlled_modules is None:
controlled_modules = _controlled_modules()
available = {
module_name: plugin_id for plugin_id, module_name in controlled_modules.items()
}
while "." in module_name:
module_name, _ = module_name.rsplit(".", 1)
if module_name in available:
return available[module_name]
def _module_name_to_plugin_id(
module_name: str, controlled_modules: Optional[dict[str, str]] = None
) -> str:
plugin_name = _module_name_to_plugin_name(module_name)
if parent_plugin_id := _find_parent_plugin_id(module_name, controlled_modules):
return f"{parent_plugin_id}:{plugin_name}"
return plugin_name
def _new_plugin(
module_name: str, module: ModuleType, manager: "PluginManager"
) -> "Plugin":
plugin_name = _module_name_to_plugin_name(module_name)
if plugin_name in _plugins:
raise RuntimeError("Plugin already exists! Check your plugin name.")
plugin = Plugin(plugin_name, module, module_name, manager)
_plugins[plugin_name] = plugin
plugin_id = _module_name_to_plugin_id(module_name)
if plugin_id in _plugins:
raise RuntimeError(
f"Plugin {plugin_id} already exists! Check your plugin name."
)
parent_plugin_id = _find_parent_plugin_id(module_name)
if parent_plugin_id is not None and parent_plugin_id not in _plugins:
raise RuntimeError(
f"Parent plugin {parent_plugin_id} must "
f"be loaded before loading {plugin_id}."
)
parent_plugin = _plugins[parent_plugin_id] if parent_plugin_id is not None else None
plugin = Plugin(
name=_module_name_to_plugin_name(module_name),
module=module,
module_name=module_name,
manager=manager,
parent_plugin=parent_plugin,
)
if parent_plugin:
parent_plugin.sub_plugins.add(plugin)
_plugins[plugin_id] = plugin
return plugin
def _revert_plugin(plugin: "Plugin") -> None:
if plugin.name not in _plugins:
if plugin.id_ not in _plugins:
raise RuntimeError("Plugin not found!")
del _plugins[plugin.name]
del _plugins[plugin.id_]
if parent_plugin := plugin.parent_plugin:
parent_plugin.sub_plugins.remove(plugin)
parent_plugin.sub_plugins.discard(plugin)
def get_plugin(name: str) -> Optional["Plugin"]:
def get_plugin(plugin_id: str) -> Optional["Plugin"]:
"""获取已经导入的某个插件。
如果为 `load_plugins` 文件夹导入的插件,则为文件(夹)名。
如果为嵌套的子插件,标识符为 `父插件标识符:子插件文件(夹)名`。
参数:
name: 插件,即 {ref}`nonebot.plugin.model.Plugin.name`。
plugin_id: 插件标识符,即 {ref}`nonebot.plugin.model.Plugin.id_`。
"""
return _plugins.get(name)
return _plugins.get(plugin_id)
def get_plugin_by_module_name(module_name: str) -> Optional["Plugin"]:
@@ -105,45 +160,45 @@ def get_plugin_by_module_name(module_name: str) -> Optional["Plugin"]:
module_name, *has_parent = module_name.rsplit(".", 1)
def get_loaded_plugins() -> Set["Plugin"]:
def get_loaded_plugins() -> set["Plugin"]:
"""获取当前已导入的所有插件。"""
return set(_plugins.values())
def get_available_plugin_names() -> Set[str]:
"""获取当前所有可用的插件(包含尚未加载的插件)。"""
def get_available_plugin_names() -> set[str]:
"""获取当前所有可用的插件标识符(包含尚未加载的插件)。"""
return {*chain.from_iterable(manager.available_plugins for manager in _managers)}
def get_plugin_config(config: Type[C]) -> C:
def get_plugin_config(config: type[C]) -> C:
"""从全局配置获取当前插件需要的配置项。"""
return type_validate_python(config, model_dump(get_driver().config))
from .on import on as on
from .manager import PluginManager
from .on import on_type as on_type
from .model import Plugin as Plugin
from .load import require as require
from .on import on_regex as on_regex
from .on import on_notice as on_notice
from .on import on_command as on_command
from .on import on_keyword as on_keyword
from .on import on_message as on_message
from .on import on_request as on_request
from .on import on_endswith as on_endswith
from .load import load_plugin as load_plugin
from .on import CommandGroup as CommandGroup
from .on import MatcherGroup as MatcherGroup
from .on import on_fullmatch as on_fullmatch
from .on import on_metaevent as on_metaevent
from .load import load_plugins as load_plugins
from .on import on_startswith as on_startswith
from .load import load_from_json as load_from_json
from .load import load_from_toml as load_from_toml
from .model import PluginMetadata as PluginMetadata
from .on import on_shell_command as on_shell_command
from .load import inherit_supported_adapters as inherit_supported_adapters
from .load import load_all_plugins as load_all_plugins
from .load import load_builtin_plugin as load_builtin_plugin
from .load import load_builtin_plugins as load_builtin_plugins
from .load import inherit_supported_adapters as inherit_supported_adapters
from .load import load_from_json as load_from_json
from .load import load_from_toml as load_from_toml
from .load import load_plugin as load_plugin
from .load import load_plugins as load_plugins
from .load import require as require
from .manager import PluginManager
from .model import Plugin as Plugin
from .model import PluginMetadata as PluginMetadata
from .on import CommandGroup as CommandGroup
from .on import MatcherGroup as MatcherGroup
from .on import on as on
from .on import on_command as on_command
from .on import on_endswith as on_endswith
from .on import on_fullmatch as on_fullmatch
from .on import on_keyword as on_keyword
from .on import on_message as on_message
from .on import on_metaevent as on_metaevent
from .on import on_notice as on_notice
from .on import on_regex as on_regex
from .on import on_request as on_request
from .on import on_shell_command as on_shell_command
from .on import on_startswith as on_startswith
from .on import on_type as on_type

View File

@@ -1,25 +1,28 @@
"""本模块定义插件加载接口。
FrontMatter:
mdx:
format: md
sidebar_position: 1
description: nonebot.plugin.load 模块
"""
from collections.abc import Iterable
import json
from pathlib import Path
from types import ModuleType
from typing import Set, Union, Iterable, Optional
from typing import Optional, Union
from nonebot.utils import path_to_module_name
from .model import Plugin
from . import _managers, _module_name_to_plugin_id, get_plugin
from .manager import PluginManager
from . import _managers, get_plugin, _current_plugin_chain, _module_name_to_plugin_name
from .model import Plugin
try: # pragma: py-gte-311
import tomllib # pyright: ignore[reportMissingImports]
except ModuleNotFoundError: # pragma: py-lt-311
import tomli as tomllib
import tomli as tomllib # pyright: ignore[reportMissingImports]
def load_plugin(module_path: Union[str, Path]) -> Optional[Plugin]:
@@ -39,7 +42,7 @@ def load_plugin(module_path: Union[str, Path]) -> Optional[Plugin]:
return manager.load_plugin(module_path)
def load_plugins(*plugin_dir: str) -> Set[Plugin]:
def load_plugins(*plugin_dir: str) -> set[Plugin]:
"""导入文件夹下多个插件,以 `_` 开头的插件不会被导入!
参数:
@@ -52,7 +55,7 @@ def load_plugins(*plugin_dir: str) -> Set[Plugin]:
def load_all_plugins(
module_path: Iterable[str], plugin_dir: Iterable[str]
) -> Set[Plugin]:
) -> set[Plugin]:
"""导入指定列表中的插件以及指定目录下多个插件,以 `_` 开头的插件不会被导入!
参数:
@@ -64,7 +67,7 @@ def load_all_plugins(
return manager.load_all_plugins()
def load_from_json(file_path: str, encoding: str = "utf-8") -> Set[Plugin]:
def load_from_json(file_path: str, encoding: str = "utf-8") -> set[Plugin]:
"""导入指定 json 文件中的 `plugins` 以及 `plugin_dirs` 下多个插件。
以 `_` 开头的插件不会被导入!
@@ -95,7 +98,7 @@ def load_from_json(file_path: str, encoding: str = "utf-8") -> Set[Plugin]:
return load_all_plugins(set(plugins), set(plugin_dirs))
def load_from_toml(file_path: str, encoding: str = "utf-8") -> Set[Plugin]:
def load_from_toml(file_path: str, encoding: str = "utf-8") -> set[Plugin]:
"""导入指定 toml 文件 `[tool.nonebot]` 中的
`plugins` 以及 `plugin_dirs` 下多个插件。
以 `_` 开头的插件不会被导入!
@@ -139,7 +142,7 @@ def load_builtin_plugin(name: str) -> Optional[Plugin]:
return load_plugin(f"nonebot.plugins.{name}")
def load_builtin_plugins(*plugins: str) -> Set[Plugin]:
def load_builtin_plugins(*plugins: str) -> set[Plugin]:
"""导入多个 NoneBot 内置插件。
参数:
@@ -150,41 +153,45 @@ def load_builtin_plugins(*plugins: str) -> Set[Plugin]:
def _find_manager_by_name(name: str) -> Optional[PluginManager]:
for manager in reversed(_managers):
if name in manager.plugins or name in manager.searched_plugins:
if (
name in manager.controlled_modules
or name in manager.controlled_modules.values()
):
return manager
def require(name: str) -> ModuleType:
"""获取一个插件的导出内容
如果为 `load_plugins` 文件夹导入的插件,则为文件(夹)名。
"""声明依赖插件
参数:
name: 插件名,即 {ref}`nonebot.plugin.model.Plugin.name`
name: 插件模块名或插件标识符,仅在已声明插件的情况下可使用标识符
异常:
RuntimeError: 插件无法加载
"""
plugin = get_plugin(_module_name_to_plugin_name(name))
if "." in name:
# name is a module name
plugin = get_plugin(_module_name_to_plugin_id(name))
else:
# name is a plugin id or simple module name (equals to plugin id)
plugin = get_plugin(name)
# if plugin not loaded
if not plugin:
# plugin already declared
if plugin is None:
# plugin already declared, module name / plugin id
if manager := _find_manager_by_name(name):
plugin = manager.load_plugin(name)
# plugin not declared, try to declare and load it
else:
# clear current plugin chain, ensure plugin loaded in a new context
_t = _current_plugin_chain.set(())
try:
plugin = load_plugin(name)
finally:
_current_plugin_chain.reset(_t)
if not plugin:
if plugin is None:
raise RuntimeError(f'Cannot load plugin "{name}"!')
return plugin.module
def inherit_supported_adapters(*names: str) -> Optional[Set[str]]:
def inherit_supported_adapters(*names: str) -> Optional[set[str]]:
"""获取已加载插件的适配器支持状态集合。
如果传入了多个插件名称,返回值会自动取交集。
@@ -196,27 +203,28 @@ def inherit_supported_adapters(*names: str) -> Optional[Set[str]]:
RuntimeError: 插件未加载
ValueError: 插件缺少元数据
"""
final_supported: Optional[Set[str]] = None
final_supported: Optional[set[str]] = None
for name in names:
plugin = get_plugin(_module_name_to_plugin_name(name))
plugin = get_plugin(_module_name_to_plugin_id(name))
if plugin is None:
raise RuntimeError(f'Plugin "{name}" is not loaded!')
raise RuntimeError(
f'Plugin "{name}" is not loaded! You should require it first.'
)
meta = plugin.metadata
if meta is None:
raise ValueError(f'Plugin "{name}" has no metadata!')
support = meta.supported_adapters
if support is None:
if (raw := meta.supported_adapters) is None:
continue
support = {
f"nonebot.adapters.{adapter[1:]}" if adapter.startswith("~") else adapter
for adapter in raw
}
final_supported = (
support if final_supported is None else (final_supported & support)
)
return final_supported and {
(
f"nonebot.adapters.{adapter_name[1:]}"
if adapter_name.startswith("~")
else adapter_name
)
for adapter_name in final_supported
}
return final_supported

View File

@@ -3,31 +3,34 @@
参考: [import hooks](https://docs.python.org/3/reference/import.html#import-hooks), [PEP302](https://www.python.org/dev/peps/pep-0302/)
FrontMatter:
mdx:
format: md
sidebar_position: 5
description: nonebot.plugin.manager 模块
"""
import sys
import pkgutil
from collections.abc import Iterable, Sequence
import importlib
from pathlib import Path
from itertools import chain
from types import ModuleType
from importlib.abc import MetaPathFinder
from importlib.machinery import PathFinder, SourceFileLoader
from typing import Set, Dict, List, Iterable, Optional, Sequence
from itertools import chain
from pathlib import Path
import pkgutil
import sys
from types import ModuleType
from typing import Optional
from nonebot.log import logger
from nonebot.utils import escape_tag, path_to_module_name
from .model import Plugin, PluginMetadata
from . import (
_current_plugin,
_managers,
_module_name_to_plugin_id,
_new_plugin,
_revert_plugin,
_current_plugin_chain,
_module_name_to_plugin_name,
)
from .model import Plugin, PluginMetadata
class PluginManager:
@@ -35,7 +38,7 @@ class PluginManager:
参数:
plugins: 独立插件模块名集合。
search_path: 插件搜索路径(文件夹)。
search_path: 插件搜索路径(文件夹),相对于当前工作目录
"""
def __init__(
@@ -44,60 +47,78 @@ class PluginManager:
search_path: Optional[Iterable[str]] = None,
):
# simple plugin not in search path
self.plugins: Set[str] = set(plugins or [])
self.search_path: Set[str] = set(search_path or [])
self.plugins: set[str] = set(plugins or [])
self.search_path: set[str] = set(search_path or [])
# cache plugins
self._third_party_plugin_names: Dict[str, str] = {}
self._searched_plugin_names: Dict[str, Path] = {}
self.prepare_plugins()
self._third_party_plugin_ids: dict[str, str] = {}
self._searched_plugin_ids: dict[str, str] = {}
self._prepare_plugins()
def __repr__(self) -> str:
return f"PluginManager(plugins={self.plugins}, search_path={self.search_path})"
return f"PluginManager(available_plugins={self.controlled_modules})"
@property
def third_party_plugins(self) -> Set[str]:
"""返回所有独立插件名称"""
return set(self._third_party_plugin_names.keys())
def third_party_plugins(self) -> set[str]:
"""返回所有独立插件标识符"""
return set(self._third_party_plugin_ids.keys())
@property
def searched_plugins(self) -> Set[str]:
"""返回已搜索到的插件名称"""
return set(self._searched_plugin_names.keys())
def searched_plugins(self) -> set[str]:
"""返回已搜索到的插件标识符"""
return set(self._searched_plugin_ids.keys())
@property
def available_plugins(self) -> Set[str]:
"""返回当前插件管理器中可用的插件名称"""
def available_plugins(self) -> set[str]:
"""返回当前插件管理器中可用的插件标识符"""
return self.third_party_plugins | self.searched_plugins
def _previous_plugins(self) -> Set[str]:
_pre_managers: List[PluginManager]
@property
def controlled_modules(self) -> dict[str, str]:
"""返回当前插件管理器中控制的插件标识符与模块路径映射字典。"""
return dict(
chain(
self._third_party_plugin_ids.items(), self._searched_plugin_ids.items()
)
)
def _previous_controlled_modules(self) -> dict[str, str]:
_pre_managers: list[PluginManager]
if self in _managers:
_pre_managers = _managers[: _managers.index(self)]
else:
_pre_managers = _managers[:]
return {
*chain.from_iterable(manager.available_plugins for manager in _pre_managers)
plugin_id: module_name
for manager in _pre_managers
for plugin_id, module_name in manager.controlled_modules.items()
}
def prepare_plugins(self) -> Set[str]:
def _prepare_plugins(self) -> set[str]:
"""搜索插件并缓存插件名称。"""
# get all previous ready to load plugins
previous_plugins = self._previous_plugins()
searched_plugins: Dict[str, Path] = {}
third_party_plugins: Dict[str, str] = {}
previous_plugin_ids = self._previous_controlled_modules()
# if self not in global managers, merge self's controlled modules
def get_controlled_modules():
return (
previous_plugin_ids
if self in _managers
else {**previous_plugin_ids, **self.controlled_modules}
)
# check third party plugins
for plugin in self.plugins:
name = _module_name_to_plugin_name(plugin)
if name in third_party_plugins or name in previous_plugins:
plugin_id = _module_name_to_plugin_id(plugin, get_controlled_modules())
if (
plugin_id in self._third_party_plugin_ids
or plugin_id in previous_plugin_ids
):
raise RuntimeError(
f"Plugin already exists: {name}! Check your plugin name"
f"Plugin already exists: {plugin_id}! Check your plugin name"
)
third_party_plugins[name] = plugin
self._third_party_plugin_names = third_party_plugins
self._third_party_plugin_ids[plugin_id] = plugin
# check plugins in search path
for module_info in pkgutil.iter_modules(self.search_path):
@@ -105,47 +126,55 @@ class PluginManager:
if module_info.name.startswith("_"):
continue
if (
module_info.name in searched_plugins
or module_info.name in previous_plugins
or module_info.name in third_party_plugins
):
raise RuntimeError(
f"Plugin already exists: {module_info.name}! Check your plugin name"
)
if not (
module_spec := module_info.module_finder.find_spec(
module_info.name, None
)
):
continue
if not (module_path := module_spec.origin):
continue
searched_plugins[module_info.name] = Path(module_path).resolve()
self._searched_plugin_names = searched_plugins
if not module_spec.origin:
continue
# get module name from path, pkgutil does not return the actual module name
module_path = Path(module_spec.origin).resolve()
module_name = path_to_module_name(module_path)
plugin_id = _module_name_to_plugin_id(module_name, get_controlled_modules())
if (
plugin_id in previous_plugin_ids
or plugin_id in self._third_party_plugin_ids
or plugin_id in self._searched_plugin_ids
):
raise RuntimeError(
f"Plugin already exists: {plugin_id}! Check your plugin name"
)
self._searched_plugin_ids[plugin_id] = module_name
return self.available_plugins
def load_plugin(self, name: str) -> Optional[Plugin]:
"""加载指定插件。
对于独立插件,可以使用完整插件模块名或者插件名称
可以使用完整插件模块名或者插件标识符加载
参数:
name: 插件名称。
name: 插件名称或插件标识符
"""
try:
if name in self.plugins:
# load using plugin id
if name in self._third_party_plugin_ids:
module = importlib.import_module(self._third_party_plugin_ids[name])
elif name in self._searched_plugin_ids:
module = importlib.import_module(self._searched_plugin_ids[name])
# load using module name
elif (
name in self._third_party_plugin_ids.values()
or name in self._searched_plugin_ids.values()
):
module = importlib.import_module(name)
elif name in self._third_party_plugin_names:
module = importlib.import_module(self._third_party_plugin_names[name])
elif name in self._searched_plugin_names:
module = importlib.import_module(
path_to_module_name(self._searched_plugin_names[name])
)
else:
raise RuntimeError(f"Plugin not found: {name}! Check your plugin name")
@@ -154,13 +183,13 @@ class PluginManager:
) is None or not isinstance(plugin, Plugin):
raise RuntimeError(
f"Module {module.__name__} is not loaded as a plugin! "
"Make sure not to import it before loading."
f"Make sure not to import it before loading."
)
logger.opt(colors=True).success(
f'Succeeded to load plugin "<y>{escape_tag(plugin.name)}</y>"'
f'Succeeded to load plugin "<y>{escape_tag(plugin.id_)}</y>"'
+ (
f' from "<m>{escape_tag(plugin.module_name)}</m>"'
if plugin.module_name != plugin.name
if plugin.module_name != plugin.id_
else ""
)
)
@@ -170,7 +199,7 @@ class PluginManager:
f'<r><bg #f8bbd0>Failed to import "{escape_tag(name)}"</bg #f8bbd0></r>'
)
def load_all_plugins(self) -> Set[Plugin]:
def load_all_plugins(self) -> set[Plugin]:
"""加载所有可用插件。"""
return set(
@@ -192,21 +221,16 @@ class PluginFinder(MetaPathFinder):
module_origin = module_spec.origin
if not module_origin:
return
module_path = Path(module_origin).resolve()
for manager in reversed(_managers):
# use path instead of name in case of submodule name conflict
if (
fullname in manager.plugins
or module_path in manager._searched_plugin_names.values()
):
if fullname in manager.controlled_modules.values():
module_spec.loader = PluginLoader(manager, fullname, module_origin)
return module_spec
return
class PluginLoader(SourceFileLoader):
def __init__(self, manager: PluginManager, fullname: str, path) -> None:
def __init__(self, manager: PluginManager, fullname: str, path: str) -> None:
self.manager = manager
self.loaded = False
super().__init__(fullname, path)
@@ -226,17 +250,8 @@ class PluginLoader(SourceFileLoader):
plugin = _new_plugin(self.name, module, self.manager)
setattr(module, "__plugin__", plugin)
# detect parent plugin before entering current plugin context
parent_plugins = _current_plugin_chain.get()
for pre_plugin in reversed(parent_plugins):
# ensure parent plugin is declared before current plugin
if _managers.index(pre_plugin.manager) < _managers.index(self.manager):
plugin.parent_plugin = pre_plugin
pre_plugin.sub_plugins.add(plugin)
break
# enter plugin context
_plugin_token = _current_plugin_chain.set(parent_plugins + (plugin,))
_plugin_token = _current_plugin.set(plugin)
try:
super().exec_module(module)
@@ -245,7 +260,7 @@ class PluginLoader(SourceFileLoader):
raise
finally:
# leave plugin context
_current_plugin_chain.reset(_plugin_token)
_current_plugin.reset(_plugin_token)
# get plugin metadata
metadata: Optional[PluginMetadata] = getattr(module, "__plugin_meta__", None)

View File

@@ -1,14 +1,16 @@
"""本模块定义插件相关信息。
FrontMatter:
mdx:
format: md
sidebar_position: 3
description: nonebot.plugin.model 模块
"""
import contextlib
from dataclasses import dataclass, field
from types import ModuleType
from dataclasses import field, dataclass
from typing import TYPE_CHECKING, Any, Set, Dict, Type, Optional
from typing import TYPE_CHECKING, Any, Optional, Type # noqa: UP035
from pydantic import BaseModel
@@ -35,19 +37,19 @@ class PluginMetadata:
"""插件类型,用于商店分类"""
homepage: Optional[str] = None
"""插件主页"""
config: Optional[Type[BaseModel]] = None
config: Optional[Type[BaseModel]] = None # noqa: UP006
"""插件配置项"""
supported_adapters: Optional[Set[str]] = None
supported_adapters: Optional[set[str]] = None
"""插件支持的适配器模块路径
格式为 `<module>[:<Adapter>]``~` 为 `nonebot.adapters.` 的缩写。
`None` 表示支持**所有适配器**。
"""
extra: Dict[Any, Any] = field(default_factory=dict)
extra: dict[Any, Any] = field(default_factory=dict)
"""插件额外信息,可由插件编写者自由扩展定义"""
def get_supported_adapters(self) -> Optional[Set[Type["Adapter"]]]:
def get_supported_adapters(self) -> Optional[set[Type["Adapter"]]]: # noqa: UP006
"""获取当前已安装的插件支持适配器类列表"""
if self.supported_adapters is None:
return None
@@ -66,17 +68,24 @@ class Plugin:
"""存储插件信息"""
name: str
"""插件索引标识NoneBot 使用 文件/文件夹 名称作为标识符"""
"""插件名称NoneBot 使用 文件/文件夹 名称作为插件名称"""
module: ModuleType
"""插件模块对象"""
module_name: str
"""点分割模块路径"""
manager: "PluginManager"
"""导入该插件的插件管理器"""
matcher: Set[Type[Matcher]] = field(default_factory=set)
matcher: set[type[Matcher]] = field(default_factory=set)
"""插件加载时定义的 `Matcher`"""
parent_plugin: Optional["Plugin"] = None
"""父插件"""
sub_plugins: Set["Plugin"] = field(default_factory=set)
sub_plugins: set["Plugin"] = field(default_factory=set)
"""子插件集合"""
metadata: Optional[PluginMetadata] = None
@property
def id_(self) -> str:
"""插件索引标识"""
return (
f"{self.parent_plugin.id_}:{self.name}" if self.parent_plugin else self.name
)

View File

@@ -1,49 +1,51 @@
"""本模块定义事件响应器便携定义函数。
FrontMatter:
mdx:
format: md
sidebar_position: 2
description: nonebot.plugin.on 模块
"""
import re
import inspect
import warnings
from types import ModuleType
from datetime import datetime, timedelta
from typing import Any, Set, Dict, List, Type, Tuple, Union, Optional
import inspect
import re
from types import ModuleType
from typing import Any, Optional, Union
import warnings
from nonebot.adapters import Event
from nonebot.permission import Permission
from nonebot.dependencies import Dependent
from nonebot.matcher import Matcher, MatcherSource
from nonebot.typing import T_State, T_Handler, T_RuleChecker, T_PermissionChecker
from nonebot.permission import Permission
from nonebot.rule import (
Rule,
ArgumentParser,
regex,
Rule,
command,
is_type,
keyword,
endswith,
fullmatch,
startswith,
is_type,
keyword,
regex,
shell_command,
startswith,
)
from nonebot.typing import T_Handler, T_PermissionChecker, T_RuleChecker, T_State
from .model import Plugin
from . import get_plugin_by_module_name
from .manager import _current_plugin_chain
from .manager import _current_plugin
from .model import Plugin
def store_matcher(matcher: Type[Matcher]) -> None:
def store_matcher(matcher: type[Matcher]) -> None:
"""存储一个事件响应器到插件。
参数:
matcher: 事件响应器
"""
# only store the matcher defined when plugin loading
if plugin_chain := _current_plugin_chain.get():
plugin_chain[-1].matcher.add(matcher)
if plugin := _current_plugin.get():
plugin.matcher.add(matcher)
def get_matcher_plugin(depth: int = 1) -> Optional[Plugin]: # pragma: no cover
@@ -76,7 +78,7 @@ def get_matcher_module(depth: int = 1) -> Optional[ModuleType]: # pragma: no co
return (source := get_matcher_source(depth + 1)) and source.module
def get_matcher_source(depth: int = 1) -> Optional[MatcherSource]:
def get_matcher_source(depth: int = 0) -> Optional[MatcherSource]:
"""获取事件响应器定义所在源码信息。
参数:
@@ -85,20 +87,25 @@ def get_matcher_source(depth: int = 1) -> Optional[MatcherSource]:
current_frame = inspect.currentframe()
if current_frame is None:
return None
frame = inspect.getouterframes(current_frame)[depth + 1].frame
frame = current_frame
d = depth + 1
while d > 0:
frame = frame.f_back
if frame is None:
raise ValueError("Depth out of range")
d -= 1
module_name = (module := inspect.getmodule(frame)) and module.__name__
plugin: Optional["Plugin"] = None
# matcher defined when plugin loading
if plugin_chain := _current_plugin_chain.get():
plugin = plugin_chain[-1]
plugin: Optional["Plugin"] = _current_plugin.get()
# matcher defined when plugin running
elif module_name:
if plugin is None and module_name:
plugin = get_plugin_by_module_name(module_name)
return MatcherSource(
plugin_name=plugin and plugin.name,
plugin_id=plugin and plugin.id_,
module_name=module_name,
lineno=frame.f_lineno,
)
@@ -109,14 +116,14 @@ def on(
rule: Optional[Union[Rule, T_RuleChecker]] = None,
permission: Optional[Union[Permission, T_PermissionChecker]] = None,
*,
handlers: Optional[List[Union[T_Handler, Dependent]]] = None,
handlers: Optional[list[Union[T_Handler, Dependent[Any]]]] = None,
temp: bool = False,
expire_time: Optional[Union[datetime, timedelta]] = None,
priority: int = 1,
block: bool = False,
state: Optional[T_State] = None,
_depth: int = 0,
) -> Type[Matcher]:
) -> type[Matcher]:
"""注册一个基础事件响应器,可自定义类型。
参数:
@@ -146,7 +153,7 @@ def on(
return matcher
def on_metaevent(*args, _depth: int = 0, **kwargs) -> Type[Matcher]:
def on_metaevent(*args, _depth: int = 0, **kwargs) -> type[Matcher]:
"""注册一个元事件响应器。
参数:
@@ -162,7 +169,7 @@ def on_metaevent(*args, _depth: int = 0, **kwargs) -> Type[Matcher]:
return on("meta_event", *args, **kwargs, _depth=_depth + 1)
def on_message(*args, _depth: int = 0, **kwargs) -> Type[Matcher]:
def on_message(*args, _depth: int = 0, **kwargs) -> type[Matcher]:
"""注册一个消息事件响应器。
参数:
@@ -179,7 +186,7 @@ def on_message(*args, _depth: int = 0, **kwargs) -> Type[Matcher]:
return on("message", *args, **kwargs, _depth=_depth + 1)
def on_notice(*args, _depth: int = 0, **kwargs) -> Type[Matcher]:
def on_notice(*args, _depth: int = 0, **kwargs) -> type[Matcher]:
"""注册一个通知事件响应器。
参数:
@@ -195,7 +202,7 @@ def on_notice(*args, _depth: int = 0, **kwargs) -> Type[Matcher]:
return on("notice", *args, **kwargs, _depth=_depth + 1)
def on_request(*args, _depth: int = 0, **kwargs) -> Type[Matcher]:
def on_request(*args, _depth: int = 0, **kwargs) -> type[Matcher]:
"""注册一个请求事件响应器。
参数:
@@ -212,12 +219,12 @@ def on_request(*args, _depth: int = 0, **kwargs) -> Type[Matcher]:
def on_startswith(
msg: Union[str, Tuple[str, ...]],
msg: Union[str, tuple[str, ...]],
rule: Optional[Union[Rule, T_RuleChecker]] = None,
ignorecase: bool = False,
_depth: int = 0,
**kwargs,
) -> Type[Matcher]:
) -> type[Matcher]:
"""注册一个消息事件响应器,并且当消息的**文本部分**以指定内容开头时响应。
参数:
@@ -236,12 +243,12 @@ def on_startswith(
def on_endswith(
msg: Union[str, Tuple[str, ...]],
msg: Union[str, tuple[str, ...]],
rule: Optional[Union[Rule, T_RuleChecker]] = None,
ignorecase: bool = False,
_depth: int = 0,
**kwargs,
) -> Type[Matcher]:
) -> type[Matcher]:
"""注册一个消息事件响应器,并且当消息的**文本部分**以指定内容结尾时响应。
参数:
@@ -260,12 +267,12 @@ def on_endswith(
def on_fullmatch(
msg: Union[str, Tuple[str, ...]],
msg: Union[str, tuple[str, ...]],
rule: Optional[Union[Rule, T_RuleChecker]] = None,
ignorecase: bool = False,
_depth: int = 0,
**kwargs,
) -> Type[Matcher]:
) -> type[Matcher]:
"""注册一个消息事件响应器,并且当消息的**文本部分**与指定内容完全一致时响应。
参数:
@@ -284,11 +291,11 @@ def on_fullmatch(
def on_keyword(
keywords: Set[str],
keywords: set[str],
rule: Optional[Union[Rule, T_RuleChecker]] = None,
_depth: int = 0,
**kwargs,
) -> Type[Matcher]:
) -> type[Matcher]:
"""注册一个消息事件响应器,并且当消息纯文本部分包含关键词时响应。
参数:
@@ -306,13 +313,13 @@ def on_keyword(
def on_command(
cmd: Union[str, Tuple[str, ...]],
cmd: Union[str, tuple[str, ...]],
rule: Optional[Union[Rule, T_RuleChecker]] = None,
aliases: Optional[Set[Union[str, Tuple[str, ...]]]] = None,
aliases: Optional[set[Union[str, tuple[str, ...]]]] = None,
force_whitespace: Optional[Union[str, bool]] = None,
_depth: int = 0,
**kwargs,
) -> Type[Matcher]:
) -> type[Matcher]:
"""注册一个消息事件响应器,并且当消息以指定命令开头时响应。
命令匹配规则参考: `命令形式匹配 <rule.md#command-command>`_
@@ -341,13 +348,13 @@ def on_command(
def on_shell_command(
cmd: Union[str, Tuple[str, ...]],
cmd: Union[str, tuple[str, ...]],
rule: Optional[Union[Rule, T_RuleChecker]] = None,
aliases: Optional[Set[Union[str, Tuple[str, ...]]]] = None,
aliases: Optional[set[Union[str, tuple[str, ...]]]] = None,
parser: Optional[ArgumentParser] = None,
_depth: int = 0,
**kwargs,
) -> Type[Matcher]:
) -> type[Matcher]:
"""注册一个支持 `shell_like` 解析参数的命令消息事件响应器。
与普通的 `on_command` 不同的是,在添加 `parser` 参数时, 响应器会自动处理消息。
@@ -383,7 +390,7 @@ def on_regex(
rule: Optional[Union[Rule, T_RuleChecker]] = None,
_depth: int = 0,
**kwargs,
) -> Type[Matcher]:
) -> type[Matcher]:
"""注册一个消息事件响应器,并且当消息匹配正则表达式时响应。
命令匹配规则参考: `正则匹配 <rule.md#regex-regex-flags-0>`_
@@ -404,12 +411,12 @@ def on_regex(
def on_type(
types: Union[Type[Event], Tuple[Type[Event], ...]],
types: Union[type[Event], tuple[type[Event], ...]],
rule: Optional[Union[Rule, T_RuleChecker]] = None,
*,
_depth: int = 0,
**kwargs,
) -> Type[Matcher]:
) -> type[Matcher]:
"""注册一个事件响应器,并且当事件为指定类型时响应。
参数:
@@ -430,14 +437,14 @@ def on_type(
class _Group:
def __init__(self, **kwargs):
"""创建一个事件响应器组合,参数为默认值,与 `on` 一致"""
self.matchers: List[Type[Matcher]] = []
self.matchers: list[type[Matcher]] = []
"""组内事件响应器列表"""
self.base_kwargs: Dict[str, Any] = kwargs
self.base_kwargs: dict[str, Any] = kwargs
"""其他传递给 `on` 的参数默认值"""
def _get_final_kwargs(
self, update: Dict[str, Any], *, exclude: Optional[Set[str]] = None
) -> Dict[str, Any]:
self, update: dict[str, Any], *, exclude: Optional[set[str]] = None
) -> dict[str, Any]:
"""获取最终传递给 `on` 的参数
参数:
@@ -470,18 +477,18 @@ class CommandGroup(_Group):
"""
def __init__(
self, cmd: Union[str, Tuple[str, ...]], prefix_aliases: bool = False, **kwargs
self, cmd: Union[str, tuple[str, ...]], prefix_aliases: bool = False, **kwargs
):
"""命令前缀"""
super().__init__(**kwargs)
self.basecmd: Tuple[str, ...] = (cmd,) if isinstance(cmd, str) else cmd
self.basecmd: tuple[str, ...] = (cmd,) if isinstance(cmd, str) else cmd
self.base_kwargs.pop("aliases", None)
self.prefix_aliases = prefix_aliases
def __repr__(self) -> str:
return f"CommandGroup(cmd={self.basecmd}, matchers={len(self.matchers)})"
def command(self, cmd: Union[str, Tuple[str, ...]], **kwargs) -> Type[Matcher]:
def command(self, cmd: Union[str, tuple[str, ...]], **kwargs) -> type[Matcher]:
"""注册一个新的命令。新参数将会覆盖命令组默认值
参数:
@@ -509,8 +516,8 @@ class CommandGroup(_Group):
return matcher
def shell_command(
self, cmd: Union[str, Tuple[str, ...]], **kwargs
) -> Type[Matcher]:
self, cmd: Union[str, tuple[str, ...]], **kwargs
) -> type[Matcher]:
"""注册一个新的 `shell_like` 命令。新参数将会覆盖命令组默认值
参数:
@@ -544,7 +551,7 @@ class MatcherGroup(_Group):
def __repr__(self) -> str:
return f"MatcherGroup(matchers={len(self.matchers)})"
def on(self, **kwargs) -> Type[Matcher]:
def on(self, **kwargs) -> type[Matcher]:
"""注册一个基础事件响应器,可自定义类型。
参数:
@@ -562,7 +569,7 @@ class MatcherGroup(_Group):
self.matchers.append(matcher)
return matcher
def on_metaevent(self, **kwargs) -> Type[Matcher]:
def on_metaevent(self, **kwargs) -> type[Matcher]:
"""注册一个元事件响应器。
参数:
@@ -580,7 +587,7 @@ class MatcherGroup(_Group):
self.matchers.append(matcher)
return matcher
def on_message(self, **kwargs) -> Type[Matcher]:
def on_message(self, **kwargs) -> type[Matcher]:
"""注册一个消息事件响应器。
参数:
@@ -598,7 +605,7 @@ class MatcherGroup(_Group):
self.matchers.append(matcher)
return matcher
def on_notice(self, **kwargs) -> Type[Matcher]:
def on_notice(self, **kwargs) -> type[Matcher]:
"""注册一个通知事件响应器。
参数:
@@ -616,7 +623,7 @@ class MatcherGroup(_Group):
self.matchers.append(matcher)
return matcher
def on_request(self, **kwargs) -> Type[Matcher]:
def on_request(self, **kwargs) -> type[Matcher]:
"""注册一个请求事件响应器。
参数:
@@ -635,8 +642,8 @@ class MatcherGroup(_Group):
return matcher
def on_startswith(
self, msg: Union[str, Tuple[str, ...]], **kwargs
) -> Type[Matcher]:
self, msg: Union[str, tuple[str, ...]], **kwargs
) -> type[Matcher]:
"""注册一个消息事件响应器,并且当消息的**文本部分**以指定内容开头时响应。
参数:
@@ -656,7 +663,7 @@ class MatcherGroup(_Group):
self.matchers.append(matcher)
return matcher
def on_endswith(self, msg: Union[str, Tuple[str, ...]], **kwargs) -> Type[Matcher]:
def on_endswith(self, msg: Union[str, tuple[str, ...]], **kwargs) -> type[Matcher]:
"""注册一个消息事件响应器,并且当消息的**文本部分**以指定内容结尾时响应。
参数:
@@ -676,7 +683,7 @@ class MatcherGroup(_Group):
self.matchers.append(matcher)
return matcher
def on_fullmatch(self, msg: Union[str, Tuple[str, ...]], **kwargs) -> Type[Matcher]:
def on_fullmatch(self, msg: Union[str, tuple[str, ...]], **kwargs) -> type[Matcher]:
"""注册一个消息事件响应器,并且当消息的**文本部分**与指定内容完全一致时响应。
参数:
@@ -696,7 +703,7 @@ class MatcherGroup(_Group):
self.matchers.append(matcher)
return matcher
def on_keyword(self, keywords: Set[str], **kwargs) -> Type[Matcher]:
def on_keyword(self, keywords: set[str], **kwargs) -> type[Matcher]:
"""注册一个消息事件响应器,并且当消息纯文本部分包含关键词时响应。
参数:
@@ -717,11 +724,11 @@ class MatcherGroup(_Group):
def on_command(
self,
cmd: Union[str, Tuple[str, ...]],
aliases: Optional[Set[Union[str, Tuple[str, ...]]]] = None,
cmd: Union[str, tuple[str, ...]],
aliases: Optional[set[Union[str, tuple[str, ...]]]] = None,
force_whitespace: Optional[Union[str, bool]] = None,
**kwargs,
) -> Type[Matcher]:
) -> type[Matcher]:
"""注册一个消息事件响应器,并且当消息以指定命令开头时响应。
命令匹配规则参考: `命令形式匹配 <rule.md#command-command>`_
@@ -748,11 +755,11 @@ class MatcherGroup(_Group):
def on_shell_command(
self,
cmd: Union[str, Tuple[str, ...]],
aliases: Optional[Set[Union[str, Tuple[str, ...]]]] = None,
cmd: Union[str, tuple[str, ...]],
aliases: Optional[set[Union[str, tuple[str, ...]]]] = None,
parser: Optional[ArgumentParser] = None,
**kwargs,
) -> Type[Matcher]:
) -> type[Matcher]:
"""注册一个支持 `shell_like` 解析参数的命令消息事件响应器。
与普通的 `on_command` 不同的是,在添加 `parser` 参数时, 响应器会自动处理消息。
@@ -780,7 +787,7 @@ class MatcherGroup(_Group):
def on_regex(
self, pattern: str, flags: Union[int, re.RegexFlag] = 0, **kwargs
) -> Type[Matcher]:
) -> type[Matcher]:
"""注册一个消息事件响应器,并且当消息匹配正则表达式时响应。
命令匹配规则参考: `正则匹配 <rule.md#regex-regex-flags-0>`_
@@ -803,8 +810,8 @@ class MatcherGroup(_Group):
return matcher
def on_type(
self, types: Union[Type[Event], Tuple[Type[Event]]], **kwargs
) -> Type[Matcher]:
self, types: Union[type[Event], tuple[type[Event]]], **kwargs
) -> type[Matcher]:
"""注册一个事件响应器,并且当事件为指定类型时响应。
参数:

View File

@@ -1,14 +1,14 @@
import re
from typing import Any
from types import ModuleType
from datetime import datetime, timedelta
import re
from types import ModuleType
from typing import Any
from nonebot.adapters import Event
from nonebot.permission import Permission
from nonebot.dependencies import Dependent
from nonebot.rule import Rule, ArgumentParser
from nonebot.matcher import Matcher, MatcherSource
from nonebot.typing import T_State, T_Handler, T_RuleChecker, T_PermissionChecker
from nonebot.permission import Permission
from nonebot.rule import ArgumentParser, Rule
from nonebot.typing import T_Handler, T_PermissionChecker, T_RuleChecker, T_State
from .model import Plugin
@@ -21,7 +21,7 @@ def on(
rule: Rule | T_RuleChecker | None = ...,
permission: Permission | T_PermissionChecker | None = ...,
*,
handlers: list[T_Handler | Dependent] | None = ...,
handlers: list[T_Handler | Dependent[Any]] | None = ...,
temp: bool = ...,
expire_time: datetime | timedelta | None = ...,
priority: int = ...,
@@ -32,7 +32,7 @@ def on_metaevent(
rule: Rule | T_RuleChecker | None = ...,
permission: Permission | T_PermissionChecker | None = ...,
*,
handlers: list[T_Handler | Dependent] | None = ...,
handlers: list[T_Handler | Dependent[Any]] | None = ...,
temp: bool = ...,
expire_time: datetime | timedelta | None = ...,
priority: int = ...,
@@ -43,7 +43,7 @@ def on_message(
rule: Rule | T_RuleChecker | None = ...,
permission: Permission | T_PermissionChecker | None = ...,
*,
handlers: list[T_Handler | Dependent] | None = ...,
handlers: list[T_Handler | Dependent[Any]] | None = ...,
temp: bool = ...,
expire_time: datetime | timedelta | None = ...,
priority: int = ...,
@@ -54,7 +54,7 @@ def on_notice(
rule: Rule | T_RuleChecker | None = ...,
permission: Permission | T_PermissionChecker | None = ...,
*,
handlers: list[T_Handler | Dependent] | None = ...,
handlers: list[T_Handler | Dependent[Any]] | None = ...,
temp: bool = ...,
expire_time: datetime | timedelta | None = ...,
priority: int = ...,
@@ -65,7 +65,7 @@ def on_request(
rule: Rule | T_RuleChecker | None = ...,
permission: Permission | T_PermissionChecker | None = ...,
*,
handlers: list[T_Handler | Dependent] | None = ...,
handlers: list[T_Handler | Dependent[Any]] | None = ...,
temp: bool = ...,
expire_time: datetime | timedelta | None = ...,
priority: int = ...,
@@ -78,7 +78,7 @@ def on_startswith(
ignorecase: bool = ...,
*,
permission: Permission | T_PermissionChecker | None = ...,
handlers: list[T_Handler | Dependent] | None = ...,
handlers: list[T_Handler | Dependent[Any]] | None = ...,
temp: bool = ...,
expire_time: datetime | timedelta | None = ...,
priority: int = ...,
@@ -91,7 +91,7 @@ def on_endswith(
ignorecase: bool = ...,
*,
permission: Permission | T_PermissionChecker | None = ...,
handlers: list[T_Handler | Dependent] | None = ...,
handlers: list[T_Handler | Dependent[Any]] | None = ...,
temp: bool = ...,
expire_time: datetime | timedelta | None = ...,
priority: int = ...,
@@ -104,7 +104,7 @@ def on_fullmatch(
ignorecase: bool = ...,
*,
permission: Permission | T_PermissionChecker | None = ...,
handlers: list[T_Handler | Dependent] | None = ...,
handlers: list[T_Handler | Dependent[Any]] | None = ...,
temp: bool = ...,
expire_time: datetime | timedelta | None = ...,
priority: int = ...,
@@ -116,7 +116,7 @@ def on_keyword(
rule: Rule | T_RuleChecker | None = ...,
*,
permission: Permission | T_PermissionChecker | None = ...,
handlers: list[T_Handler | Dependent] | None = ...,
handlers: list[T_Handler | Dependent[Any]] | None = ...,
temp: bool = ...,
expire_time: datetime | timedelta | None = ...,
priority: int = ...,
@@ -130,7 +130,7 @@ def on_command(
force_whitespace: str | bool | None = ...,
*,
permission: Permission | T_PermissionChecker | None = ...,
handlers: list[T_Handler | Dependent] | None = ...,
handlers: list[T_Handler | Dependent[Any]] | None = ...,
temp: bool = ...,
expire_time: datetime | timedelta | None = ...,
priority: int = ...,
@@ -144,7 +144,7 @@ def on_shell_command(
parser: ArgumentParser | None = ...,
*,
permission: Permission | T_PermissionChecker | None = ...,
handlers: list[T_Handler | Dependent] | None = ...,
handlers: list[T_Handler | Dependent[Any]] | None = ...,
temp: bool = ...,
expire_time: datetime | timedelta | None = ...,
priority: int = ...,
@@ -157,7 +157,7 @@ def on_regex(
rule: Rule | T_RuleChecker | None = ...,
*,
permission: Permission | T_PermissionChecker | None = ...,
handlers: list[T_Handler | Dependent] | None = ...,
handlers: list[T_Handler | Dependent[Any]] | None = ...,
temp: bool = ...,
expire_time: datetime | timedelta | None = ...,
priority: int = ...,
@@ -169,7 +169,7 @@ def on_type(
rule: Rule | T_RuleChecker | None = ...,
*,
permission: Permission | T_PermissionChecker | None = ...,
handlers: list[T_Handler | Dependent] | None = ...,
handlers: list[T_Handler | Dependent[Any]] | None = ...,
temp: bool = ...,
expire_time: datetime | timedelta | None = ...,
priority: int = ...,
@@ -194,7 +194,7 @@ class CommandGroup(_Group):
*,
rule: Rule | T_RuleChecker | None = ...,
permission: Permission | T_PermissionChecker | None = ...,
handlers: list[T_Handler | Dependent] | None = ...,
handlers: list[T_Handler | Dependent[Any]] | None = ...,
temp: bool = ...,
expire_time: datetime | timedelta | None = ...,
priority: int = ...,
@@ -209,7 +209,7 @@ class CommandGroup(_Group):
aliases: set[str | tuple[str, ...]] | None = ...,
force_whitespace: str | bool | None = ...,
permission: Permission | T_PermissionChecker | None = ...,
handlers: list[T_Handler | Dependent] | None = ...,
handlers: list[T_Handler | Dependent[Any]] | None = ...,
temp: bool = ...,
expire_time: datetime | timedelta | None = ...,
priority: int = ...,
@@ -224,7 +224,7 @@ class CommandGroup(_Group):
aliases: set[str | tuple[str, ...]] | None = ...,
parser: ArgumentParser | None = ...,
permission: Permission | T_PermissionChecker | None = ...,
handlers: list[T_Handler | Dependent] | None = ...,
handlers: list[T_Handler | Dependent[Any]] | None = ...,
temp: bool = ...,
expire_time: datetime | timedelta | None = ...,
priority: int = ...,
@@ -239,7 +239,7 @@ class MatcherGroup(_Group):
type: str = ...,
rule: Rule | T_RuleChecker | None = ...,
permission: Permission | T_PermissionChecker | None = ...,
handlers: list[T_Handler | Dependent] | None = ...,
handlers: list[T_Handler | Dependent[Any]] | None = ...,
temp: bool = ...,
expire_time: datetime | timedelta | None = ...,
priority: int = ...,
@@ -252,7 +252,7 @@ class MatcherGroup(_Group):
type: str = ...,
rule: Rule | T_RuleChecker | None = ...,
permission: Permission | T_PermissionChecker | None = ...,
handlers: list[T_Handler | Dependent] | None = ...,
handlers: list[T_Handler | Dependent[Any]] | None = ...,
temp: bool = ...,
expire_time: datetime | timedelta | None = ...,
priority: int = ...,
@@ -264,7 +264,7 @@ class MatcherGroup(_Group):
*,
rule: Rule | T_RuleChecker | None = ...,
permission: Permission | T_PermissionChecker | None = ...,
handlers: list[T_Handler | Dependent] | None = ...,
handlers: list[T_Handler | Dependent[Any]] | None = ...,
temp: bool = ...,
expire_time: datetime | timedelta | None = ...,
priority: int = ...,
@@ -276,7 +276,7 @@ class MatcherGroup(_Group):
*,
rule: Rule | T_RuleChecker | None = ...,
permission: Permission | T_PermissionChecker | None = ...,
handlers: list[T_Handler | Dependent] | None = ...,
handlers: list[T_Handler | Dependent[Any]] | None = ...,
temp: bool = ...,
expire_time: datetime | timedelta | None = ...,
priority: int = ...,
@@ -288,7 +288,7 @@ class MatcherGroup(_Group):
*,
rule: Rule | T_RuleChecker | None = ...,
permission: Permission | T_PermissionChecker | None = ...,
handlers: list[T_Handler | Dependent] | None = ...,
handlers: list[T_Handler | Dependent[Any]] | None = ...,
temp: bool = ...,
expire_time: datetime | timedelta | None = ...,
priority: int = ...,
@@ -300,7 +300,7 @@ class MatcherGroup(_Group):
*,
rule: Rule | T_RuleChecker | None = ...,
permission: Permission | T_PermissionChecker | None = ...,
handlers: list[T_Handler | Dependent] | None = ...,
handlers: list[T_Handler | Dependent[Any]] | None = ...,
temp: bool = ...,
expire_time: datetime | timedelta | None = ...,
priority: int = ...,
@@ -314,7 +314,7 @@ class MatcherGroup(_Group):
ignorecase: bool = ...,
rule: Rule | T_RuleChecker | None = ...,
permission: Permission | T_PermissionChecker | None = ...,
handlers: list[T_Handler | Dependent] | None = ...,
handlers: list[T_Handler | Dependent[Any]] | None = ...,
temp: bool = ...,
expire_time: datetime | timedelta | None = ...,
priority: int = ...,
@@ -328,7 +328,7 @@ class MatcherGroup(_Group):
ignorecase: bool = ...,
rule: Rule | T_RuleChecker | None = ...,
permission: Permission | T_PermissionChecker | None = ...,
handlers: list[T_Handler | Dependent] | None = ...,
handlers: list[T_Handler | Dependent[Any]] | None = ...,
temp: bool = ...,
expire_time: datetime | timedelta | None = ...,
priority: int = ...,
@@ -342,7 +342,7 @@ class MatcherGroup(_Group):
ignorecase: bool = ...,
rule: Rule | T_RuleChecker | None = ...,
permission: Permission | T_PermissionChecker | None = ...,
handlers: list[T_Handler | Dependent] | None = ...,
handlers: list[T_Handler | Dependent[Any]] | None = ...,
temp: bool = ...,
expire_time: datetime | timedelta | None = ...,
priority: int = ...,
@@ -355,7 +355,7 @@ class MatcherGroup(_Group):
*,
rule: Rule | T_RuleChecker | None = ...,
permission: Permission | T_PermissionChecker | None = ...,
handlers: list[T_Handler | Dependent] | None = ...,
handlers: list[T_Handler | Dependent[Any]] | None = ...,
temp: bool = ...,
expire_time: datetime | timedelta | None = ...,
priority: int = ...,
@@ -370,7 +370,7 @@ class MatcherGroup(_Group):
*,
rule: Rule | T_RuleChecker | None = ...,
permission: Permission | T_PermissionChecker | None = ...,
handlers: list[T_Handler | Dependent] | None = ...,
handlers: list[T_Handler | Dependent[Any]] | None = ...,
temp: bool = ...,
expire_time: datetime | timedelta | None = ...,
priority: int = ...,
@@ -385,7 +385,7 @@ class MatcherGroup(_Group):
*,
rule: Rule | T_RuleChecker | None = ...,
permission: Permission | T_PermissionChecker | None = ...,
handlers: list[T_Handler | Dependent] | None = ...,
handlers: list[T_Handler | Dependent[Any]] | None = ...,
temp: bool = ...,
expire_time: datetime | timedelta | None = ...,
priority: int = ...,
@@ -399,7 +399,7 @@ class MatcherGroup(_Group):
*,
rule: Rule | T_RuleChecker | None = ...,
permission: Permission | T_PermissionChecker | None = ...,
handlers: list[T_Handler | Dependent] | None = ...,
handlers: list[T_Handler | Dependent[Any]] | None = ...,
temp: bool = ...,
expire_time: datetime | timedelta | None = ...,
priority: int = ...,
@@ -412,7 +412,7 @@ class MatcherGroup(_Group):
*,
rule: Rule | T_RuleChecker | None = ...,
permission: Permission | T_PermissionChecker | None = ...,
handlers: list[T_Handler | Dependent] | None = ...,
handlers: list[T_Handler | Dependent[Any]] | None = ...,
temp: bool = ...,
expire_time: datetime | timedelta | None = ...,
priority: int = ...,

View File

@@ -1,8 +1,8 @@
from nonebot import on_command
from nonebot.rule import to_me
from nonebot.adapters import Message
from nonebot.params import CommandArg
from nonebot.plugin import PluginMetadata
from nonebot.rule import to_me
__plugin_meta__ = PluginMetadata(
name="echo",

View File

@@ -1,9 +1,9 @@
from typing import Dict, AsyncGenerator
from collections.abc import AsyncGenerator
from nonebot.adapters import Event
from nonebot.message import IgnoredException, event_preprocessor
from nonebot.params import Depends
from nonebot.plugin import PluginMetadata
from nonebot.message import IgnoredException, event_preprocessor
__plugin_meta__ = PluginMetadata(
name="唯一会话",
@@ -15,7 +15,7 @@ __plugin_meta__ = PluginMetadata(
supported_adapters=None,
)
_running_matcher: Dict[str, int] = {}
_running_matcher: dict[str, int] = {}
async def matcher_mutex(event: Event) -> AsyncGenerator[bool, None]:

View File

@@ -5,31 +5,29 @@
只有当所有 `RuleChecker` 检查结果为 `True` 时继续运行。
FrontMatter:
mdx:
format: md
sidebar_position: 5
description: nonebot.rule 模块
"""
from argparse import Action, ArgumentError
from argparse import ArgumentParser as ArgParser
from argparse import Namespace as Namespace
from collections.abc import Sequence
from contextvars import ContextVar
from gettext import gettext
from itertools import chain, product
import re
import shlex
from argparse import Action
from gettext import gettext
from argparse import ArgumentError
from contextvars import ContextVar
from itertools import chain, product
from argparse import Namespace as Namespace
from argparse import ArgumentParser as ArgParser
from typing import (
IO,
TYPE_CHECKING,
List,
Type,
Tuple,
Union,
TypeVar,
Optional,
Sequence,
TypedDict,
NamedTuple,
Optional,
TypedDict,
TypeVar,
Union,
cast,
overload,
)
@@ -37,33 +35,33 @@ from typing import (
from pygtrie import CharTrie
from nonebot import get_driver
from nonebot.log import logger
from nonebot.typing import T_State
from nonebot.exception import ParserExit
from nonebot.internal.rule import Rule as Rule
from nonebot.adapters import Bot, Event, Message, MessageSegment
from nonebot.params import Command, EventToMe, CommandArg, CommandWhitespace
from nonebot.consts import (
CMD_ARG_KEY,
CMD_KEY,
CMD_START_KEY,
CMD_WHITESPACE_KEY,
ENDSWITH_KEY,
FULLMATCH_KEY,
KEYWORD_KEY,
PREFIX_KEY,
RAW_CMD_KEY,
REGEX_MATCHED,
SHELL_ARGS,
SHELL_ARGV,
CMD_ARG_KEY,
KEYWORD_KEY,
RAW_CMD_KEY,
ENDSWITH_KEY,
CMD_START_KEY,
FULLMATCH_KEY,
REGEX_MATCHED,
STARTSWITH_KEY,
CMD_WHITESPACE_KEY,
)
from nonebot.exception import ParserExit
from nonebot.internal.rule import Rule as Rule
from nonebot.log import logger
from nonebot.params import Command, CommandArg, CommandWhitespace, EventToMe
from nonebot.typing import T_State
T = TypeVar("T")
class CMD_RESULT(TypedDict):
command: Optional[Tuple[str, ...]]
command: Optional[tuple[str, ...]]
raw_command: Optional[str]
command_arg: Optional[Message]
command_start: Optional[str]
@@ -72,7 +70,7 @@ class CMD_RESULT(TypedDict):
class TRIE_VALUE(NamedTuple):
command_start: str
command: Tuple[str, ...]
command: tuple[str, ...]
parser_message: ContextVar[str] = ContextVar("parser_message")
@@ -147,9 +145,9 @@ class StartswithRule:
ignorecase: 是否忽略大小写
"""
__slots__ = ("msg", "ignorecase")
__slots__ = ("ignorecase", "msg")
def __init__(self, msg: Tuple[str, ...], ignorecase: bool = False):
def __init__(self, msg: tuple[str, ...], ignorecase: bool = False):
self.msg = msg
self.ignorecase = ignorecase
@@ -181,7 +179,7 @@ class StartswithRule:
return False
def startswith(msg: Union[str, Tuple[str, ...]], ignorecase: bool = False) -> Rule:
def startswith(msg: Union[str, tuple[str, ...]], ignorecase: bool = False) -> Rule:
"""匹配消息纯文本开头。
参数:
@@ -202,9 +200,9 @@ class EndswithRule:
ignorecase: 是否忽略大小写
"""
__slots__ = ("msg", "ignorecase")
__slots__ = ("ignorecase", "msg")
def __init__(self, msg: Tuple[str, ...], ignorecase: bool = False):
def __init__(self, msg: tuple[str, ...], ignorecase: bool = False):
self.msg = msg
self.ignorecase = ignorecase
@@ -236,7 +234,7 @@ class EndswithRule:
return False
def endswith(msg: Union[str, Tuple[str, ...]], ignorecase: bool = False) -> Rule:
def endswith(msg: Union[str, tuple[str, ...]], ignorecase: bool = False) -> Rule:
"""匹配消息纯文本结尾。
参数:
@@ -257,9 +255,9 @@ class FullmatchRule:
ignorecase: 是否忽略大小写
"""
__slots__ = ("msg", "ignorecase")
__slots__ = ("ignorecase", "msg")
def __init__(self, msg: Tuple[str, ...], ignorecase: bool = False):
def __init__(self, msg: tuple[str, ...], ignorecase: bool = False):
self.msg = tuple(map(str.casefold, msg) if ignorecase else msg)
self.ignorecase = ignorecase
@@ -290,7 +288,7 @@ class FullmatchRule:
return False
def fullmatch(msg: Union[str, Tuple[str, ...]], ignorecase: bool = False) -> Rule:
def fullmatch(msg: Union[str, tuple[str, ...]], ignorecase: bool = False) -> Rule:
"""完全匹配消息。
参数:
@@ -361,7 +359,7 @@ class CommandRule:
def __init__(
self,
cmds: List[Tuple[str, ...]],
cmds: list[tuple[str, ...]],
force_whitespace: Optional[Union[str, bool]] = None,
):
self.cmds = tuple(cmds)
@@ -380,7 +378,7 @@ class CommandRule:
async def __call__(
self,
cmd: Optional[Tuple[str, ...]] = Command(),
cmd: Optional[tuple[str, ...]] = Command(),
cmd_arg: Optional[Message] = CommandArg(),
cmd_whitespace: Optional[str] = CommandWhitespace(),
) -> bool:
@@ -394,7 +392,7 @@ class CommandRule:
def command(
*cmds: Union[str, Tuple[str, ...]],
*cmds: Union[str, tuple[str, ...]],
force_whitespace: Optional[Union[str, bool]] = None,
) -> Rule:
"""匹配消息命令。
@@ -424,7 +422,7 @@ def command(
config = get_driver().config
command_start = config.command_start
command_sep = config.command_sep
commands: List[Tuple[str, ...]] = []
commands: list[tuple[str, ...]] = []
for command in cmds:
if isinstance(command, str):
command = (command,)
@@ -460,23 +458,23 @@ class ArgumentParser(ArgParser):
self,
args: Optional[Sequence[Union[str, MessageSegment]]] = None,
namespace: None = None,
) -> Tuple[Namespace, List[Union[str, MessageSegment]]]: ...
) -> tuple[Namespace, list[Union[str, MessageSegment]]]: ...
@overload
def parse_known_args(
self, args: Optional[Sequence[Union[str, MessageSegment]]], namespace: T
) -> Tuple[T, List[Union[str, MessageSegment]]]: ...
) -> tuple[T, list[Union[str, MessageSegment]]]: ...
@overload
def parse_known_args(
self, *, namespace: T
) -> Tuple[T, List[Union[str, MessageSegment]]]: ...
) -> tuple[T, list[Union[str, MessageSegment]]]: ...
def parse_known_args(
def parse_known_args( # pyright: ignore[reportIncompatibleMethodOverride]
self,
args: Optional[Sequence[Union[str, MessageSegment]]] = None,
namespace: Optional[T] = None,
) -> Tuple[Union[Namespace, T], List[Union[str, MessageSegment]]]: ...
) -> tuple[Union[Namespace, T], list[Union[str, MessageSegment]]]: ...
@overload
def parse_args(
@@ -506,7 +504,7 @@ class ArgumentParser(ArgParser):
def _parse_optional(
self, arg_string: Union[str, MessageSegment]
) -> Optional[Tuple[Optional[Action], str, Optional[str]]]:
) -> Optional[tuple[Optional[Action], str, Optional[str]]]:
return (
super()._parse_optional(arg_string) if isinstance(arg_string, str) else None
)
@@ -533,7 +531,7 @@ class ShellCommandRule:
__slots__ = ("cmds", "parser")
def __init__(self, cmds: List[Tuple[str, ...]], parser: Optional[ArgumentParser]):
def __init__(self, cmds: list[tuple[str, ...]], parser: Optional[ArgumentParser]):
self.cmds = tuple(cmds)
self.parser = parser
@@ -553,7 +551,7 @@ class ShellCommandRule:
async def __call__(
self,
state: T_State,
cmd: Optional[Tuple[str, ...]] = Command(),
cmd: Optional[tuple[str, ...]] = Command(),
msg: Optional[Message] = CommandArg(),
) -> bool:
if cmd not in self.cmds or msg is None:
@@ -571,7 +569,7 @@ class ShellCommandRule:
try:
args = self.parser.parse_args(state[SHELL_ARGV])
state[SHELL_ARGS] = args
except ArgumentError as e: # pragma: py-gte-39
except ArgumentError as e:
state[SHELL_ARGS] = ParserExit(status=2, message=str(e))
except ParserExit as e:
state[SHELL_ARGS] = e
@@ -581,7 +579,7 @@ class ShellCommandRule:
def shell_command(
*cmds: Union[str, Tuple[str, ...]], parser: Optional[ArgumentParser] = None
*cmds: Union[str, tuple[str, ...]], parser: Optional[ArgumentParser] = None
) -> Rule:
"""匹配 `shell_like` 形式的消息命令。
@@ -629,7 +627,7 @@ def shell_command(
config = get_driver().config
command_start = config.command_start
command_sep = config.command_sep
commands: List[Tuple[str, ...]] = []
commands: list[tuple[str, ...]] = []
for command in cmds:
if isinstance(command, str):
command = (command,)
@@ -656,7 +654,7 @@ class RegexRule:
flags: 正则表达式标记
"""
__slots__ = ("regex", "flags")
__slots__ = ("flags", "regex")
def __init__(self, regex: str, flags: int = 0):
self.regex = regex
@@ -740,7 +738,7 @@ class IsTypeRule:
__slots__ = ("types",)
def __init__(self, *types: Type[Event]):
def __init__(self, *types: type[Event]):
self.types = types
def __repr__(self) -> str:
@@ -756,7 +754,7 @@ class IsTypeRule:
return isinstance(event, self.types)
def is_type(*types: Type[Event]) -> Rule:
def is_type(*types: type[Event]) -> Rule:
"""匹配事件类型。
参数:

View File

@@ -6,23 +6,23 @@
[`typing`](https://docs.python.org/3/library/typing.html)。
FrontMatter:
mdx:
format: md
sidebar_position: 11
description: nonebot.typing 模块
"""
import sys
import types
import warnings
import contextlib
import typing as t
import typing_extensions as t_ext
from typing import TYPE_CHECKING, TypeVar
from typing_extensions import ParamSpec, TypeAlias, get_args, override, get_origin
import typing_extensions as t_ext
from typing_extensions import ParamSpec, TypeAlias, get_args, get_origin, override
import warnings
if TYPE_CHECKING:
from asyncio import Task
from nonebot.adapters import Bot
from nonebot.internal.params import DependencyCache
from nonebot.permission import Permission
T = TypeVar("T")
@@ -45,26 +45,38 @@ def overrides(InterfaceClass: object):
if sys.version_info < (3, 10):
def origin_is_union(origin: t.Optional[t.Type[t.Any]]) -> bool:
def type_has_args(type_: type[t.Any]) -> bool:
"""判断类型是否有参数"""
return isinstance(type_, (t._GenericAlias, types.GenericAlias)) # type: ignore
else:
def type_has_args(type_: type[t.Any]) -> bool:
return isinstance(type_, (t._GenericAlias, types.GenericAlias, types.UnionType)) # type: ignore
if sys.version_info < (3, 10):
def origin_is_union(origin: t.Optional[type[t.Any]]) -> bool:
"""判断是否是 Union 类型"""
return origin is t.Union
else:
def origin_is_union(origin: t.Optional[t.Type[t.Any]]) -> bool:
def origin_is_union(origin: t.Optional[type[t.Any]]) -> bool:
return origin is t.Union or origin is types.UnionType
def origin_is_literal(origin: t.Optional[t.Type[t.Any]]) -> bool:
def origin_is_literal(origin: t.Optional[type[t.Any]]) -> bool:
"""判断是否是 Literal 类型"""
return origin is t.Literal or origin is t_ext.Literal
def _literal_values(type_: t.Type[t.Any]) -> t.Tuple[t.Any, ...]:
def _literal_values(type_: type[t.Any]) -> tuple[t.Any, ...]:
return get_args(type_)
def all_literal_values(type_: t.Type[t.Any]) -> t.List[t.Any]:
def all_literal_values(type_: type[t.Any]) -> list[t.Any]:
"""获取 Literal 类型包含的所有值"""
if not origin_is_literal(get_origin(type_)):
return [type_]
@@ -72,11 +84,9 @@ def all_literal_values(type_: t.Type[t.Any]) -> t.List[t.Any]:
return [x for value in _literal_values(type_) for x in all_literal_values(value)]
def origin_is_annotated(origin: t.Optional[t.Type[t.Any]]) -> bool:
def origin_is_annotated(origin: t.Optional[type[t.Any]]) -> bool:
"""判断是否是 Annotated 类型"""
with contextlib.suppress(TypeError):
return origin is not None and issubclass(origin, t_ext.Annotated)
return False
return origin is t_ext.Annotated
NONE_TYPES = {None, type(None), t.Literal[None], t_ext.Literal[None]}
@@ -84,28 +94,31 @@ if sys.version_info >= (3, 10):
NONE_TYPES.add(types.NoneType)
def is_none_type(type_: t.Type[t.Any]) -> bool:
def is_none_type(type_: type[t.Any]) -> bool:
"""判断是否是 None 类型"""
return type_ in NONE_TYPES
if sys.version_info < (3, 9): # pragma: py-lt-39
def evaluate_forwardref(
ref: t.ForwardRef, globalns: t.Dict[str, t.Any], localns: t.Dict[str, t.Any]
) -> t.Any:
return ref._evaluate(globalns, localns)
else: # pragma: py-gte-39
def evaluate_forwardref(
ref: t.ForwardRef, globalns: t.Dict[str, t.Any], localns: t.Dict[str, t.Any]
) -> t.Any:
return ref._evaluate(globalns, localns, frozenset())
def evaluate_forwardref(
ref: t.ForwardRef, globalns: dict[str, t.Any], localns: dict[str, t.Any]
) -> t.Any:
# Python 3.13/3.12.4+ made `recursive_guard` a kwarg,
# so name it explicitly to avoid:
# TypeError: ForwardRef._evaluate()
# missing 1 required keyword-only argument: 'recursive_guard'
return ref._evaluate(globalns, localns, recursive_guard=frozenset())
# state
T_State: TypeAlias = t.Dict[t.Any, t.Any]
# use annotated flag to avoid ForwardRef recreate generic type (py >= 3.11)
class StateFlag:
def __repr__(self) -> str:
return "StateFlag()"
_STATE_FLAG = StateFlag()
T_State: TypeAlias = t.Annotated[dict[t.Any, t.Any], _STATE_FLAG]
"""事件处理状态 State 类型"""
_DependentCallable: TypeAlias = t.Union[
@@ -134,11 +147,11 @@ T_BotDisconnectionHook: TypeAlias = _DependentCallable[t.Any]
# api hooks
T_CallingAPIHook: TypeAlias = t.Callable[
["Bot", str, t.Dict[str, t.Any]], t.Awaitable[t.Any]
["Bot", str, dict[str, t.Any]], t.Awaitable[t.Any]
]
"""`bot.call_api` 钩子函数"""
T_CalledAPIHook: TypeAlias = t.Callable[
["Bot", t.Optional[Exception], str, t.Dict[str, t.Any], t.Any], t.Awaitable[t.Any]
["Bot", t.Optional[Exception], str, dict[str, t.Any], t.Any], t.Awaitable[t.Any]
]
"""`bot.call_api` 后执行的函数,参数分别为 bot, exception, api, data, result"""
@@ -244,5 +257,5 @@ T_PermissionUpdater: TypeAlias = _DependentCallable["Permission"]
- MatcherParam: Matcher 对象
- DefaultParam: 带有默认值的参数
"""
T_DependencyCache: TypeAlias = t.Dict[_DependentCallable[t.Any], "Task[t.Any]"]
T_DependencyCache: TypeAlias = dict[_DependentCallable[t.Any], "DependencyCache"]
"""依赖缓存, 用于存储依赖函数的返回值"""

View File

@@ -1,48 +1,38 @@
"""本模块包含了 NoneBot 的一些工具函数
FrontMatter:
mdx:
format: md
sidebar_position: 8
description: nonebot.utils 模块
"""
import re
import json
import asyncio
import inspect
import importlib
import dataclasses
from pathlib import Path
from collections import deque
from contextvars import copy_context
from functools import wraps, partial
from contextlib import asynccontextmanager
from typing_extensions import ParamSpec, get_args, override, get_origin
from typing import (
Any,
Dict,
Type,
Tuple,
Union,
Generic,
Mapping,
TypeVar,
Callable,
Optional,
Sequence,
Coroutine,
AsyncGenerator,
ContextManager,
overload,
)
from collections.abc import AsyncGenerator, Coroutine, Generator, Mapping, Sequence
import contextlib
from contextlib import AbstractContextManager, asynccontextmanager
import dataclasses
from functools import partial, wraps
import importlib
import inspect
import json
from pathlib import Path
import re
from typing import Any, Callable, Generic, Optional, TypeVar, Union, overload
from typing_extensions import ParamSpec, get_args, get_origin, override
import anyio
import anyio.to_thread
from exceptiongroup import BaseExceptionGroup, catch
from pydantic import BaseModel
from nonebot.log import logger
from nonebot.typing import (
is_none_type,
origin_is_union,
origin_is_literal,
all_literal_values,
is_none_type,
origin_is_literal,
origin_is_union,
type_has_args,
)
P = ParamSpec("P")
@@ -50,6 +40,7 @@ R = TypeVar("R")
T = TypeVar("T")
K = TypeVar("K")
V = TypeVar("V")
E = TypeVar("E", bound=BaseException)
def escape_tag(s: str) -> str:
@@ -64,8 +55,8 @@ def escape_tag(s: str) -> str:
def deep_update(
mapping: Dict[K, Any], *updating_mappings: Dict[K, Any]
) -> Dict[K, Any]:
mapping: dict[K, Any], *updating_mappings: dict[K, Any]
) -> dict[K, Any]:
"""深度更新合并字典"""
updated_mapping = mapping.copy()
for updating_mapping in updating_mappings:
@@ -82,7 +73,7 @@ def deep_update(
def lenient_issubclass(
cls: Any, class_or_tuple: Union[Type[Any], Tuple[Type[Any], ...]]
cls: Any, class_or_tuple: Union[type[Any], tuple[type[Any], ...]]
) -> bool:
"""检查 cls 是否是 class_or_tuple 中的一个类型子类并忽略类型错误。"""
try:
@@ -92,7 +83,7 @@ def lenient_issubclass(
def generic_check_issubclass(
cls: Any, class_or_tuple: Union[Type[Any], Tuple[Type[Any], ...]]
cls: Any, class_or_tuple: Union[type[Any], tuple[type[Any], ...]]
) -> bool:
"""检查 cls 是否是 class_or_tuple 中的一个类型子类。
@@ -106,9 +97,10 @@ def generic_check_issubclass(
则会检查其 `__bound__` 或 `__constraints__`
是否是 class_or_tuple 中一个类型的子类或 None。
"""
try:
if not type_has_args(cls):
with contextlib.suppress(TypeError):
return issubclass(cls, class_or_tuple)
except TypeError:
origin = get_origin(cls)
if origin_is_union(origin):
return all(
@@ -130,8 +122,7 @@ def generic_check_issubclass(
elif isinstance(cls, TypeVar):
if cls.__constraints__:
return all(
is_none_type(type_)
or generic_check_issubclass(type_, class_or_tuple)
is_none_type(type_) or generic_check_issubclass(type_, class_or_tuple)
for type_ in cls.__constraints__
)
elif cls.__bound__:
@@ -139,13 +130,13 @@ def generic_check_issubclass(
return False
def type_is_complex(type_: Type[Any]) -> bool:
def type_is_complex(type_: type[Any]) -> bool:
"""检查 type_ 是否是复杂类型"""
origin = get_origin(type_)
return _type_is_complex_inner(type_) or _type_is_complex_inner(origin)
def _type_is_complex_inner(type_: Optional[Type[Any]]) -> bool:
def _type_is_complex_inner(type_: Optional[type[Any]]) -> bool:
if lenient_issubclass(type_, (str, bytes)):
return False
@@ -189,18 +180,16 @@ def run_sync(call: Callable[P, R]) -> Callable[P, Coroutine[None, None, R]]:
@wraps(call)
async def _wrapper(*args: P.args, **kwargs: P.kwargs) -> R:
loop = asyncio.get_running_loop()
pfunc = partial(call, *args, **kwargs)
context = copy_context()
result = await loop.run_in_executor(None, partial(context.run, pfunc))
return result
return await anyio.to_thread.run_sync(
partial(call, *args, **kwargs), abandon_on_cancel=True
)
return _wrapper
@asynccontextmanager
async def run_sync_ctx_manager(
cm: ContextManager[T],
cm: AbstractContextManager[T],
) -> AsyncGenerator[T, None]:
"""一个用于包装 sync context manager 为 async context manager 的执行函数"""
try:
@@ -216,7 +205,7 @@ async def run_sync_ctx_manager(
@overload
async def run_coro_with_catch(
coro: Coroutine[Any, Any, T],
exc: Tuple[Type[Exception], ...],
exc: tuple[type[Exception], ...],
return_on_err: None = None,
) -> Union[T, None]: ...
@@ -224,14 +213,14 @@ async def run_coro_with_catch(
@overload
async def run_coro_with_catch(
coro: Coroutine[Any, Any, T],
exc: Tuple[Type[Exception], ...],
exc: tuple[type[Exception], ...],
return_on_err: R,
) -> Union[T, R]: ...
async def run_coro_with_catch(
coro: Coroutine[Any, Any, T],
exc: Tuple[Type[Exception], ...],
exc: tuple[type[Exception], ...],
return_on_err: Optional[R] = None,
) -> Optional[Union[T, R]]:
"""运行协程并当遇到指定异常时返回指定值。
@@ -245,12 +234,36 @@ async def run_coro_with_catch(
协程的返回值或发生异常时的指定值
"""
try:
with catch({exc: lambda exc_group: None}):
return await coro
except exc:
return return_on_err
async def run_coro_with_shield(coro: Coroutine[Any, Any, T]) -> T:
"""运行协程并在取消时屏蔽取消异常。
参数:
coro: 要运行的协程
返回:
协程的返回值
"""
with anyio.CancelScope(shield=True):
return await coro
def flatten_exception_group(
exc_group: BaseExceptionGroup[E],
) -> Generator[E, None, None]:
for exc in exc_group.exceptions:
if isinstance(exc, BaseExceptionGroup):
yield from flatten_exception_group(exc)
else:
yield exc
def get_name(obj: Any) -> str:
"""获取对象的名称"""
if inspect.isfunction(obj) or inspect.isclass(obj):
@@ -289,7 +302,7 @@ class classproperty(Generic[T]):
def __init__(self, func: Callable[[Any], T]) -> None:
self.func = func
def __get__(self, instance: Any, owner: Optional[Type[Any]] = None) -> T:
def __get__(self, instance: Any, owner: Optional[type[Any]] = None) -> T:
return self.func(type(instance) if owner is None else owner)

View File

@@ -17,7 +17,7 @@ _✨ NoneBot 本地文档插件 ✨_
<a href="https://pypi.python.org/pypi/nonebot-plugin-docs">
<img src="https://img.shields.io/pypi/v/nonebot-plugin-docs.svg" alt="pypi">
</a>
<img src="https://img.shields.io/badge/python-3.8+-blue.svg" alt="python">
<img src="https://img.shields.io/badge/python-3.9+-blue.svg" alt="python">
</p>
## 使用方式

View File

@@ -12,7 +12,7 @@ include = ["nonebot_plugin_docs/dist/**/*"]
[tool.poetry.dependencies]
python = "^3.8"
python = "^3.9"
nonebot2 = "^2.0.0"
[tool.poetry.dev-dependencies]

2995
poetry.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
[tool.poetry]
name = "nonebot2"
version = "2.2.1"
version = "2.4.1"
description = "An asynchronous python bot framework."
authors = ["yanyongyu <yyy@nonebot.dev>"]
license = "MIT"
@@ -22,33 +22,33 @@ include = ["nonebot/py.typed"]
[tool.poetry.urls]
"Bug Tracker" = "https://github.com/nonebot/nonebot2/issues"
"Changelog" = "https://nonebot.dev/changelog"
"Funding" = "https://afdian.net/@nonebot"
"Funding" = "https://afdian.com/@nonebot"
[tool.poetry.dependencies]
python = "^3.8"
python = "^3.9"
yarl = "^1.7.2"
anyio = "^4.4.0"
pygtrie = "^2.4.1"
exceptiongroup = "^1.2.2"
loguru = ">=0.6.0,<1.0.0"
python-dotenv = ">=0.21.0,<2.0.0"
typing-extensions = ">=4.4.0,<5.0.0"
pydantic = ">=1.10.0,<3.0.0,!=2.5.0,!=2.5.1"
tomli = { version = "^2.0.1", python = "<3.11" }
pydantic = ">=1.10.0,<3.0.0,!=2.5.0,!=2.5.1,!=2.10.0,!=2.10.1"
websockets = { version = ">=10.0", optional = true }
Quart = { version = ">=0.18.0,<1.0.0", optional = true }
fastapi = { version = ">=0.93.0,<1.0.0", optional = true }
aiohttp = { version = "^3.9.0b0", extras = ["speedups"], optional = true }
httpx = { version = ">=0.20.0,<1.0.0", extras = ["http2"], optional = true }
aiohttp = { version = "^3.11.0", extras = ["speedups"], optional = true }
httpx = { version = ">=0.26.0,<1.0.0", extras = ["http2"], optional = true }
uvicorn = { version = ">=0.20.0,<1.0.0", extras = [
"standard",
], optional = true }
[tool.poetry.group.dev.dependencies]
ruff = "^0.2.0"
isort = "^5.10.1"
black = "^24.0.0"
ruff = "^0.8.0"
nonemoji = "^0.1.2"
pre-commit = "^3.0.0"
pre-commit = "^4.0.0"
[tool.poetry.group.test.dependencies]
nonebot-test = { path = "./envs/test/", develop = false }
@@ -65,40 +65,56 @@ fastapi = ["fastapi", "uvicorn"]
all = ["fastapi", "quart", "aiohttp", "httpx", "websockets", "uvicorn"]
[tool.pytest.ini_options]
asyncio_mode = "strict"
addopts = "--cov=nonebot --cov-append --cov-report=term-missing"
addopts = "--cov=nonebot --cov-report=term-missing"
filterwarnings = ["error", "ignore::DeprecationWarning"]
[tool.black]
line-length = 88
target-version = ["py38", "py39", "py310", "py311"]
include = '\.pyi?$'
extend-exclude = '''
'''
[tool.isort]
profile = "black"
line_length = 88
length_sort = true
skip_gitignore = true
force_sort_within_sections = true
src_paths = ["nonebot", "tests"]
extra_standard_library = ["typing_extensions"]
[tool.ruff]
line-length = 88
target-version = "py38"
target-version = "py39"
[tool.ruff.format]
line-ending = "lf"
[tool.ruff.lint]
select = ["E", "W", "F", "UP", "C", "T", "PYI", "PT", "Q"]
ignore = ["E402", "C901", "UP037"]
select = [
"F", # Pyflakes
"W", # pycodestyle warnings
"E", # pycodestyle errors
"I", # isort
"UP", # pyupgrade
"ASYNC", # flake8-async
"C4", # flake8-comprehensions
"T10", # flake8-debugger
"T20", # flake8-print
"PYI", # flake8-pyi
"PT", # flake8-pytest-style
"Q", # flake8-quotes
"TID", # flake8-tidy-imports
"RUF", # Ruff-specific rules
]
ignore = [
"E402", # module-import-not-at-top-of-file
"UP037", # quoted-annotation
"RUF001", # ambiguous-unicode-character-string
"RUF002", # ambiguous-unicode-character-docstring
"RUF003", # ambiguous-unicode-character-comment
]
[tool.ruff.lint.isort]
force-sort-within-sections = true
known-first-party = ["nonebot", "tests/*"]
extra-standard-library = ["typing_extensions"]
[tool.ruff.lint.flake8-pytest-style]
fixture-parentheses = false
mark-parentheses = false
[tool.ruff.lint.pyupgrade]
keep-runtime-typing = true
[tool.pyright]
pythonVersion = "3.8"
pythonVersion = "3.9"
pythonPlatform = "All"
defineConstant = { PYDANTIC_V2 = true }
executionEnvironments = [
@@ -108,7 +124,7 @@ executionEnvironments = [
{ root = "./" },
]
typeCheckingMode = "basic"
typeCheckingMode = "standard"
reportShadowedImports = false
disableBytesTypePromotions = true

View File

@@ -4,4 +4,4 @@
cd "$(dirname "$0")/../tests"
# Run the tests
pytest -n auto --cov-report xml $@
pytest -n auto --cov-append --cov-report xml --junitxml=./junit.xml $@

View File

@@ -21,8 +21,6 @@ rules =
"sys_platform != 'win32'": py-win32
"sys_platform != 'linux'": py-linux
"sys_platform != 'darwin'": py-darwin
"sys_version_info < (3, 9)": py-gte-39
"sys_version_info >= (3, 9)": py-lt-39
"sys_version_info < (3, 11)": py-gte-311
"sys_version_info >= (3, 11)": py-lt-311
"package_version('pydantic') < (2,)": pydantic-v2

View File

@@ -1,17 +1,20 @@
from collections.abc import Generator
from functools import wraps
import os
import threading
from pathlib import Path
from typing import TYPE_CHECKING, Set, Generator
import threading
from typing import TYPE_CHECKING, Callable, TypeVar
from typing_extensions import ParamSpec
import pytest
from nonebug import NONEBOT_INIT_KWARGS
import pytest
from werkzeug.serving import BaseWSGIServer, make_server
import nonebot
from nonebot.config import Env
from fake_server import request_handler
from nonebot.drivers import URL, Driver
import nonebot
from nonebot import _resolve_combine_expr
from nonebot.config import Env
from nonebot.drivers import URL, Driver
os.environ["CONFIG_FROM_ENV"] = '{"test": "test"}'
os.environ["CONFIG_OVERRIDE"] = "new"
@@ -19,6 +22,9 @@ os.environ["CONFIG_OVERRIDE"] = "new"
if TYPE_CHECKING:
from nonebot.plugin import Plugin
P = ParamSpec("P")
R = TypeVar("R")
collect_ignore = ["plugins/", "dynamic/", "bad_plugins/"]
@@ -37,14 +43,36 @@ def load_driver(request: pytest.FixtureRequest) -> Driver:
return DriverClass(Env(environment=global_driver.env), global_driver.config)
@pytest.fixture(scope="session", params=[pytest.param("asyncio"), pytest.param("trio")])
def anyio_backend(request: pytest.FixtureRequest):
return request.param
def run_once(func: Callable[P, R]) -> Callable[P, R]:
result = ...
@wraps(func)
def _wrapper(*args: P.args, **kwargs: P.kwargs) -> R:
nonlocal result
if result is not Ellipsis:
return result
result = func(*args, **kwargs)
return result
return _wrapper
@pytest.fixture(scope="session", autouse=True)
def load_plugin(nonebug_init: None) -> Set["Plugin"]:
@run_once
def load_plugin(anyio_backend, nonebug_init: None) -> set["Plugin"]:
# preload global plugins
return nonebot.load_plugins(str(Path(__file__).parent / "plugins"))
@pytest.fixture(scope="session", autouse=True)
def load_builtin_plugin(nonebug_init: None) -> Set["Plugin"]:
@run_once
def load_builtin_plugin(anyio_backend, nonebug_init: None) -> set["Plugin"]:
# preload builtin plugins
return nonebot.load_builtin_plugins("echo", "single_session")

View File

@@ -1,15 +1,20 @@
import json
import base64
import json
import socket
from typing import Dict, List, Union, TypeVar
from typing import TypeVar, Union
from wsproto.events import Ping
from werkzeug import Request, Response
from werkzeug.datastructures import MultiDict
from wsproto.frame_protocol import CloseReason
from wsproto import ConnectionType, WSConnection
from wsproto.events import (
AcceptConnection,
BytesMessage,
CloseConnection,
Ping,
TextMessage,
)
from wsproto.events import Request as WSRequest
from wsproto import WSConnection, ConnectionType
from wsproto.events import TextMessage, BytesMessage, CloseConnection, AcceptConnection
from wsproto.frame_protocol import CloseReason
K = TypeVar("K")
V = TypeVar("V")
@@ -31,7 +36,7 @@ def json_safe(string, content_type="application/octet-stream") -> str:
).decode("utf-8")
def flattern(d: "MultiDict[K, V]") -> Dict[K, Union[V, List[V]]]:
def flattern(d: "MultiDict[K, V]") -> dict[K, Union[V, list[V]]]:
return {k: v[0] if len(v) == 1 else v for k, v in d.to_dict(flat=False).items()}

View File

@@ -1,7 +1,7 @@
from nonebot import on_message
from nonebot.matcher import Matcher
from nonebot.adapters import Event, Message
from nonebot.params import ArgStr, Received, EventMessage, LastReceived
from nonebot.matcher import Matcher
from nonebot.params import ArgStr, EventMessage, LastReceived, Received
test_handle = on_message()

View File

@@ -0,0 +1,15 @@
from nonebot.plugin import PluginMetadata
__plugin_meta__ = PluginMetadata(
name="测试插件3",
description="测试继承适配器, 使用内置适配器全名",
usage="无法使用",
type="application",
homepage="https://nonebot.dev",
supported_adapters={
"nonebot.adapters.onebot.v11",
"nonebot.adapters.onebot.v12",
"~qq",
},
extra={"author": "NoneBot"},
)

View File

@@ -8,5 +8,5 @@ manager = PluginManager(
_managers.append(manager)
# test load nested plugin with require
manager.load_plugin("nested_subplugin")
manager.load_plugin("nested_subplugin2")
manager.load_plugin("plugins.nested.plugins.nested_subplugin")
manager.load_plugin("nested:nested_subplugin2")

View File

@@ -1,7 +1,7 @@
from typing_extensions import Annotated
from typing import Annotated, Any
from nonebot.adapters import Message
from nonebot.params import Arg, ArgStr, ArgPlainText
from nonebot.params import Arg, ArgPlainText, ArgPromptResult, ArgStr
async def arg(key: Message = Arg()) -> Message:
@@ -28,12 +28,16 @@ async def annotated_arg_plain_text(key: Annotated[str, ArgPlainText()]) -> str:
return key
async def annotated_arg_prompt_result(key: Annotated[Any, ArgPromptResult()]) -> Any:
return key
# test dependency priority
async def annotated_prior_arg(key: Annotated[str, ArgStr("foo")] = ArgPlainText()):
return key
async def annotated_multi_arg(
key: Annotated[Annotated[str, ArgStr("foo")], ArgPlainText()]
key: Annotated[Annotated[str, ArgStr("foo")], ArgPlainText()],
):
return key

View File

@@ -1,4 +1,4 @@
from typing import Union, TypeVar
from typing import TypeVar, Union
from nonebot.adapters import Bot
@@ -7,6 +7,10 @@ async def get_bot(b: Bot) -> Bot:
return b
async def postpone_bot(b: "Bot") -> Bot:
return b
async def legacy_bot(bot):
return bot

View File

@@ -1,6 +1,7 @@
from dataclasses import dataclass
from typing_extensions import Annotated
from typing import Annotated
import anyio
from pydantic import Field
from nonebot import on_message
@@ -32,8 +33,8 @@ async def gen_async():
@dataclass
class ClassDependency:
x: int = Depends(gen_sync)
y: int = Depends(gen_async)
x: int = Depends(gen_sync) # noqa: RUF009
y: int = Depends(gen_async) # noqa: RUF009
class FooBot(Bot): ...
@@ -73,13 +74,13 @@ async def annotated_class_depend(c: Annotated[ClassDependency, Depends()]):
# test dependency priority
async def annotated_prior_depend(
x: Annotated[int, Depends(lambda: 2)] = Depends(dependency)
x: Annotated[int, Depends(lambda: 2)] = Depends(dependency),
):
return x
async def annotated_multi_depend(
x: Annotated[Annotated[int, Depends(lambda: 2)], Depends(dependency)]
x: Annotated[Annotated[int, Depends(lambda: 2)], Depends(dependency)],
):
return x
@@ -105,3 +106,26 @@ async def validate_field(x: int = Depends(lambda: "1", validate=Field(gt=0))):
async def validate_field_fail(x: int = Depends(lambda: "0", validate=Field(gt=0))):
return x
async def _dep():
await anyio.sleep(1)
return 1
def _dep_mismatch():
return 1
async def cache_exception_func1(
dep: int = Depends(_dep),
mismatch: dict = Depends(_dep_mismatch),
):
raise RuntimeError("Never reach here")
async def cache_exception_func2(
dep: int = Depends(_dep),
match: int = Depends(_dep_mismatch),
):
return dep

View File

@@ -1,13 +1,17 @@
from typing import Union, TypeVar
from typing import TypeVar, Union
from nonebot.adapters import Event, Message
from nonebot.params import EventToMe, EventType, EventMessage, EventPlainText
from nonebot.params import EventMessage, EventPlainText, EventToMe, EventType
async def event(e: Event) -> Event:
return e
async def postpone_event(e: "Event") -> Event:
return e
async def legacy_event(event):
return event

View File

@@ -1,14 +1,23 @@
from typing import Union, TypeVar
from typing import Any, TypeVar, Union
from nonebot.adapters import Event
from nonebot.matcher import Matcher
from nonebot.params import Received, LastReceived
from nonebot.params import (
LastReceived,
PausePromptResult,
Received,
ReceivePromptResult,
)
async def matcher(m: Matcher) -> Matcher:
return m
async def postpone_matcher(m: "Matcher") -> Matcher:
return m
async def legacy_matcher(matcher):
return matcher
@@ -27,7 +36,7 @@ class BarMatcher(Matcher): ...
async def union_matcher(
m: Union[FooMatcher, BarMatcher]
m: Union[FooMatcher, BarMatcher],
) -> Union[FooMatcher, BarMatcher]:
return m
@@ -55,3 +64,11 @@ async def receive(e: Event = Received("test")) -> Event:
async def last_receive(e: Event = LastReceived()) -> Event:
return e
async def receive_prompt_result(result: Any = ReceivePromptResult("test")) -> Any:
return result
async def pause_prompt_result(result: Any = PausePromptResult()) -> Any:
return result

View File

@@ -1,30 +1,34 @@
from typing import List, Match, Tuple
from re import Match
from nonebot.typing import T_State
from nonebot.adapters import Message
from nonebot.params import (
Command,
Keyword,
Endswith,
RegexStr,
Fullmatch,
RegexDict,
CommandArg,
RawCommand,
RegexGroup,
Startswith,
CommandStart,
CommandWhitespace,
Endswith,
Fullmatch,
Keyword,
RawCommand,
RegexDict,
RegexGroup,
RegexMatched,
RegexStr,
ShellCommandArgs,
ShellCommandArgv,
CommandWhitespace,
Startswith,
)
from nonebot.typing import T_State
async def state(x: T_State) -> T_State:
return x
async def postpone_state(x: "T_State") -> T_State:
return x
async def legacy_state(state):
return state
@@ -32,7 +36,7 @@ async def legacy_state(state):
async def not_legacy_state(state: int): ...
async def command(cmd: Tuple[str, ...] = Command()) -> Tuple[str, ...]:
async def command(cmd: tuple[str, ...] = Command()) -> tuple[str, ...]:
return cmd
@@ -59,8 +63,8 @@ async def shell_command_args(
async def shell_command_argv(
shell_command_argv: List[str] = ShellCommandArgv(),
) -> List[str]:
shell_command_argv: list[str] = ShellCommandArgv(),
) -> list[str]:
return shell_command_argv
@@ -68,7 +72,7 @@ async def regex_dict(regex_dict: dict = RegexDict()) -> dict:
return regex_dict
async def regex_group(regex_group: Tuple = RegexGroup()) -> Tuple:
async def regex_group(regex_group: tuple = RegexGroup()) -> tuple:
return regex_group
@@ -80,8 +84,8 @@ async def regex_str(
entire: str = RegexStr(),
type_: str = RegexStr("type"),
second: str = RegexStr(2),
groups: Tuple[str, ...] = RegexStr(1, "arg"),
) -> Tuple[str, str, str, Tuple[str, ...]]:
groups: tuple[str, ...] = RegexStr(1, "arg"),
) -> tuple[str, str, str, tuple[str, ...]]:
return entire, type_, second, groups

View File

@@ -1,9 +1,9 @@
from typing import Optional
from nonebot.typing import T_State
from nonebot.adapters import Bot, Event, Message
from nonebot.matcher import Matcher
from nonebot.params import Arg, Depends
from nonebot.adapters import Bot, Event, Message
from nonebot.typing import T_State
def dependency():

View File

@@ -1,25 +1,24 @@
from typing import Type
from datetime import datetime, timezone
from nonebot.adapters import Event
from nonebot.matcher import Matcher
from nonebot import (
CommandGroup,
MatcherGroup,
on,
on_type,
on_regex,
on_notice,
on_command,
on_keyword,
on_message,
on_request,
on_endswith,
on_fullmatch,
on_keyword,
on_message,
on_metaevent,
on_startswith,
on_notice,
on_regex,
on_request,
on_shell_command,
on_startswith,
on_type,
)
from nonebot.adapters import Event
from nonebot.matcher import Matcher
async def rule() -> bool:
@@ -52,7 +51,7 @@ matcher_on = on(
)
def matcher_on_factory() -> Type[Matcher]:
def matcher_on_factory() -> type[Matcher]:
return on(
"test",
rule=rule,

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