nonebot-plugin-picmenu-next 0.3.0__tar.gz → 0.3.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/LICENSE +1 -1
  2. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/PKG-INFO +26 -4
  3. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/README.md +24 -2
  4. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/docs/development.md +9 -2
  5. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/nonebot_plugin_picmenu_next/__init__.py +2 -2
  6. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/nonebot_plugin_picmenu_next/__main__.py +101 -13
  7. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/nonebot_plugin_picmenu_next/data_source/alconna.py +200 -34
  8. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/nonebot_plugin_picmenu_next/templates/__init__.py +4 -1
  9. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/nonebot_plugin_picmenu_next/templates/default/__init__.py +7 -1
  10. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/nonebot_plugin_picmenu_next/templates/default/res/detail.html.jinja +2 -0
  11. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/pyproject.toml +1 -1
  12. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/tests/conftest.py +12 -8
  13. nonebot_plugin_picmenu_next-0.3.2/tests/test_alconna_collect.py +792 -0
  14. nonebot_plugin_picmenu_next-0.3.0/tests/test_alconna_collect.py +0 -306
  15. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/.github/FUNDING.yml +0 -0
  16. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/.github/workflows/pypi-publish.yml +0 -0
  17. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/.gitignore +0 -0
  18. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/AGENTS.md +0 -0
  19. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/defs/ExternalPluginInfo.json +0 -0
  20. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/nonebot_plugin_picmenu_next/config.py +0 -0
  21. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/nonebot_plugin_picmenu_next/data_source/__init__.py +0 -0
  22. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/nonebot_plugin_picmenu_next/data_source/collect.py +0 -0
  23. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/nonebot_plugin_picmenu_next/data_source/mixin.py +0 -0
  24. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/nonebot_plugin_picmenu_next/data_source/models.py +0 -0
  25. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/nonebot_plugin_picmenu_next/data_source/pinyin.py +0 -0
  26. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/nonebot_plugin_picmenu_next/ft_parser.py +0 -0
  27. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/nonebot_plugin_picmenu_next/res/gan_shen_me.jpg +0 -0
  28. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/nonebot_plugin_picmenu_next/templates/default/res/base.html.jinja +0 -0
  29. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/nonebot_plugin_picmenu_next/templates/default/res/css/base.css +0 -0
  30. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/nonebot_plugin_picmenu_next/templates/default/res/css/dark.css +0 -0
  31. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/nonebot_plugin_picmenu_next/templates/default/res/css/detail.css +0 -0
  32. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/nonebot_plugin_picmenu_next/templates/default/res/css/index.css +0 -0
  33. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/nonebot_plugin_picmenu_next/templates/default/res/index.html.jinja +0 -0
  34. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/nonebot_plugin_picmenu_next/templates/default/res/third-party/code-colorful.css +0 -0
  35. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/nonebot_plugin_picmenu_next/templates/default/res/third-party/code-github-dark.css +0 -0
  36. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/nonebot_plugin_picmenu_next/templates/default/res/third-party/fonts/KaTeX_AMS-Regular.ttf +0 -0
  37. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/nonebot_plugin_picmenu_next/templates/default/res/third-party/fonts/KaTeX_AMS-Regular.woff +0 -0
  38. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/nonebot_plugin_picmenu_next/templates/default/res/third-party/fonts/KaTeX_AMS-Regular.woff2 +0 -0
  39. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/nonebot_plugin_picmenu_next/templates/default/res/third-party/fonts/KaTeX_Caligraphic-Bold.ttf +0 -0
  40. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/nonebot_plugin_picmenu_next/templates/default/res/third-party/fonts/KaTeX_Caligraphic-Bold.woff +0 -0
  41. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/nonebot_plugin_picmenu_next/templates/default/res/third-party/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
  42. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/nonebot_plugin_picmenu_next/templates/default/res/third-party/fonts/KaTeX_Caligraphic-Regular.ttf +0 -0
  43. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/nonebot_plugin_picmenu_next/templates/default/res/third-party/fonts/KaTeX_Caligraphic-Regular.woff +0 -0
  44. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/nonebot_plugin_picmenu_next/templates/default/res/third-party/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
  45. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/nonebot_plugin_picmenu_next/templates/default/res/third-party/fonts/KaTeX_Fraktur-Bold.ttf +0 -0
  46. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/nonebot_plugin_picmenu_next/templates/default/res/third-party/fonts/KaTeX_Fraktur-Bold.woff +0 -0
  47. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/nonebot_plugin_picmenu_next/templates/default/res/third-party/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
  48. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/nonebot_plugin_picmenu_next/templates/default/res/third-party/fonts/KaTeX_Fraktur-Regular.ttf +0 -0
  49. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/nonebot_plugin_picmenu_next/templates/default/res/third-party/fonts/KaTeX_Fraktur-Regular.woff +0 -0
  50. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/nonebot_plugin_picmenu_next/templates/default/res/third-party/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
  51. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/nonebot_plugin_picmenu_next/templates/default/res/third-party/fonts/KaTeX_Main-Bold.ttf +0 -0
  52. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/nonebot_plugin_picmenu_next/templates/default/res/third-party/fonts/KaTeX_Main-Bold.woff +0 -0
  53. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/nonebot_plugin_picmenu_next/templates/default/res/third-party/fonts/KaTeX_Main-Bold.woff2 +0 -0
  54. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/nonebot_plugin_picmenu_next/templates/default/res/third-party/fonts/KaTeX_Main-BoldItalic.ttf +0 -0
  55. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/nonebot_plugin_picmenu_next/templates/default/res/third-party/fonts/KaTeX_Main-BoldItalic.woff +0 -0
  56. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/nonebot_plugin_picmenu_next/templates/default/res/third-party/fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
  57. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/nonebot_plugin_picmenu_next/templates/default/res/third-party/fonts/KaTeX_Main-Italic.ttf +0 -0
  58. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/nonebot_plugin_picmenu_next/templates/default/res/third-party/fonts/KaTeX_Main-Italic.woff +0 -0
  59. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/nonebot_plugin_picmenu_next/templates/default/res/third-party/fonts/KaTeX_Main-Italic.woff2 +0 -0
  60. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/nonebot_plugin_picmenu_next/templates/default/res/third-party/fonts/KaTeX_Main-Regular.ttf +0 -0
  61. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/nonebot_plugin_picmenu_next/templates/default/res/third-party/fonts/KaTeX_Main-Regular.woff +0 -0
  62. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/nonebot_plugin_picmenu_next/templates/default/res/third-party/fonts/KaTeX_Main-Regular.woff2 +0 -0
  63. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/nonebot_plugin_picmenu_next/templates/default/res/third-party/fonts/KaTeX_Math-BoldItalic.ttf +0 -0
  64. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/nonebot_plugin_picmenu_next/templates/default/res/third-party/fonts/KaTeX_Math-BoldItalic.woff +0 -0
  65. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/nonebot_plugin_picmenu_next/templates/default/res/third-party/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
  66. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/nonebot_plugin_picmenu_next/templates/default/res/third-party/fonts/KaTeX_Math-Italic.ttf +0 -0
  67. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/nonebot_plugin_picmenu_next/templates/default/res/third-party/fonts/KaTeX_Math-Italic.woff +0 -0
  68. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/nonebot_plugin_picmenu_next/templates/default/res/third-party/fonts/KaTeX_Math-Italic.woff2 +0 -0
  69. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/nonebot_plugin_picmenu_next/templates/default/res/third-party/fonts/KaTeX_SansSerif-Bold.ttf +0 -0
  70. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/nonebot_plugin_picmenu_next/templates/default/res/third-party/fonts/KaTeX_SansSerif-Bold.woff +0 -0
  71. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/nonebot_plugin_picmenu_next/templates/default/res/third-party/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
  72. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/nonebot_plugin_picmenu_next/templates/default/res/third-party/fonts/KaTeX_SansSerif-Italic.ttf +0 -0
  73. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/nonebot_plugin_picmenu_next/templates/default/res/third-party/fonts/KaTeX_SansSerif-Italic.woff +0 -0
  74. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/nonebot_plugin_picmenu_next/templates/default/res/third-party/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
  75. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/nonebot_plugin_picmenu_next/templates/default/res/third-party/fonts/KaTeX_SansSerif-Regular.ttf +0 -0
  76. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/nonebot_plugin_picmenu_next/templates/default/res/third-party/fonts/KaTeX_SansSerif-Regular.woff +0 -0
  77. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/nonebot_plugin_picmenu_next/templates/default/res/third-party/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
  78. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/nonebot_plugin_picmenu_next/templates/default/res/third-party/fonts/KaTeX_Script-Regular.ttf +0 -0
  79. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/nonebot_plugin_picmenu_next/templates/default/res/third-party/fonts/KaTeX_Script-Regular.woff +0 -0
  80. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/nonebot_plugin_picmenu_next/templates/default/res/third-party/fonts/KaTeX_Script-Regular.woff2 +0 -0
  81. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/nonebot_plugin_picmenu_next/templates/default/res/third-party/fonts/KaTeX_Size1-Regular.ttf +0 -0
  82. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/nonebot_plugin_picmenu_next/templates/default/res/third-party/fonts/KaTeX_Size1-Regular.woff +0 -0
  83. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/nonebot_plugin_picmenu_next/templates/default/res/third-party/fonts/KaTeX_Size1-Regular.woff2 +0 -0
  84. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/nonebot_plugin_picmenu_next/templates/default/res/third-party/fonts/KaTeX_Size2-Regular.ttf +0 -0
  85. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/nonebot_plugin_picmenu_next/templates/default/res/third-party/fonts/KaTeX_Size2-Regular.woff +0 -0
  86. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/nonebot_plugin_picmenu_next/templates/default/res/third-party/fonts/KaTeX_Size2-Regular.woff2 +0 -0
  87. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/nonebot_plugin_picmenu_next/templates/default/res/third-party/fonts/KaTeX_Size3-Regular.ttf +0 -0
  88. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/nonebot_plugin_picmenu_next/templates/default/res/third-party/fonts/KaTeX_Size3-Regular.woff +0 -0
  89. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/nonebot_plugin_picmenu_next/templates/default/res/third-party/fonts/KaTeX_Size3-Regular.woff2 +0 -0
  90. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/nonebot_plugin_picmenu_next/templates/default/res/third-party/fonts/KaTeX_Size4-Regular.ttf +0 -0
  91. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/nonebot_plugin_picmenu_next/templates/default/res/third-party/fonts/KaTeX_Size4-Regular.woff +0 -0
  92. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/nonebot_plugin_picmenu_next/templates/default/res/third-party/fonts/KaTeX_Size4-Regular.woff2 +0 -0
  93. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/nonebot_plugin_picmenu_next/templates/default/res/third-party/fonts/KaTeX_Typewriter-Regular.ttf +0 -0
  94. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/nonebot_plugin_picmenu_next/templates/default/res/third-party/fonts/KaTeX_Typewriter-Regular.woff +0 -0
  95. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/nonebot_plugin_picmenu_next/templates/default/res/third-party/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
  96. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/nonebot_plugin_picmenu_next/templates/default/res/third-party/katex.min.css +0 -0
  97. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/nonebot_plugin_picmenu_next/templates/t_utils.py +0 -0
  98. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/nonebot_plugin_picmenu_next/utils.py +0 -0
  99. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/scripts/gen_defs.py +0 -0
  100. {nonebot_plugin_picmenu_next-0.3.0 → nonebot_plugin_picmenu_next-0.3.2}/tests/test_adapter_filter.py +0 -0
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2023 LgCookie
3
+ Copyright (c) 2023 LgCuwukii
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nonebot-plugin-picmenu-next
3
- Version: 0.3.0
3
+ Version: 0.3.2
4
4
  Summary: Next-gen PicMenu plugin for NoneBot2
5
5
  Project-URL: homepage, https://github.com/lgc-NB2Dev/nonebot-plugin-picmenu-next
6
- Author-email: LgCookie <lgc2333@126.com>
6
+ Author-email: LgCuwukii <lgc2333@126.com>
7
7
  License: MIT
8
8
  License-File: LICENSE
9
9
  Requires-Python: <4.0,>=3.10
@@ -77,6 +77,20 @@ _✨ 新一代的图片帮助插件 ✨_
77
77
 
78
78
  </div>
79
79
 
80
+ ## ℹ️ Tip
81
+
82
+ htmlrender 插件 v0.7 版本目前可能存在未配置渲染后端导致启动报错的问题,可以添加以下配置项解决:
83
+
84
+ ```properties
85
+ RENDER_BACKEND=playwright
86
+ ```
87
+
88
+ 可选添加以下项,使浏览器在 Bot 启动时预加载并启动:
89
+
90
+ ```properties
91
+ RENDER_STARTUP_MODE=probe
92
+ ```
93
+
80
94
  ## 📖 介绍
81
95
 
82
96
  - ✨ **美观的图片界面**:直观友好的图片界面
@@ -245,6 +259,16 @@ Telegram:[@lgc2333](https://t.me/lgc2333)
245
259
 
246
260
  ## 📝 更新日志
247
261
 
262
+ ### 0.3.2
263
+
264
+ - 优化 Alconna 帮助接管逻辑:更好地支持隐藏插件与隐藏命令,并在缺少功能菜单项时基于当前命令临时生成详情页
265
+ - 调整模板上下文,补充功能索引与隐藏内容权限语义,便于模板区分普通帮助与 Alconna 帮助接管场景
266
+
267
+ ### 0.3.1
268
+
269
+ - 调整 Alconna Markdown 帮助格式
270
+ - 现在启用接管 Alconna 帮助输出时,会按当前子命令节点生成帮助内容,而不是始终使用根命令的帮助内容
271
+
248
272
  ### 0.3.0
249
273
 
250
274
  - 新增 Alconna 集成:
@@ -256,8 +280,6 @@ Telegram:[@lgc2333](https://t.me/lgc2333)
256
280
  - 优化 Alconna 命令帮助的 Markdown 生成格式,并在插件启用 Markdown 且命令未自定义 formatter 时自动使用
257
281
  - 修复普通帮助菜单中,插件详情页仍会展示隐藏功能项的问题
258
282
  - 修复默认模板 Markdown 渲染中触发方式、触发条件等字段的换行排版问题
259
- - 完善开发文档,新增 Alconna 自动探测、禁用探测、强制附加探测结果与 mixin 注意事项说明
260
- - 补充 Alconna 自动探测与适配器过滤相关测试
261
283
 
262
284
  ### 0.2.0
263
285
 
@@ -48,6 +48,20 @@ _✨ 新一代的图片帮助插件 ✨_
48
48
 
49
49
  </div>
50
50
 
51
+ ## ℹ️ Tip
52
+
53
+ htmlrender 插件 v0.7 版本目前可能存在未配置渲染后端导致启动报错的问题,可以添加以下配置项解决:
54
+
55
+ ```properties
56
+ RENDER_BACKEND=playwright
57
+ ```
58
+
59
+ 可选添加以下项,使浏览器在 Bot 启动时预加载并启动:
60
+
61
+ ```properties
62
+ RENDER_STARTUP_MODE=probe
63
+ ```
64
+
51
65
  ## 📖 介绍
52
66
 
53
67
  - ✨ **美观的图片界面**:直观友好的图片界面
@@ -216,6 +230,16 @@ Telegram:[@lgc2333](https://t.me/lgc2333)
216
230
 
217
231
  ## 📝 更新日志
218
232
 
233
+ ### 0.3.2
234
+
235
+ - 优化 Alconna 帮助接管逻辑:更好地支持隐藏插件与隐藏命令,并在缺少功能菜单项时基于当前命令临时生成详情页
236
+ - 调整模板上下文,补充功能索引与隐藏内容权限语义,便于模板区分普通帮助与 Alconna 帮助接管场景
237
+
238
+ ### 0.3.1
239
+
240
+ - 调整 Alconna Markdown 帮助格式
241
+ - 现在启用接管 Alconna 帮助输出时,会按当前子命令节点生成帮助内容,而不是始终使用根命令的帮助内容
242
+
219
243
  ### 0.3.0
220
244
 
221
245
  - 新增 Alconna 集成:
@@ -227,8 +251,6 @@ Telegram:[@lgc2333](https://t.me/lgc2333)
227
251
  - 优化 Alconna 命令帮助的 Markdown 生成格式,并在插件启用 Markdown 且命令未自定义 formatter 时自动使用
228
252
  - 修复普通帮助菜单中,插件详情页仍会展示隐藏功能项的问题
229
253
  - 修复默认模板 Markdown 渲染中触发方式、触发条件等字段的换行排版问题
230
- - 完善开发文档,新增 Alconna 自动探测、禁用探测、强制附加探测结果与 mixin 注意事项说明
231
- - 补充 Alconna 自动探测与适配器过滤相关测试
232
254
 
233
255
  ### 0.2.0
234
256
 
@@ -90,7 +90,7 @@ __plugin_meta__ = PluginMetadata(
90
90
  usage="插件用法说明",
91
91
  type="application",
92
92
  extra={
93
- "author": "LgCookie",
93
+ "author": "LgCuwukii",
94
94
  "version": "1.0.0",
95
95
  "pmn": {
96
96
  "hidden": False,
@@ -281,6 +281,7 @@ from nonebot_plugin_picmenu_next.templates import (
281
281
  async def render_index(
282
282
  infos: list[PMNPluginInfo],
283
283
  showing_hidden: bool,
284
+ user_can_see_hidden: bool | None,
284
285
  ) -> UniMessage:
285
286
  text = "\n".join(f"{i}. {info.name}" for i, info in enumerate(infos, 1))
286
287
  return UniMessage.text(text)
@@ -291,6 +292,7 @@ async def render_detail(
291
292
  info: PMNPluginInfo,
292
293
  info_index: int,
293
294
  showing_hidden: bool,
295
+ user_can_see_hidden: bool | None,
294
296
  ) -> UniMessage:
295
297
  return UniMessage.text(f"{info.name}\n\n{info.description or ''}")
296
298
 
@@ -300,8 +302,9 @@ async def render_func_detail(
300
302
  info: PMNPluginInfo,
301
303
  info_index: int,
302
304
  func: PMDataItem,
303
- func_index: int,
305
+ func_index: int | None,
304
306
  showing_hidden: bool,
307
+ user_can_see_hidden: bool | None,
305
308
  ) -> UniMessage:
306
309
  return UniMessage.text(f"{info.name} > {func.func}\n\n{func.detail_des}")
307
310
  ```
@@ -310,4 +313,8 @@ async def render_func_detail(
310
313
 
311
314
  单个插件也可以通过 `extra["pmn"]["template"]` 指定详情页模板,单个功能可以通过 `pmn_template` 指定功能详情页模板。
312
315
 
316
+ `func_index` 表示当前功能在插件功能列表中的 0 基序号;当功能详情来自 Alconna `-h/--help` 接管时,如果当前命令没有对应的已注册菜单项,PicMenu Next 会临时生成一个功能项,此时 `func_index` 为 `None`。
317
+
318
+ `user_can_see_hidden` 表示当前用户是否有权限查看隐藏内容;仅当 `showing_hidden` 为 `True` 时会计算该值,否则为 `None`。如果它为 `False`,在当前版本下可以确定这个渲染请求的来源是 Alconna 扩展。模板可以用它决定是否展示继续使用 `-H/--show-hidden` 的提示文本。
319
+
313
320
  模板实现本身是黑盒接口:可以输出图片,也可以输出文字;可以使用 htmlrender,也可以使用其它渲染方式。若模板依赖特定渲染后端,应在模板实现内部自行检查并抛出清晰错误。
@@ -12,7 +12,7 @@ from .config import ConfigModel
12
12
  from .data_source import refresh_infos
13
13
  from .templates import load_builtin_templates
14
14
 
15
- __version__ = "0.3.0"
15
+ __version__ = "0.3.2"
16
16
  __plugin_meta__ = PluginMetadata(
17
17
  name="PicMenu Next",
18
18
  description="新一代的图片帮助插件",
@@ -21,7 +21,7 @@ __plugin_meta__ = PluginMetadata(
21
21
  homepage="https://github.com/lgc-NB2Dev/nonebot-plugin-picmenu-next",
22
22
  config=ConfigModel,
23
23
  supported_adapters=inherit_supported_adapters("nonebot_plugin_alconna"),
24
- extra={"License": "MIT", "Author": "LgCookie"},
24
+ extra={"License": "MIT", "Author": "LgCuwukii"},
25
25
  )
26
26
 
27
27
  load_builtin_templates()
@@ -1,10 +1,18 @@
1
1
  from collections.abc import Sequence
2
2
  from contextlib import suppress
3
3
  from pathlib import Path
4
- from typing import TypeVar, cast, overload
4
+ from typing import TypeVar, overload
5
5
  from typing_extensions import override
6
6
 
7
- from arclet.alconna import Alconna, Arg, Args, CommandMeta, Option, store_true
7
+ from arclet.alconna import (
8
+ Alconna,
9
+ Arg,
10
+ Args,
11
+ CommandMeta,
12
+ Option,
13
+ TextFormatter,
14
+ store_true,
15
+ )
8
16
  from cookit.pyd import model_copy
9
17
  from loguru import logger
10
18
  from nonebot.adapters import Adapter as BaseAdapter, Bot as BaseBot, Event as BaseEvent
@@ -17,7 +25,11 @@ from thefuzz import process
17
25
 
18
26
  from .config import config
19
27
  from .data_source import get_infos
20
- from .data_source.alconna import get_alconna_plugin_id
28
+ from .data_source.alconna import (
29
+ PMNMarkdownTextFormatter,
30
+ generate_alconna_menu_item,
31
+ get_alconna_plugin_id,
32
+ )
21
33
  from .data_source.mixin import resolve_detail_mixin, resolve_main_mixin
22
34
  from .data_source.models import PinyinChunkSequence, PMDataItem, PMNPluginInfo
23
35
  from .templates import detail_templates, func_detail_templates, index_templates
@@ -41,7 +53,7 @@ alc = Alconna(
41
53
  ),
42
54
  meta=CommandMeta(
43
55
  description="新一代的图片帮助插件",
44
- author="LgCookie",
56
+ author="LgCuwukii",
45
57
  ),
46
58
  )
47
59
  m_cls = on_alconna(
@@ -197,9 +209,18 @@ def filter_unsupported_adapters(
197
209
  ]
198
210
 
199
211
 
212
+ async def can_user_see_hidden(bot: BaseBot, ev: BaseEvent) -> bool:
213
+ if not config.only_superuser_see_hidden:
214
+ return True
215
+ with suppress(Exception):
216
+ return await SUPERUSER(bot, ev)
217
+ return False
218
+
219
+
200
220
  @overload
201
221
  async def render_menu(
202
222
  bot: BaseBot,
223
+ ev: BaseEvent,
203
224
  *,
204
225
  q_plugin: str | None = None,
205
226
  q_function: str | None = None,
@@ -210,19 +231,25 @@ async def render_menu(
210
231
  @overload
211
232
  async def render_menu(
212
233
  bot: BaseBot,
234
+ ev: BaseEvent,
213
235
  *,
214
236
  plugin_id: str | None = None,
215
237
  alc_cmd_id: str | None = None,
238
+ alc_command: Alconna | None = None,
239
+ alc_detail_des: str | None = None,
216
240
  show_hidden: bool = False,
217
241
  ) -> tuple[UniMessage | None, PMNPluginInfo | None, PMDataItem | None]: ...
218
242
 
219
243
 
220
244
  async def render_menu(
221
245
  bot: BaseBot,
246
+ ev: BaseEvent,
222
247
  q_plugin: str | None = None,
223
248
  q_function: str | None = None,
224
249
  plugin_id: str | None = None,
225
250
  alc_cmd_id: str | None = None,
251
+ alc_command: Alconna | None = None,
252
+ alc_detail_des: str | None = None,
226
253
  show_hidden: bool = False,
227
254
  ) -> tuple[UniMessage | None, PMNPluginInfo | None, PMDataItem | None]:
228
255
  infos = filter_unsupported_adapters(get_infos(), bot.adapter)
@@ -232,6 +259,8 @@ async def render_menu(
232
259
  if not infos:
233
260
  return None, None, None
234
261
 
262
+ user_can_see_hidden = await can_user_see_hidden(bot, ev) if show_hidden else None
263
+
235
264
  if plugin_id:
236
265
  r = next(
237
266
  ((i, x) for i, x in enumerate(infos) if x.plugin_id == plugin_id), None
@@ -239,7 +268,11 @@ async def render_menu(
239
268
  elif q_plugin:
240
269
  r = await query_plugin(infos, q_plugin)
241
270
  else:
242
- return await index_templates.get()(infos, show_hidden), None, None
271
+ return (
272
+ await index_templates.get()(infos, show_hidden, user_can_see_hidden),
273
+ None,
274
+ None,
275
+ )
243
276
 
244
277
  if not r:
245
278
  return None, None, None
@@ -253,31 +286,35 @@ async def render_menu(
253
286
  return (
254
287
  await detail_templates.get(
255
288
  info.pmn.template,
256
- )(info, info_index, show_hidden),
289
+ )(info, info_index, show_hidden, user_can_see_hidden),
257
290
  info,
258
291
  None,
259
292
  )
260
293
 
261
- pm_data = info.pm_data
262
- if not pm_data:
263
- return None, info, None
264
-
265
294
  if alc_cmd_id:
295
+ pm_data = info.pm_data or []
266
296
  r = next(
267
297
  ((i, x) for i, x in enumerate(pm_data) if x.alc_cmd_id == alc_cmd_id), None
268
298
  )
299
+ if (not r) and alc_command and show_hidden:
300
+ r = (None, generate_alconna_menu_item(alc_command, info.pmn.markdown))
269
301
  else:
270
302
  assert q_function is not None
303
+ pm_data = info.pm_data
304
+ if not pm_data:
305
+ return None, info, None
271
306
  r = await query_func_detail(pm_data, q_function)
272
307
 
273
308
  if not r:
274
309
  return None, info, None
275
310
 
276
311
  func_index, func = r
312
+ if alc_detail_des is not None:
313
+ func = model_copy(func, update={"detail_des": alc_detail_des})
277
314
  return (
278
315
  await func_detail_templates.get(
279
316
  func.template,
280
- )(info, info_index, func, func_index, show_hidden),
317
+ )(info, info_index, func, func_index, show_hidden, user_can_see_hidden),
281
318
  info,
282
319
  func,
283
320
  )
@@ -305,6 +342,7 @@ async def _(
305
342
 
306
343
  msg, info, func = await render_menu(
307
344
  bot,
345
+ ev,
308
346
  q_plugin=(qp := q_plugin.result),
309
347
  q_function=(qf := q_function.result),
310
348
  show_hidden=show_hidden,
@@ -330,8 +368,14 @@ async def _(
330
368
  ).finish(reply_to=True)
331
369
 
332
370
 
371
+ # Alconna formats `-h/--help` before `output_converter`, and that converter does
372
+ # not receive the current Arparma. To avoid reparsing help text, replace the
373
+ # command formatter with PicMenu's markdown formatter before parsing. `post_init`
374
+ # is the earliest chance; if plugin ownership/registry data is not ready there,
375
+ # retry in `validate`, which runs before help parsing.
333
376
  class PMNHelpExtension(Extension):
334
377
  command: "Alconna | None" = None
378
+ _formatter_checked: bool = False
335
379
 
336
380
  @property
337
381
  def priority(self) -> int:
@@ -341,6 +385,32 @@ class PMNHelpExtension(Extension):
341
385
  def id(self) -> str:
342
386
  return "picmenu-next-help"
343
387
 
388
+ def _ensure_markdown_formatter(self) -> None:
389
+ if self._formatter_checked or not self.command:
390
+ return
391
+ plugin_id = get_alconna_plugin_id(self.command)
392
+ if not plugin_id:
393
+ return
394
+ info = next((x for x in get_infos() if x.plugin_id == plugin_id), None)
395
+ if info is None:
396
+ return
397
+ self._formatter_checked = True
398
+ if (nm := (not info.pmn.markdown)) or (
399
+ type(self.command.formatter) is not TextFormatter
400
+ ):
401
+ logger.debug(
402
+ f"Markdown formatter set skipped for command {self.command.path}"
403
+ f" ({'Does not support markdown' if nm else 'Already has custom formatter'})",
404
+ )
405
+ return
406
+ self.command.formatter = PMNMarkdownTextFormatter().add(self.command)
407
+ logger.debug(f"Markdown formatter applied to command {self.command.path}")
408
+
409
+ @override
410
+ def validate(self, bot: BaseBot, event: BaseEvent) -> bool:
411
+ self._ensure_markdown_formatter()
412
+ return super().validate(bot, event)
413
+
344
414
  @override
345
415
  async def output_converter(
346
416
  self,
@@ -352,19 +422,37 @@ class PMNHelpExtension(Extension):
352
422
  and self.command
353
423
  and (plugin_id := get_alconna_plugin_id(self.command))
354
424
  ):
355
- bot = cast("BaseBot", await self.inject(("bot", BaseBot)))
356
- msg, _, _ = await render_menu(
425
+ bot = await self.inject(("bot", BaseBot))
426
+ ev = await self.inject(("event", BaseEvent))
427
+
428
+ msg, p, _ = await render_menu(
357
429
  bot,
430
+ ev,
358
431
  plugin_id=plugin_id,
359
432
  alc_cmd_id=self.command.path,
433
+ alc_command=self.command,
434
+ alc_detail_des=content,
360
435
  )
436
+ if (not msg) and (not p):
437
+ msg, _, _ = await render_menu(
438
+ bot,
439
+ ev,
440
+ plugin_id=plugin_id,
441
+ alc_cmd_id=self.command.path,
442
+ alc_command=self.command,
443
+ alc_detail_des=content,
444
+ show_hidden=True,
445
+ )
446
+
361
447
  if msg:
362
448
  return msg
449
+
363
450
  return await super().output_converter(output_type, content)
364
451
 
365
452
  @override
366
453
  def post_init(self, alc: "Alconna") -> None:
367
454
  self.command = alc
455
+ self._ensure_markdown_formatter()
368
456
 
369
457
 
370
458
  if config.alconna_global_ext: