nonebot-plugin-l4d2-server 1.0.2__tar.gz → 1.0.4__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 (101) hide show
  1. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/PKG-INFO +20 -15
  2. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/README.md +15 -12
  3. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/nonebot_plugin_l4d2_server/__main__.py +96 -40
  4. nonebot_plugin_l4d2_server-1.0.4/nonebot_plugin_l4d2_server/config.py +94 -0
  5. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/nonebot_plugin_l4d2_server/l4_help/__init__.py +1 -1
  6. nonebot_plugin_l4d2_server-1.0.4/nonebot_plugin_l4d2_server/l4_request/__init__.py +363 -0
  7. nonebot_plugin_l4d2_server-1.0.4/nonebot_plugin_l4d2_server/l4_request/draw_msg.py +231 -0
  8. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/nonebot_plugin_l4d2_server/utils/api/models.py +1 -1
  9. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/nonebot_plugin_l4d2_server/utils/api/request.py +29 -10
  10. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/nonebot_plugin_l4d2_server/utils/utils.py +11 -2
  11. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/pyproject.toml +11 -3
  12. nonebot_plugin_l4d2_server-1.0.2/nonebot_plugin_l4d2_server/config.py +0 -41
  13. nonebot_plugin_l4d2_server-1.0.2/nonebot_plugin_l4d2_server/l4_anne/__init__.py +0 -125
  14. nonebot_plugin_l4d2_server-1.0.2/nonebot_plugin_l4d2_server/l4_anne/ranne.py +0 -18
  15. nonebot_plugin_l4d2_server-1.0.2/nonebot_plugin_l4d2_server/l4_request/__init__.py +0 -213
  16. nonebot_plugin_l4d2_server-1.0.2/nonebot_plugin_l4d2_server/l4_request/draw_msg.py +0 -88
  17. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/LICENSE +0 -0
  18. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/nonebot_plugin_l4d2_server/__init__.py +0 -0
  19. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/nonebot_plugin_l4d2_server/data/font/loli.ttf +0 -0
  20. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/nonebot_plugin_l4d2_server/l4_help/Help.json +0 -0
  21. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/nonebot_plugin_l4d2_server/l4_help/draw.py +0 -0
  22. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/nonebot_plugin_l4d2_server/l4_help/icon//344/273/213/347/273/215.png" +0 -0
  23. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/nonebot_plugin_l4d2_server/l4_help/icon//344/273/273/345/212/241.png" +0 -0
  24. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/nonebot_plugin_l4d2_server/l4_help/icon//344/277/241/346/201/257.png" +0 -0
  25. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/nonebot_plugin_l4d2_server/l4_help/icon//345/205/254/345/221/212.png" +0 -0
  26. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/nonebot_plugin_l4d2_server/l4_help/icon//345/210/200/345/211/221.png" +0 -0
  27. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/nonebot_plugin_l4d2_server/l4_help/icon//345/210/207/346/215/242.png" +0 -0
  28. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/nonebot_plugin_l4d2_server/l4_help/icon//345/210/240/351/231/244.png" +0 -0
  29. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/nonebot_plugin_l4d2_server/l4_help/icon//345/210/267/346/226/260.png" +0 -0
  30. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/nonebot_plugin_l4d2_server/l4_help/icon//345/215/241/347/273/204.png" +0 -0
  31. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/nonebot_plugin_l4d2_server/l4_help/icon//345/223/252/351/207/214.png" +0 -0
  32. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/nonebot_plugin_l4d2_server/l4_help/icon//345/234/260/345/233/276.png" +0 -0
  33. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/nonebot_plugin_l4d2_server/l4_help/icon//345/257/274/345/205/245.png" +0 -0
  34. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/nonebot_plugin_l4d2_server/l4_help/icon//345/257/274/345/207/272.png" +0 -0
  35. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/nonebot_plugin_l4d2_server/l4_help/icon//345/275/261.png" +0 -0
  36. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/nonebot_plugin_l4d2_server/l4_help/icon//346/213/274/345/233/276.png" +0 -0
  37. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/nonebot_plugin_l4d2_server/l4_help/icon//346/216/242/347/264/242.png" +0 -0
  38. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/nonebot_plugin_l4d2_server/l4_help/icon//346/216/250/351/200/201.png" +0 -0
  39. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/nonebot_plugin_l4d2_server/l4_help/icon//346/224/266/351/233/206.png" +0 -0
  40. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/nonebot_plugin_l4d2_server/l4_help/icon//346/224/273/347/225/245.png" +0 -0
  41. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/nonebot_plugin_l4d2_server/l4_help/icon//346/233/264/346/226/260.png" +0 -0
  42. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/nonebot_plugin_l4d2_server/l4_help/icon//346/235/220/346/226/231.png" +0 -0
  43. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/nonebot_plugin_l4d2_server/l4_help/icon//346/237/245/350/257/242.png" +0 -0
  44. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/nonebot_plugin_l4d2_server/l4_help/icon//346/240/241/351/252/214.png" +0 -0
  45. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/nonebot_plugin_l4d2_server/l4_help/icon//346/257/217/346/234/210.png" +0 -0
  46. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/nonebot_plugin_l4d2_server/l4_help/icon//346/267/261/346/270/212.png" +0 -0
  47. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/nonebot_plugin_l4d2_server/l4_help/icon//346/267/273/345/212/240.png" +0 -0
  48. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/nonebot_plugin_l4d2_server/l4_help/icon//346/270/205/351/231/244.png" +0 -0
  49. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/nonebot_plugin_l4d2_server/l4_help/icon//347/212/266/346/200/201.png" +0 -0
  50. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/nonebot_plugin_l4d2_server/l4_help/icon//347/255/276/345/210/260.png" +0 -0
  51. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/nonebot_plugin_l4d2_server/l4_help/icon//347/273/221/345/256/232.png" +0 -0
  52. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/nonebot_plugin_l4d2_server/l4_help/icon//350/241/250.png" +0 -0
  53. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/nonebot_plugin_l4d2_server/l4_help/icon//350/241/250/346/203/205.png" +0 -0
  54. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/nonebot_plugin_l4d2_server/l4_help/icon//350/247/222/350/211/262.png" +0 -0
  55. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/nonebot_plugin_l4d2_server/l4_help/icon//350/256/260/345/275/225.png" +0 -0
  56. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/nonebot_plugin_l4d2_server/l4_help/icon//351/205/215/347/275/256.png" +0 -0
  57. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/nonebot_plugin_l4d2_server/l4_help/icon//351/207/215/345/220/257.png" +0 -0
  58. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/nonebot_plugin_l4d2_server/l4_help/texture2d/badge.png +0 -0
  59. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/nonebot_plugin_l4d2_server/l4_help/texture2d/banner.png +0 -0
  60. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/nonebot_plugin_l4d2_server/l4_help/texture2d/bg.jpg +0 -0
  61. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/nonebot_plugin_l4d2_server/l4_help/texture2d/button.png +0 -0
  62. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/nonebot_plugin_l4d2_server/l4_help/texture2d/icon.png +0 -0
  63. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/nonebot_plugin_l4d2_server/l4_image/__init__.py +0 -0
  64. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/nonebot_plugin_l4d2_server/l4_image/anne_pil.py +0 -0
  65. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/nonebot_plugin_l4d2_server/l4_image/convert.py +0 -0
  66. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/nonebot_plugin_l4d2_server/l4_image/download.py +0 -0
  67. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/nonebot_plugin_l4d2_server/l4_image/html_img.py +0 -0
  68. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/nonebot_plugin_l4d2_server/l4_image/image_tools.py +0 -0
  69. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/nonebot_plugin_l4d2_server/l4_image/img/anne/anne.html +0 -0
  70. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/nonebot_plugin_l4d2_server/l4_image/img/anne/back.png +0 -0
  71. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/nonebot_plugin_l4d2_server/l4_image/img/anne/back1.jpg +0 -0
  72. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/nonebot_plugin_l4d2_server/l4_image/img/anne/group_ip.html +0 -0
  73. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/nonebot_plugin_l4d2_server/l4_image/img/anne/ip.html +0 -0
  74. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/nonebot_plugin_l4d2_server/l4_image/img/head/head.png +0 -0
  75. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/nonebot_plugin_l4d2_server/l4_image/img/header/logo.png +0 -0
  76. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/nonebot_plugin_l4d2_server/l4_image/img/header/player1.jpg +0 -0
  77. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/nonebot_plugin_l4d2_server/l4_image/img/template/Bocchi_The_Rock.html +0 -0
  78. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/nonebot_plugin_l4d2_server/l4_image/img/template/Bocchi_The_Rock.png +0 -0
  79. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/nonebot_plugin_l4d2_server/l4_image/img/template/HYPixel11pxU-2.ttf +0 -0
  80. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/nonebot_plugin_l4d2_server/l4_image/img/template/Pixel.html +0 -0
  81. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/nonebot_plugin_l4d2_server/l4_image/img/template/Pixel.png +0 -0
  82. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/nonebot_plugin_l4d2_server/l4_image/img/template/Rainbow.html +0 -0
  83. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/nonebot_plugin_l4d2_server/l4_image/img/template/Rainbow.png +0 -0
  84. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/nonebot_plugin_l4d2_server/l4_image/img/template/Tutumianhuatang-Bold-2.ttf +0 -0
  85. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/nonebot_plugin_l4d2_server/l4_image/img/template/bilibili.svg +0 -0
  86. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/nonebot_plugin_l4d2_server/l4_image/img/template/fingerprint.svg +0 -0
  87. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/nonebot_plugin_l4d2_server/l4_image/img/template/github.svg +0 -0
  88. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/nonebot_plugin_l4d2_server/l4_image/img/template/l.svg +0 -0
  89. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/nonebot_plugin_l4d2_server/l4_image/img/template/m.svg +0 -0
  90. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/nonebot_plugin_l4d2_server/l4_image/img/template/normal.html +0 -0
  91. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/nonebot_plugin_l4d2_server/l4_image/img/template/vac.png +0 -0
  92. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/nonebot_plugin_l4d2_server/l4_image/img/template/vac_white.png +0 -0
  93. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/nonebot_plugin_l4d2_server/l4_image/img/template/vue.css +0 -0
  94. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/nonebot_plugin_l4d2_server/l4_image/img/template/w.svg +0 -0
  95. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/nonebot_plugin_l4d2_server/l4_image/model.py +0 -0
  96. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/nonebot_plugin_l4d2_server/l4_image/vtfs.py +0 -0
  97. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/nonebot_plugin_l4d2_server/l4_local/__init__.py +0 -0
  98. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/nonebot_plugin_l4d2_server/l4_local/file.py +0 -0
  99. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/nonebot_plugin_l4d2_server/l4_request/utils.py +0 -0
  100. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/nonebot_plugin_l4d2_server/utils/api/api.py +0 -0
  101. {nonebot_plugin_l4d2_server-1.0.2 → nonebot_plugin_l4d2_server-1.0.4}/nonebot_plugin_l4d2_server/utils/database/models.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: nonebot-plugin-l4d2-server
3
- Version: 1.0.2
3
+ Version: 1.0.4
4
4
  Summary: L4D2 server related operations plugin for NoneBot2
5
5
  Keywords: steam,game,l4d2,nonebot2,plugin
6
6
  Author-Email: Agnes_Digital <Z735803792@163.com>
@@ -11,10 +11,12 @@ Classifier: Programming Language :: Python :: 3
11
11
  Classifier: Programming Language :: Python :: 3.9
12
12
  Classifier: Programming Language :: Python :: 3.10
13
13
  Classifier: Programming Language :: Python :: 3.11
14
+ Classifier: Programming Language :: Python :: 3.12
14
15
  Classifier: Operating System :: OS Independent
15
16
  Project-URL: homepage, https://github.com/Agnes4m/nonebot_plugin_l4d2_server
16
17
  Requires-Python: <4.0,>=3.9
17
18
  Requires-Dist: nonebot2>=2.0.0
19
+ Requires-Dist: nonebot2[fastapi]>=2.3.3
18
20
  Requires-Dist: nonebot-plugin-htmlrender>=0.3.0
19
21
  Requires-Dist: nonebot-adapter-onebot>=2.4.4
20
22
  Requires-Dist: nonebot-plugin-alconna>=0.50.0
@@ -29,8 +31,8 @@ Requires-Dist: python-a2s>=1.4.1
29
31
  Requires-Dist: ujson>=5.10.0
30
32
  Requires-Dist: lxml>=5.2.2
31
33
  Requires-Dist: rcon>=2.1.0
32
- Requires-Dist: pillow>9
33
- Requires-Dist: beautifulsoup4>=4.12.3
34
+ Requires-Dist: pillow>10
35
+ Requires-Dist: bs4>=0.0.2
34
36
  Requires-Dist: rarfile>=4.2
35
37
  Requires-Dist: pyunpack>=0.3
36
38
  Requires-Dist: aiofiles>=24.1.0
@@ -45,7 +47,7 @@ Description-Content-Type: text/markdown
45
47
 
46
48
  <div align="center">
47
49
 
48
- # nonebot_plugin_l4d2_server 1.0.0a1
50
+ # nonebot_plugin_l4d2_server 1.0.4
49
51
 
50
52
  _✨Nonebot & Left 4 Dead 2 server操作✨_
51
53
  <div align = "center">
@@ -75,15 +77,12 @@ _✨Nonebot & Left 4 Dead 2 server操作✨_
75
77
 
76
78
  ## 顶置公告(如果以前用0.x.x版本暂时别更新)
77
79
 
78
- - **版本** 1.x.x进行了破坏式更新,目前处于测试阶段,使用旧插件的不要更新
80
+ - **版本** 1.x.x进行了破坏式更新,使用旧插件的不要更新
79
81
 
80
- ## 更改部分
82
+ ## 指令
81
83
 
82
- - 取消了网页控制台(没有卵用)
83
- - 取消了自动重启(与其他插件功能重复)
84
- - 取消了git拉取更新(nb规范用pypi)
85
- - 增加pil和浏览器渲染做选择(可以选择pil以节省性能性能)
86
- - 删除无用部分(依赖太多难以维护)
84
+ - 在json文件设置的前缀指令,例如设置"云",则指令 云 输出组服务器,云1 输出1号服务器
85
+ - l4图片开启/关闭 超管指令 可以修改输出单图是否为图片输出
87
86
 
88
87
  ## 安装
89
88
 
@@ -140,8 +139,7 @@ conda install nonebot-plugin-l4d2-server
140
139
  ## 主要功能
141
140
 
142
141
  - [ ] 求生服务器-本地多路径操作(传地图等)
143
- - [ ] 批量查询指定ip服务器状态和玩家
144
- - [ ] [求生电信服anne](https://github.com/fantasylidong/CompetitiveWithAnne)[查询~](https://sb.trygek.com/l4d_stats/ranking/index.php)
142
+ - [x] 批量查询指定ip服务器状态和玩家
145
143
 
146
144
  ## [数据结构](./docs/standand.md)
147
145
 
@@ -150,8 +148,6 @@ conda install nonebot-plugin-l4d2-server
150
148
  ## env设置
151
149
 
152
150
  """bash
153
- l4_anne = False
154
- """是否启用anne电信服相关功能"""
155
151
  l4_enable = True
156
152
  """是否全局启用求生功能"""
157
153
  l4_image = False
@@ -170,6 +166,15 @@ conda install nonebot-plugin-l4d2-server
170
166
  - 缤纷彩虹
171
167
  """
172
168
 
169
+ ## 和0.x.x更改部分
170
+
171
+ - 取消了网页控制台(没有卵用)
172
+ - 取消了自动重启(与其他插件功能重复)
173
+ - 取消了git拉取更新(nb规范用pypi)
174
+ - 增加pil和浏览器渲染做选择(可以选择pil以节省性能性能)
175
+ - 删除无用部分(依赖太多难以维护)
176
+ - 删除了anne部分,已移植到[这里](https://github.com/Agnes4m/L4D2UID),通过core插件调用
177
+
173
178
  ## 其他
174
179
 
175
180
  - 本人技术很差,如果您有发现BUG或者更好的建议,欢迎提Issue & Pr
@@ -7,7 +7,7 @@
7
7
 
8
8
  <div align="center">
9
9
 
10
- # nonebot_plugin_l4d2_server 1.0.0a1
10
+ # nonebot_plugin_l4d2_server 1.0.4
11
11
 
12
12
  _✨Nonebot & Left 4 Dead 2 server操作✨_
13
13
  <div align = "center">
@@ -37,15 +37,12 @@ _✨Nonebot & Left 4 Dead 2 server操作✨_
37
37
 
38
38
  ## 顶置公告(如果以前用0.x.x版本暂时别更新)
39
39
 
40
- - **版本** 1.x.x进行了破坏式更新,目前处于测试阶段,使用旧插件的不要更新
40
+ - **版本** 1.x.x进行了破坏式更新,使用旧插件的不要更新
41
41
 
42
- ## 更改部分
42
+ ## 指令
43
43
 
44
- - 取消了网页控制台(没有卵用)
45
- - 取消了自动重启(与其他插件功能重复)
46
- - 取消了git拉取更新(nb规范用pypi)
47
- - 增加pil和浏览器渲染做选择(可以选择pil以节省性能性能)
48
- - 删除无用部分(依赖太多难以维护)
44
+ - 在json文件设置的前缀指令,例如设置"云",则指令 云 输出组服务器,云1 输出1号服务器
45
+ - l4图片开启/关闭 超管指令 可以修改输出单图是否为图片输出
49
46
 
50
47
  ## 安装
51
48
 
@@ -102,8 +99,7 @@ conda install nonebot-plugin-l4d2-server
102
99
  ## 主要功能
103
100
 
104
101
  - [ ] 求生服务器-本地多路径操作(传地图等)
105
- - [ ] 批量查询指定ip服务器状态和玩家
106
- - [ ] [求生电信服anne](https://github.com/fantasylidong/CompetitiveWithAnne)[查询~](https://sb.trygek.com/l4d_stats/ranking/index.php)
102
+ - [x] 批量查询指定ip服务器状态和玩家
107
103
 
108
104
  ## [数据结构](./docs/standand.md)
109
105
 
@@ -112,8 +108,6 @@ conda install nonebot-plugin-l4d2-server
112
108
  ## env设置
113
109
 
114
110
  """bash
115
- l4_anne = False
116
- """是否启用anne电信服相关功能"""
117
111
  l4_enable = True
118
112
  """是否全局启用求生功能"""
119
113
  l4_image = False
@@ -132,6 +126,15 @@ conda install nonebot-plugin-l4d2-server
132
126
  - 缤纷彩虹
133
127
  """
134
128
 
129
+ ## 和0.x.x更改部分
130
+
131
+ - 取消了网页控制台(没有卵用)
132
+ - 取消了自动重启(与其他插件功能重复)
133
+ - 取消了git拉取更新(nb规范用pypi)
134
+ - 增加pil和浏览器渲染做选择(可以选择pil以节省性能性能)
135
+ - 删除无用部分(依赖太多难以维护)
136
+ - 删除了anne部分,已移植到[这里](https://github.com/Agnes4m/L4D2UID),通过core插件调用
137
+
135
138
  ## 其他
136
139
 
137
140
  - 本人技术很差,如果您有发现BUG或者更好的建议,欢迎提Issue & Pr
@@ -16,7 +16,7 @@
16
16
  """
17
17
 
18
18
  from pathlib import Path
19
- from typing import TYPE_CHECKING, List, Optional
19
+ from typing import TYPE_CHECKING, List, Optional, Union
20
20
 
21
21
  import aiofiles
22
22
  import ujson as json
@@ -24,10 +24,11 @@ from nonebot.adapters import Message
24
24
  from nonebot.log import logger
25
25
  from nonebot.matcher import Matcher
26
26
  from nonebot.params import CommandArg, CommandStart, RawCommand
27
+ from nonebot.permission import SUPERUSER
27
28
  from nonebot.plugin import on_command
28
29
  from nonebot_plugin_alconna import UniMessage
29
30
 
30
- from .config import config
31
+ from .config import config, config_manager
31
32
  from .l4_help import get_l4d2_core_help
32
33
  from .l4_local import * # noqa: F403
33
34
  from .l4_request import (
@@ -45,7 +46,7 @@ if TYPE_CHECKING:
45
46
 
46
47
  reload_ip()
47
48
 
48
- l4_help = on_command("l4help", aliases={"l4帮助", "l4d2帮助"})
49
+ l4_help = on_command("l4help", aliases={"l4d2帮助"})
49
50
  l4_request = on_command("anne", aliases=COMMAND, priority=10)
50
51
  l4_reload = on_command("l4reload", aliases={"l4刷新,l4重载"})
51
52
  l4_all = on_command("l4all", aliases={"l4全服"})
@@ -59,13 +60,11 @@ config_path = Path(config.l4_path) / "config.json"
59
60
 
60
61
 
61
62
  @l4_help.handle()
62
- async def _(matcher: Matcher):
63
+ async def _():
63
64
  """帮助"""
64
65
  logger.info("开始执行[l4d2帮助]")
65
66
  im = await get_l4d2_core_help()
66
- if isinstance(im, str):
67
- await matcher.finish(im)
68
- await UniMessage.image(raw=im).send()
67
+ await out_msg_out(im)
69
68
 
70
69
 
71
70
  @l4_request.handle()
@@ -74,11 +73,31 @@ async def _(
74
73
  command: str = RawCommand(),
75
74
  args: Message = CommandArg(),
76
75
  ):
77
- """例:
78
- 指令: /橘5
79
- start: /(command开头指令)
80
- command: /橘(响应的全部指令)
81
- args: 5(响应的指令后的数字)
76
+ """
77
+ 异步函数,用于处理特定的指令。
78
+
79
+ Args:
80
+ start (str, optional): 指令的开头部分,默认为 CommandStart() 返回的值。
81
+ command (str, optional): 完整的指令字符串,默认为 RawCommand() 返回的值。
82
+ args (Message, optional): 指令后的参数,默认为 CommandArg() 返回的值。
83
+
84
+ Returns:
85
+ None
86
+
87
+ Examples:
88
+ 示例指令:"/橘5"
89
+ - start: "/" (指令的开头部分)
90
+ - command: "/橘" (完整的指令字符串)
91
+ - args: "5" (指令后的参数)
92
+
93
+ Notes:
94
+ 1. 如果 start 存在,会将 command 中的 start 部分替换为空字符串。
95
+ 2. 如果 command 等于 "anne",则将其替换为 "云"。
96
+ 3. 提取 args 中的纯文本内容,如果内容非空且不是数字,则返回。
97
+ 4. 如果 args 为空,则将其设置为 None。
98
+ 5. 使用 logger 记录处理过程中的信息。
99
+ 6. 调用 get_server_detail 函数获取服务器详情,并根据返回结果发送相应的消息。
100
+ 7. 如果 get_server_detail 返回 None,则发送 "服务器无响应" 的文本消息。
82
101
  """
83
102
 
84
103
  if start:
@@ -93,49 +112,50 @@ async def _(
93
112
  logger.info(f"组:{command} ;数字:{_id}")
94
113
  msg = await get_server_detail(command, _id)
95
114
  if msg is not None:
96
- if isinstance(msg, str):
97
- await UniMessage.text(msg).finish()
98
- if isinstance(msg, bytes):
99
- await UniMessage.image(raw=msg).finish()
115
+ await out_msg_out(msg, is_connect=config.l4_image)
100
116
  else:
101
- await UniMessage.text("服务器无响应").finish()
117
+ await out_msg_out("服务器无响应")
102
118
 
103
119
 
104
120
  @l4_find_player.handle()
105
121
  async def _(
106
122
  args: Message = CommandArg(),
107
123
  ):
124
+ # 以后有时间补img格式
108
125
  msg: str = args.extract_plain_text().strip()
109
126
  tag_list: List[str] = msg.split(" ", maxsplit=1)
110
- if len(tag_list) < 2:
111
- return await UniMessage.text("格式错误,正确格式:/l4find 组名 玩家名").finish()
112
- group, name = tag_list
113
- out: List[OutServer] = await get_server_detail(group, is_img=False) # type: ignore
114
- out_msg = "未找到玩家"
115
- for one in out:
116
- for player in one["player"]:
117
- if name in player.name:
118
- out_msg = await get_ip_server(f"{one['host']}:{one['port']}")
119
-
120
- return await UniMessage.text(out_msg).finish()
127
+ if len(tag_list) == 1:
128
+ await UniMessage.text("未设置组,正在全服查找,时间较长").send()
129
+ name = tag_list[0]
130
+ out: List[OutServer] = await get_server_detail(is_img=False) # type: ignore
131
+ out_msg = "未找到玩家"
132
+ for one in out:
133
+ for player in one["player"]:
134
+ if name in player.name:
135
+ out_msg = await get_ip_server(f"{one['host']}:{one['port']}")
136
+ if len(tag_list) == 2:
137
+ group, name = tag_list
138
+ await UniMessage.text(f"正在查询{group}组").send()
139
+ out: List[OutServer] = await get_server_detail(group=group, is_img=False) # type: ignore
140
+ out_msg = "未找到玩家"
141
+ for one in out:
142
+ for player in one["player"]:
143
+ if name in player.name:
144
+ out_msg = await get_ip_server(f"{one['host']}:{one['port']}")
145
+
146
+ return await out_msg_out(out_msg)
121
147
 
122
148
 
123
149
  @l4_all.handle()
124
150
  async def _():
125
- await UniMessage.text(await get_all_server_detail()).finish()
151
+ await out_msg_out(await get_all_server_detail())
126
152
 
127
153
 
128
154
  @l4_connect.handle()
129
155
  async def _(args: Message = CommandArg()):
130
156
  ip: Optional[str] = args.extract_plain_text()
131
157
  if ip is not None:
132
- await UniMessage.text(await get_ip_server(ip)).finish()
133
-
134
-
135
- # anne部分
136
- if config.l4_anne:
137
- logger.info("加载anne功能")
138
- from .l4_anne import * # noqa: F403
158
+ await out_msg_out(await get_ip_server(ip), is_connect=config.l4_image)
139
159
 
140
160
 
141
161
  @l4_reload.handle()
@@ -151,7 +171,7 @@ async def _(args: Message = CommandArg()):
151
171
  for tag, url in ip_json.items():
152
172
  logger.info(f"重载{tag}的ip")
153
173
  await L4API.get_sourceban(tag, url)
154
- await UniMessage.text("重载ip完成").finish()
174
+ await out_msg_out("重载ip完成")
155
175
 
156
176
 
157
177
  l4_add_ban = on_command("l4addban", aliases={"l4添加ban"})
@@ -182,7 +202,7 @@ async def _(args: Message = CommandArg()):
182
202
  await UniMessage.text(f"文件写入失败: {e}").finish()
183
203
 
184
204
  await L4API.get_sourceban(arg[0], arg[1])
185
- await UniMessage.text(f"添加成功\n组名: {arg[0]}\n网址: {arg[1]}").finish()
205
+ await out_msg_out(f"添加成功\n组名: {arg[0]}\n网址: {arg[1]}")
186
206
 
187
207
 
188
208
  l4_del_ban = on_command("l4delban", aliases={"l4删除ban", "l4移除ban"})
@@ -209,7 +229,7 @@ async def _(args: Message = CommandArg()):
209
229
  del config_data[arg[0]]
210
230
  async with aiofiles.open(config_path, "w", encoding="utf-8") as f:
211
231
  json.dump(config_data, f, ensure_ascii=False, indent=4)
212
- await UniMessage.text(f"删除成功,组名:{arg[0]}").finish()
232
+ await out_msg_out(f"删除成功,组名:{arg[0]}")
213
233
  elif len(arg) == 2:
214
234
  if not Path(Path(config.l4_path) / "config.json").is_file():
215
235
  await UniMessage.text("没有添加过组名").finish()
@@ -226,7 +246,7 @@ async def _(args: Message = CommandArg()):
226
246
  config_datas[arg[0]] = arg[1]
227
247
  async with aiofiles.open(config_path, "w", encoding="utf-8") as f:
228
248
  json.dump(config_datas, f, ensure_ascii=False, indent=4)
229
- await UniMessage.text(f"修改成功,组名:{arg[0]},网址:{arg[1]}").finish()
249
+ await out_msg_out(f"修改成功,组名:{arg[0]},网址:{arg[1]}")
230
250
 
231
251
 
232
252
  @ld_tj.handle()
@@ -239,3 +259,39 @@ async def _(matcher: Matcher):
239
259
  async def _(matcher: Matcher):
240
260
  await matcher.send("正在寻找牢房信息")
241
261
  await matcher.finish(await tj_request("云", "zl"))
262
+
263
+
264
+ async def out_msg_out(
265
+ msg: Union[str, bytes, UniMessage],
266
+ is_connect: bool = False,
267
+ host: str = "",
268
+ port: str = "",
269
+ ):
270
+ if isinstance(msg, UniMessage):
271
+ return await msg.finish()
272
+ if isinstance(msg, str):
273
+ await UniMessage.text(msg).finish()
274
+ if is_connect:
275
+ out = UniMessage.image(raw=msg) + UniMessage.text(
276
+ f"连接到服务器: {host}:{port}",
277
+ )
278
+ return await out.finish()
279
+ return await UniMessage.image(raw=msg).finish()
280
+
281
+
282
+ ## 以下为配置修改
283
+
284
+ img_trung = on_command("l4img", aliases={"l4图片"}, permission=SUPERUSER)
285
+
286
+
287
+ @img_trung.handle()
288
+ async def _(args: Message = CommandArg()):
289
+ arg = args.extract_plain_text().strip().lower()
290
+ if arg == "开启":
291
+ config_manager.update_image_config(enabled=True)
292
+ await out_msg_out("[l4]已开启图片模式")
293
+ elif arg == "关闭":
294
+ config_manager.update_image_config(enabled=False)
295
+ await out_msg_out("[l4]已关闭图片模式")
296
+ else:
297
+ await UniMessage.text("请在参数后加上开启或关闭").finish()
@@ -0,0 +1,94 @@
1
+ from pathlib import Path
2
+
3
+ from nonebot import get_plugin_config
4
+ from nonebot.log import logger
5
+ from pydantic import BaseModel
6
+
7
+ DATAPATH = Path(__file__).parent.joinpath("data")
8
+ DATAOUT = Path("data/L4D2")
9
+ if not Path(DATAOUT / "l4d2.json").exists():
10
+ logger.info("文件 l4d2.json 不存在,已创建并初始化为 {}")
11
+ Path(DATAOUT / "l4d2.json").write_text("{}", encoding="utf-8")
12
+ print(DATAOUT.absolute())
13
+ server_all_path = DATAOUT / "l4d2"
14
+ server_all_path.mkdir(parents=True, exist_ok=True)
15
+
16
+ ICONPATH = DATAPATH / "icon"
17
+
18
+ global map_index
19
+ map_index = 0
20
+
21
+
22
+ class ConfigModel(BaseModel):
23
+ l4_enable: bool = True
24
+ """是否全局启用求生功能"""
25
+ l4_image: bool = True
26
+ """是否启用图片"""
27
+ l4_connect: bool = True
28
+ """是否在查服命令后加入connect ip"""
29
+ l4_path: str = "data/L4D2"
30
+ """插件数据路径"""
31
+ l4_players: int = 4
32
+ """查询总图的时候展示的用户数量"""
33
+ l4_style: str = "default"
34
+ """图片风格"""
35
+ l4_font: str = str(Path(__file__).parent.joinpath("data/font/loli.ttf"))
36
+ """字体"""
37
+ l4_show_ip: bool = True
38
+ """单服务器查询时候是否展示ip直连地址"""
39
+ l4_local: list[str] = []
40
+ """本地服务器路径,填写路径下有`steam_appid.txt`文件"""
41
+
42
+
43
+ config = get_plugin_config(ConfigModel)
44
+
45
+
46
+ class ConfigManager:
47
+ """配置项管理类,提供类型安全的配置更新方法"""
48
+
49
+ def __init__(self):
50
+ self._config = config
51
+
52
+ def update_image_config(self, enabled: bool) -> None:
53
+ """更新图片配置
54
+
55
+ Args:
56
+ enabled: 是否启用图片功能
57
+ """
58
+ self._config.l4_image = enabled
59
+
60
+ def update_style_config(self, style: str) -> None:
61
+ """更新图片风格配置
62
+
63
+ Args:
64
+ style: 图片风格名称
65
+ """
66
+ if not isinstance(style, str):
67
+ raise TypeError("style必须是字符串")
68
+ self._config.l4_style = style
69
+
70
+ def update_connect_config(self, enabled: bool) -> None:
71
+ """更新connect ip配置
72
+
73
+ Args:
74
+ enabled: 是否在查服命令后加入connect ip
75
+ """
76
+ self._config.l4_connect = enabled
77
+
78
+ def update(self, **kwargs) -> None:
79
+ """通用配置更新方法
80
+
81
+ Args:
82
+ **kwargs: 要更新的配置项键值对
83
+
84
+ Raises:
85
+ ValueError: 当传入无效的配置项时
86
+ """
87
+ for key, value in kwargs.items():
88
+ if hasattr(self._config, key):
89
+ setattr(self._config, key, value)
90
+ else:
91
+ raise ValueError(f"无效的配置项: {key}")
92
+
93
+
94
+ config_manager = ConfigManager()
@@ -10,7 +10,7 @@ from ..l4_image.convert import core_font
10
10
  from ..l4_image.model import PluginHelp
11
11
  from .draw import get_help
12
12
 
13
- __version__ = "1.0.2"
13
+ __version__ = "1.0.4"
14
14
  TEXT_PATH = Path(__file__).parent / "texture2d"
15
15
  HELP_DATA = Path(__file__).parent / "Help.json"
16
16