nonebot-plugin-l4d2-server 0.6.5__py3-none-any.whl → 1.0.0a1__py3-none-any.whl
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.
- nonebot_plugin_l4d2_server/__init__.py +9 -93
- nonebot_plugin_l4d2_server/__main__.py +90 -0
- nonebot_plugin_l4d2_server/config.py +30 -0
- nonebot_plugin_l4d2_server/data/L4D2/image/head/head.png +0 -0
- nonebot_plugin_l4d2_server/data/L4D2/image/header/logo.png +0 -0
- nonebot_plugin_l4d2_server/data/L4D2/image/header/player1.jpg +0 -0
- nonebot_plugin_l4d2_server/data/L4D2/image/template/anne.html +50 -42
- nonebot_plugin_l4d2_server/data/L4D2/image/template/back.png +0 -0
- nonebot_plugin_l4d2_server/data/L4D2/image/template/group_ip.html +1 -2
- nonebot_plugin_l4d2_server/data/L4D2/image/template/help.html +1 -2
- nonebot_plugin_l4d2_server/data/L4D2/image/template/help_dack.html +259 -221
- nonebot_plugin_l4d2_server/data/L4D2/image/template/ip.html +1 -2
- nonebot_plugin_l4d2_server/data/font/loli.ttf +0 -0
- nonebot_plugin_l4d2_server/data/icon//344/273/213/347/273/215.png +0 -0
- nonebot_plugin_l4d2_server/data/icon//344/273/273/345/212/241.png +0 -0
- nonebot_plugin_l4d2_server/data/icon//344/277/241/346/201/257.png +0 -0
- nonebot_plugin_l4d2_server/data/icon//345/205/254/345/221/212.png +0 -0
- nonebot_plugin_l4d2_server/data/icon//345/210/200/345/211/221.png +0 -0
- nonebot_plugin_l4d2_server/data/icon//345/210/207/346/215/242.png +0 -0
- nonebot_plugin_l4d2_server/data/icon//345/210/240/351/231/244.png +0 -0
- nonebot_plugin_l4d2_server/data/icon//345/210/267/346/226/260.png +0 -0
- nonebot_plugin_l4d2_server/data/icon//345/215/241/347/273/204.png +0 -0
- nonebot_plugin_l4d2_server/data/icon//345/223/252/351/207/214.png +0 -0
- nonebot_plugin_l4d2_server/data/icon//345/234/260/345/233/276.png +0 -0
- nonebot_plugin_l4d2_server/data/icon//345/257/274/345/205/245.png +0 -0
- nonebot_plugin_l4d2_server/data/icon//345/257/274/345/207/272.png +0 -0
- nonebot_plugin_l4d2_server/data/icon//345/275/261.png +0 -0
- nonebot_plugin_l4d2_server/data/icon//346/213/274/345/233/276.png +0 -0
- nonebot_plugin_l4d2_server/data/icon//346/216/242/347/264/242.png +0 -0
- nonebot_plugin_l4d2_server/data/icon//346/216/250/351/200/201.png +0 -0
- nonebot_plugin_l4d2_server/data/icon//346/224/266/351/233/206.png +0 -0
- nonebot_plugin_l4d2_server/data/icon//346/224/273/347/225/245.png +0 -0
- nonebot_plugin_l4d2_server/data/icon//346/233/264/346/226/260.png +0 -0
- nonebot_plugin_l4d2_server/data/icon//346/235/220/346/226/231.png +0 -0
- nonebot_plugin_l4d2_server/data/icon//346/237/245/350/257/242.png +0 -0
- nonebot_plugin_l4d2_server/data/icon//346/240/241/351/252/214.png +0 -0
- nonebot_plugin_l4d2_server/data/icon//346/257/217/346/234/210.png +0 -0
- nonebot_plugin_l4d2_server/data/icon//346/267/261/346/270/212.png +0 -0
- nonebot_plugin_l4d2_server/data/icon//346/267/273/345/212/240.png +0 -0
- nonebot_plugin_l4d2_server/data/icon//346/270/205/351/231/244.png +0 -0
- nonebot_plugin_l4d2_server/data/icon//347/212/266/346/200/201.png +0 -0
- nonebot_plugin_l4d2_server/data/icon//347/255/276/345/210/260.png +0 -0
- nonebot_plugin_l4d2_server/data/icon//347/273/221/345/256/232.png +0 -0
- nonebot_plugin_l4d2_server/data/icon//350/241/250.png +0 -0
- nonebot_plugin_l4d2_server/data/icon//350/241/250/346/203/205.png +0 -0
- nonebot_plugin_l4d2_server/data/icon//350/247/222/350/211/262.png +0 -0
- nonebot_plugin_l4d2_server/data/icon//350/256/260/345/275/225.png +0 -0
- nonebot_plugin_l4d2_server/data/icon//351/205/215/347/275/256.png +0 -0
- nonebot_plugin_l4d2_server/data/icon//351/207/215/345/220/257.png +0 -0
- nonebot_plugin_l4d2_server/data/img/l4d2.png +0 -0
- nonebot_plugin_l4d2_server/data/img/linux.png +0 -0
- nonebot_plugin_l4d2_server/data/img/vac.png +0 -0
- nonebot_plugin_l4d2_server/data/img/white.png +0 -0
- nonebot_plugin_l4d2_server/l4_help/Help.json +65 -0
- nonebot_plugin_l4d2_server/l4_help/__init__.py +57 -0
- nonebot_plugin_l4d2_server/l4_help/draw.py +206 -0
- nonebot_plugin_l4d2_server/l4_help/icon//344/273/213/347/273/215.png +0 -0
- nonebot_plugin_l4d2_server/l4_help/icon//344/273/273/345/212/241.png +0 -0
- nonebot_plugin_l4d2_server/l4_help/icon//344/277/241/346/201/257.png +0 -0
- nonebot_plugin_l4d2_server/l4_help/icon//345/205/254/345/221/212.png +0 -0
- nonebot_plugin_l4d2_server/l4_help/icon//345/210/200/345/211/221.png +0 -0
- nonebot_plugin_l4d2_server/l4_help/icon//345/210/207/346/215/242.png +0 -0
- nonebot_plugin_l4d2_server/l4_help/icon//345/210/240/351/231/244.png +0 -0
- nonebot_plugin_l4d2_server/l4_help/icon//345/210/267/346/226/260.png +0 -0
- nonebot_plugin_l4d2_server/l4_help/icon//345/215/241/347/273/204.png +0 -0
- nonebot_plugin_l4d2_server/l4_help/icon//345/223/252/351/207/214.png +0 -0
- nonebot_plugin_l4d2_server/l4_help/icon//345/234/260/345/233/276.png +0 -0
- nonebot_plugin_l4d2_server/l4_help/icon//345/257/274/345/205/245.png +0 -0
- nonebot_plugin_l4d2_server/l4_help/icon//345/257/274/345/207/272.png +0 -0
- nonebot_plugin_l4d2_server/l4_help/icon//345/275/261.png +0 -0
- nonebot_plugin_l4d2_server/l4_help/icon//346/213/274/345/233/276.png +0 -0
- nonebot_plugin_l4d2_server/l4_help/icon//346/216/242/347/264/242.png +0 -0
- nonebot_plugin_l4d2_server/l4_help/icon//346/216/250/351/200/201.png +0 -0
- nonebot_plugin_l4d2_server/l4_help/icon//346/224/266/351/233/206.png +0 -0
- nonebot_plugin_l4d2_server/l4_help/icon//346/224/273/347/225/245.png +0 -0
- nonebot_plugin_l4d2_server/l4_help/icon//346/233/264/346/226/260.png +0 -0
- nonebot_plugin_l4d2_server/l4_help/icon//346/235/220/346/226/231.png +0 -0
- nonebot_plugin_l4d2_server/l4_help/icon//346/237/245/350/257/242.png +0 -0
- nonebot_plugin_l4d2_server/l4_help/icon//346/240/241/351/252/214.png +0 -0
- nonebot_plugin_l4d2_server/l4_help/icon//346/257/217/346/234/210.png +0 -0
- nonebot_plugin_l4d2_server/l4_help/icon//346/267/261/346/270/212.png +0 -0
- nonebot_plugin_l4d2_server/l4_help/icon//346/267/273/345/212/240.png +0 -0
- nonebot_plugin_l4d2_server/l4_help/icon//346/270/205/351/231/244.png +0 -0
- nonebot_plugin_l4d2_server/l4_help/icon//347/212/266/346/200/201.png +0 -0
- nonebot_plugin_l4d2_server/l4_help/icon//347/255/276/345/210/260.png +0 -0
- nonebot_plugin_l4d2_server/l4_help/icon//347/273/221/345/256/232.png +0 -0
- nonebot_plugin_l4d2_server/l4_help/icon//350/241/250.png +0 -0
- nonebot_plugin_l4d2_server/l4_help/icon//350/241/250/346/203/205.png +0 -0
- nonebot_plugin_l4d2_server/l4_help/icon//350/247/222/350/211/262.png +0 -0
- nonebot_plugin_l4d2_server/l4_help/icon//350/256/260/345/275/225.png +0 -0
- nonebot_plugin_l4d2_server/l4_help/icon//351/205/215/347/275/256.png +0 -0
- nonebot_plugin_l4d2_server/l4_help/icon//351/207/215/345/220/257.png +0 -0
- nonebot_plugin_l4d2_server/l4_help/texture2d/badge.png +0 -0
- nonebot_plugin_l4d2_server/l4_help/texture2d/banner.png +0 -0
- nonebot_plugin_l4d2_server/l4_help/texture2d/bg.jpg +0 -0
- nonebot_plugin_l4d2_server/l4_help/texture2d/button.png +0 -0
- nonebot_plugin_l4d2_server/l4_help/texture2d/icon.png +0 -0
- nonebot_plugin_l4d2_server/l4_image/__init__.py +16 -0
- nonebot_plugin_l4d2_server/l4_image/convert.py +175 -0
- nonebot_plugin_l4d2_server/{l4d2_image → l4_image}/download.py +6 -30
- nonebot_plugin_l4d2_server/{l4d2_image/__init__.py → l4_image/html_img.py} +55 -45
- nonebot_plugin_l4d2_server/l4_image/image_tools.py +468 -0
- nonebot_plugin_l4d2_server/l4_image/img/anne/anne.html +60 -0
- nonebot_plugin_l4d2_server/l4_image/img/anne/back.png +0 -0
- nonebot_plugin_l4d2_server/l4_image/img/anne/group_ip.html +259 -0
- nonebot_plugin_l4d2_server/l4_image/img/anne/ip.html +55 -0
- nonebot_plugin_l4d2_server/l4_image/img/head/head.png +0 -0
- nonebot_plugin_l4d2_server/l4_image/img/header/logo.png +0 -0
- nonebot_plugin_l4d2_server/l4_image/img/header/player1.jpg +0 -0
- nonebot_plugin_l4d2_server/l4_image/img/template/Bocchi_The_Rock.html +312 -0
- nonebot_plugin_l4d2_server/l4_image/img/template/Bocchi_The_Rock.png +0 -0
- nonebot_plugin_l4d2_server/l4_image/img/template/HYPixel11pxU-2.ttf +0 -0
- nonebot_plugin_l4d2_server/l4_image/img/template/Pixel.html +350 -0
- nonebot_plugin_l4d2_server/l4_image/img/template/Pixel.png +0 -0
- nonebot_plugin_l4d2_server/l4_image/img/template/Rainbow.html +321 -0
- nonebot_plugin_l4d2_server/l4_image/img/template/Rainbow.png +0 -0
- nonebot_plugin_l4d2_server/l4_image/img/template/Tutumianhuatang-Bold-2.ttf +0 -0
- nonebot_plugin_l4d2_server/l4_image/img/template/bilibili.svg +1 -0
- nonebot_plugin_l4d2_server/l4_image/img/template/fingerprint.svg +15 -0
- nonebot_plugin_l4d2_server/l4_image/img/template/github.svg +1 -0
- nonebot_plugin_l4d2_server/l4_image/img/template/l.svg +9 -0
- nonebot_plugin_l4d2_server/l4_image/img/template/m.svg +1 -0
- nonebot_plugin_l4d2_server/l4_image/img/template/normal.html +257 -0
- nonebot_plugin_l4d2_server/l4_image/img/template/vue.css +531 -0
- nonebot_plugin_l4d2_server/l4_image/img/template/w.svg +1 -0
- nonebot_plugin_l4d2_server/l4_image/img/template//345/276/256/350/275/257/351/233/205/351/273/221.ttf +0 -0
- nonebot_plugin_l4d2_server/l4_image/model.py +15 -0
- nonebot_plugin_l4d2_server/{l4d2_image → l4_image}/vtfs.py +2 -0
- nonebot_plugin_l4d2_server/l4_request/__init__.py +84 -0
- nonebot_plugin_l4d2_server/l4_request/draw_msg.py +88 -0
- nonebot_plugin_l4d2_server/utils/api/api.py +4 -0
- nonebot_plugin_l4d2_server/utils/api/models.py +29 -0
- nonebot_plugin_l4d2_server/utils/api/request.py +119 -0
- nonebot_plugin_l4d2_server/utils/database/models.py +29 -0
- nonebot_plugin_l4d2_server/{l4d2_utils → utils}/utils.py +52 -55
- {nonebot_plugin_l4d2_server-0.6.5.dist-info → nonebot_plugin_l4d2_server-1.0.0a1.dist-info}/METADATA +47 -64
- nonebot_plugin_l4d2_server-1.0.0a1.dist-info/RECORD +144 -0
- {nonebot_plugin_l4d2_server-0.6.5.dist-info → nonebot_plugin_l4d2_server-1.0.0a1.dist-info}/WHEEL +1 -1
- nonebot_plugin_l4d2_server/l4d2_anne/__init__.py +0 -95
- nonebot_plugin_l4d2_server/l4d2_anne/analysis.py +0 -54
- nonebot_plugin_l4d2_server/l4d2_anne/anne_telecom.py +0 -79
- nonebot_plugin_l4d2_server/l4d2_anne/server.py +0 -47
- nonebot_plugin_l4d2_server/l4d2_anne/startand.py +0 -17
- nonebot_plugin_l4d2_server/l4d2_anne/utils.py +0 -294
- nonebot_plugin_l4d2_server/l4d2_data/__init__.py +0 -105
- nonebot_plugin_l4d2_server/l4d2_data/config.py +0 -18
- nonebot_plugin_l4d2_server/l4d2_data/database.py +0 -0
- nonebot_plugin_l4d2_server/l4d2_data/players.py +0 -100
- nonebot_plugin_l4d2_server/l4d2_data/serverip.py +0 -40
- nonebot_plugin_l4d2_server/l4d2_file/__init__.py +0 -223
- nonebot_plugin_l4d2_server/l4d2_file/ayromote.py +0 -64
- nonebot_plugin_l4d2_server/l4d2_file/input_json.py +0 -77
- nonebot_plugin_l4d2_server/l4d2_file/remote.py +0 -86
- nonebot_plugin_l4d2_server/l4d2_file/utils.py +0 -104
- nonebot_plugin_l4d2_server/l4d2_image/htmlimg.py +0 -18
- nonebot_plugin_l4d2_server/l4d2_image/images.py +0 -96
- nonebot_plugin_l4d2_server/l4d2_image/one.py +0 -44
- nonebot_plugin_l4d2_server/l4d2_image/send_image_tool.py +0 -32
- nonebot_plugin_l4d2_server/l4d2_image/steam.py +0 -63
- nonebot_plugin_l4d2_server/l4d2_push/__init__.py +0 -226
- nonebot_plugin_l4d2_server/l4d2_queries/__init__.py +0 -326
- nonebot_plugin_l4d2_server/l4d2_queries/himi.py +0 -113
- nonebot_plugin_l4d2_server/l4d2_queries/local_ip.py +0 -41
- nonebot_plugin_l4d2_server/l4d2_queries/qqgroup.py +0 -370
- nonebot_plugin_l4d2_server/l4d2_queries/send_msg.py +0 -131
- nonebot_plugin_l4d2_server/l4d2_queries/utils.py +0 -212
- nonebot_plugin_l4d2_server/l4d2_server/__init__.py +0 -118
- nonebot_plugin_l4d2_server/l4d2_server/index.py +0 -0
- nonebot_plugin_l4d2_server/l4d2_server/rcon.py +0 -53
- nonebot_plugin_l4d2_server/l4d2_server/workshop.py +0 -82
- nonebot_plugin_l4d2_server/l4d2_update/__init__.py +0 -135
- nonebot_plugin_l4d2_server/l4d2_update/draw_update_log.py +0 -45
- nonebot_plugin_l4d2_server/l4d2_update/restart.py +0 -69
- nonebot_plugin_l4d2_server/l4d2_update/update.py +0 -53
- nonebot_plugin_l4d2_server/l4d2_utils/classcal.py +0 -53
- nonebot_plugin_l4d2_server/l4d2_utils/command.py +0 -23
- nonebot_plugin_l4d2_server/l4d2_utils/config.py +0 -196
- nonebot_plugin_l4d2_server/l4d2_utils/message.py +0 -59
- nonebot_plugin_l4d2_server/l4d2_utils/rule.py +0 -35
- nonebot_plugin_l4d2_server/l4d2_utils/seach.py +0 -43
- nonebot_plugin_l4d2_server/l4d2_utils/txt_to_img.py +0 -32
- nonebot_plugin_l4d2_server/l4d2_web/web.py +0 -277
- nonebot_plugin_l4d2_server/l4d2_web/webUI.py +0 -498
- nonebot_plugin_l4d2_server/l4d2_web/webUI_s.py +0 -94
- nonebot_plugin_l4d2_server-0.6.5.dist-info/RECORD +0 -70
- {nonebot_plugin_l4d2_server-0.6.5.dist-info → nonebot_plugin_l4d2_server-1.0.0a1.dist-info}/licenses/LICENSE +0 -0
@@ -15,115 +15,31 @@
|
|
15
15
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
16
16
|
"""
|
17
17
|
|
18
|
-
|
19
18
|
from nonebot import get_driver, require
|
20
19
|
|
21
|
-
require("nonebot_plugin_apscheduler") # noqa: F401
|
22
|
-
require("nonebot_plugin_saa") # noqa: F401
|
23
20
|
require("nonebot_plugin_htmlrender") # noqa: F401
|
24
|
-
require("
|
25
|
-
scheduler = require("nonebot_plugin_apscheduler").scheduler
|
26
|
-
|
27
|
-
from nonebot.adapters.onebot.v11 import Bot, GroupMessageEvent
|
28
|
-
from nonebot.log import logger
|
29
|
-
from nonebot.matcher import Matcher
|
30
|
-
from nonebot.plugin import PluginMetadata
|
31
|
-
from nonebot.typing import T_State
|
21
|
+
require("nonebot_plugin_alconna")
|
32
22
|
|
33
|
-
from
|
23
|
+
from nonebot import require
|
24
|
+
from nonebot.plugin import PluginMetadata, inherit_supported_adapters
|
34
25
|
|
35
|
-
|
36
|
-
from .
|
37
|
-
from .
|
38
|
-
from .l4d2_utils.command import help_, search_api
|
39
|
-
from .l4d2_utils.config import l4_config
|
40
|
-
from .l4d2_utils.utils import upload_file
|
41
|
-
from .l4d2_web import web, webUI # noqa: F401
|
26
|
+
from . import __main__ as __main__ # noqa: E402
|
27
|
+
from .config import ConfigModel # noqa: E402
|
28
|
+
from .l4_help import __version__
|
42
29
|
|
43
30
|
driver = get_driver()
|
44
31
|
|
45
|
-
|
32
|
+
|
46
33
|
__plugin_meta__ = PluginMetadata(
|
47
34
|
name="求生之路小助手",
|
48
35
|
description="可用于管理求生之路查服和本地管理",
|
49
36
|
usage="群内对有关求生之路的查询和操作",
|
37
|
+
config=ConfigModel,
|
50
38
|
type="application",
|
51
39
|
homepage="https://github.com/Agnes4m/nonebot_plugin_l4d2_server",
|
52
|
-
supported_adapters=
|
40
|
+
supported_adapters=inherit_supported_adapters("nonebot_plugin_alconna"),
|
53
41
|
extra={
|
54
42
|
"version": __version__,
|
55
43
|
"author": "Agnes4m <Z735803792@163.com>",
|
56
44
|
},
|
57
45
|
)
|
58
|
-
|
59
|
-
|
60
|
-
"""相当于启动就检查数据库"""
|
61
|
-
|
62
|
-
|
63
|
-
@help_.handle()
|
64
|
-
async def _(matcher: Matcher):
|
65
|
-
msg = """=====求生机器人帮助=====
|
66
|
-
1、电信服战绩查询【求生anne | Ranne[id/steamid/@]】
|
67
|
-
2、电信服绑定【求生绑定[id/steamid]】",
|
68
|
-
3、电信服状态查询【云xx】
|
69
|
-
4、创意工坊下载【创意工坊下载[物品id/链接]】
|
70
|
-
5、指定ip查询【求生ip[ip]】(可以是域名)
|
71
|
-
6、求生喷漆制作【求生喷漆】
|
72
|
-
7、本地服务器相关【l4地图上传】【l4地图改名】【l4地图删除】【l4路径】【l4插件】
|
73
|
-
8、ip导入(私聊发送json文件,格式参考下方链接中readme)
|
74
|
-
9、内置ip更新【l4公益服更新】【求生更新anne】
|
75
|
-
项目地址:https://github.com/Agnes4m/nonebot_plugin_l4d2_server
|
76
|
-
"""
|
77
|
-
await matcher.finish(msg)
|
78
|
-
|
79
|
-
|
80
|
-
@search_api.got("is_sure", prompt='如果需要上传,请发送 "yes"')
|
81
|
-
async def _(matcher: Matcher, bot: Bot, event: GroupMessageEvent, state: T_State):
|
82
|
-
if not l4_config.l4_group_upload:
|
83
|
-
return
|
84
|
-
is_sure = str(state["is_sure"])
|
85
|
-
if is_sure == "yes":
|
86
|
-
data_dict: dict = state["maps"][0]
|
87
|
-
if isinstance(data_dict, dict):
|
88
|
-
logger.info("开始上传")
|
89
|
-
if l4_config.l4_only:
|
90
|
-
reu = await url_to_byte_name(data_dict["url"], "htp")
|
91
|
-
else:
|
92
|
-
reu = await url_to_byte_name(data_dict["url"])
|
93
|
-
if not reu:
|
94
|
-
return
|
95
|
-
data_file, file_name = reu
|
96
|
-
if data_file:
|
97
|
-
await matcher.send("获取地址成功,尝试上传")
|
98
|
-
await upload_file(bot, event, data_file, file_name)
|
99
|
-
else:
|
100
|
-
await search_api.send("出错了,原因是下载链接不存在")
|
101
|
-
else:
|
102
|
-
...
|
103
|
-
# logger.info("开始上传")
|
104
|
-
# for data_one in data_dict:
|
105
|
-
# reu = await url_to_byte_name(data_one["url"])
|
106
|
-
# if not reu:
|
107
|
-
# return
|
108
|
-
# data_file, file_name = reu
|
109
|
-
# await all_zip_to_one()
|
110
|
-
# await upload_file(bot, event, data_file, file_name)
|
111
|
-
else:
|
112
|
-
await matcher.finish("已取消上传")
|
113
|
-
|
114
|
-
|
115
|
-
# @reload_ip.handle()
|
116
|
-
# async def _(matcher:Matcher):
|
117
|
-
# global matchers
|
118
|
-
# await matcher.send('正在重载ip,可能需要一点时间')
|
119
|
-
# for _, l4_matchers in matchers.items():
|
120
|
-
# for l4_matcher in l4_matchers:
|
121
|
-
# l4_matcher.destroy()
|
122
|
-
# await get_des_ip()
|
123
|
-
# await matcher.finish('已重载ip')
|
124
|
-
|
125
|
-
|
126
|
-
@driver.on_shutdown
|
127
|
-
async def close_db():
|
128
|
-
"""关闭数据库"""
|
129
|
-
sq_L4D2._close() # noqa: SLF001
|
@@ -0,0 +1,90 @@
|
|
1
|
+
"""
|
2
|
+
* Copyright (c) 2023, Agnes Digital
|
3
|
+
*
|
4
|
+
* This program is free software: you can redistribute it and/or modify
|
5
|
+
* it under the terms of the GNU General Public License as published by
|
6
|
+
* the Free Software Foundation, either version 3 of the License, or
|
7
|
+
* (at your option) any later version.
|
8
|
+
*
|
9
|
+
* This program is distributed in the hope that it will be useful,
|
10
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12
|
+
* GNU General Public License for more details.
|
13
|
+
*
|
14
|
+
* You should have received a copy of the GNU General Public License
|
15
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
16
|
+
"""
|
17
|
+
|
18
|
+
from typing import Optional
|
19
|
+
|
20
|
+
from nonebot import require
|
21
|
+
from nonebot.adapters import Message
|
22
|
+
from nonebot.log import logger
|
23
|
+
from nonebot.matcher import Matcher
|
24
|
+
from nonebot.params import CommandArg, CommandStart, RawCommand
|
25
|
+
from nonebot.plugin import on_command
|
26
|
+
|
27
|
+
require("nonebot_plugin_alconna")
|
28
|
+
from nonebot_plugin_alconna import UniMessage
|
29
|
+
|
30
|
+
from .l4_help import get_l4d2_core_help
|
31
|
+
from .l4_request import COMMAND, get_ip_server, get_server_detail, reload_ip
|
32
|
+
|
33
|
+
l4_help = on_command("l4帮助", aliases={"l4help", "l4d2帮助"})
|
34
|
+
l4_request = on_command("anne", aliases=COMMAND)
|
35
|
+
l4_reload = on_command("l4重载", aliases={"l4刷新"})
|
36
|
+
l4_connect = on_command("connect", aliases={"l4连接"})
|
37
|
+
|
38
|
+
|
39
|
+
@l4_help.handle()
|
40
|
+
async def _(matcher: Matcher):
|
41
|
+
"""帮助"""
|
42
|
+
logger.info("开始执行[l4d2帮助]")
|
43
|
+
im = await get_l4d2_core_help()
|
44
|
+
print(type(im))
|
45
|
+
if isinstance(im, str):
|
46
|
+
await matcher.finish(im)
|
47
|
+
await UniMessage.image(raw=im).send()
|
48
|
+
|
49
|
+
|
50
|
+
@l4_request.handle()
|
51
|
+
async def _(
|
52
|
+
start: str = CommandStart(),
|
53
|
+
command: str = RawCommand(),
|
54
|
+
args: Message = CommandArg(),
|
55
|
+
):
|
56
|
+
"""例:
|
57
|
+
指令: /橘5
|
58
|
+
start: /(command开头指令)
|
59
|
+
command: /橘(响应的全部指令)
|
60
|
+
args: 5(响应的指令后的数字)
|
61
|
+
"""
|
62
|
+
|
63
|
+
if start:
|
64
|
+
command = command.replace(start, "")
|
65
|
+
if command == "anne":
|
66
|
+
command = "云"
|
67
|
+
_id: Optional[str] = args.extract_plain_text()
|
68
|
+
if not _id:
|
69
|
+
_id = None
|
70
|
+
logger.info(f"组:{command} ;数字:{_id}")
|
71
|
+
msg = await get_server_detail(command, _id)
|
72
|
+
if msg is not None:
|
73
|
+
if isinstance(msg, str):
|
74
|
+
await UniMessage.text(msg).finish()
|
75
|
+
await UniMessage.image(raw=msg).finish()
|
76
|
+
else:
|
77
|
+
await UniMessage.text("没有这个服呢").send()
|
78
|
+
|
79
|
+
|
80
|
+
@l4_connect.handle()
|
81
|
+
async def _(args: Message = CommandArg()):
|
82
|
+
ip: Optional[str] = args.extract_plain_text()
|
83
|
+
if ip is not None:
|
84
|
+
await UniMessage.text(await get_ip_server(ip)).finish()
|
85
|
+
|
86
|
+
|
87
|
+
@l4_reload.handle()
|
88
|
+
async def _():
|
89
|
+
reload_ip()
|
90
|
+
logger.success("重载ip完成")
|
@@ -0,0 +1,30 @@
|
|
1
|
+
from pathlib import Path
|
2
|
+
|
3
|
+
from nonebot import get_plugin_config
|
4
|
+
from pydantic import BaseModel
|
5
|
+
|
6
|
+
DATAPATH = Path(__file__).parent.joinpath("data")
|
7
|
+
DATAOUT = Path("data/L4D2")
|
8
|
+
server_all_path = DATAOUT / "l4d2"
|
9
|
+
server_all_path.mkdir(parents=True, exist_ok=True)
|
10
|
+
|
11
|
+
ICONPATH = DATAPATH / "icon"
|
12
|
+
|
13
|
+
|
14
|
+
class ConfigModel(BaseModel):
|
15
|
+
l4_anne: bool = False
|
16
|
+
"""是否启用anne电信服相关功能"""
|
17
|
+
l4_enable: bool = True
|
18
|
+
"""是否全局启用求生功能"""
|
19
|
+
l4_image: bool = False
|
20
|
+
"""是否启用图片"""
|
21
|
+
l4_connect: bool = True
|
22
|
+
"""是否在查服命令后加入connect ip"""
|
23
|
+
l4_path: str = "data/L4D2"
|
24
|
+
"""插件数据路径"""
|
25
|
+
l4_players: int = 4
|
26
|
+
"""查询总图的时候展示的用户数量"""
|
27
|
+
l4_style: str = "default"
|
28
|
+
|
29
|
+
|
30
|
+
config = get_plugin_config(ConfigModel)
|
Binary file
|
Binary file
|
Binary file
|
@@ -1,17 +1,24 @@
|
|
1
1
|
<!DOCTYPE html>
|
2
|
+
|
2
3
|
<head>
|
3
4
|
<link rel="stylesheet" type="text/css" href="vue.css">
|
4
5
|
</head>
|
5
6
|
</br>
|
7
|
+
|
6
8
|
<body style="background-image: url('back.png'); background-size: cover;">
|
7
9
|
<font color="yellow">
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
10
|
+
{% for item in data %}
|
11
|
+
<h1>
|
12
|
+
<center>求生药役anne电信服数据</center>
|
13
|
+
</h1>
|
14
|
+
<div class="scissors" style="border-top:1px dashed orange;">
|
15
|
+
</div>
|
16
|
+
<h3>
|
17
|
+
<center>
|
18
|
+
{% for msg_one in item.one_msg %}
|
19
|
+
{{ msg_one }}<br>
|
20
|
+
{% endfor %}</center>
|
21
|
+
</h3>
|
15
22
|
</font>
|
16
23
|
<div class="scissors" style="border-top:1px dashed orange;">
|
17
24
|
</div>
|
@@ -20,41 +27,42 @@
|
|
20
27
|
<tbody>
|
21
28
|
<tr>
|
22
29
|
<td rowspan="6">
|
23
|
-
<img src={{item.header}}
|
30
|
+
<img src={{item.header}} width="200" height="200" style="border-radius: 50%;">
|
24
31
|
</td>
|
25
32
|
<td>昵  称 | {{item.name}}</td>
|
26
33
|
<td>Steam id | {{item.Steam_ID}}</td>
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
</div>
|
52
|
-
<font color="yellow">
|
53
|
-
{% endfor %}
|
54
|
-
<h5
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
</
|
59
|
-
</
|
60
|
-
</
|
34
|
+
</tr>
|
35
|
+
<tr>
|
36
|
+
<td>游玩时间 | {{item.play_time}}</td>
|
37
|
+
<td>最后上线 | {{item.last_online}}</td>
|
38
|
+
</tr>
|
39
|
+
<tr>
|
40
|
+
<td>排  行 | {{item.rank}}</td>
|
41
|
+
|
42
|
+
<td>分  数 | {{item.points}}</td>
|
43
|
+
</tr>
|
44
|
+
<tr>
|
45
|
+
<td>分数 / 分 | {{item.point_min}}</td>
|
46
|
+
<td>小僵尸数 | {{item.killed}}</td>
|
47
|
+
</tr>
|
48
|
+
<tr>
|
49
|
+
<td>爆  头 | {{item.shut}}</td>
|
50
|
+
<td>爆 头 率 | {{item.out}}</td>
|
51
|
+
</tr>
|
52
|
+
<tr>
|
53
|
+
<td>游玩次数 | {{item.playtimes}}</td>
|
54
|
+
<td>救 援 关 | {{item.last_one}}</td>
|
55
|
+
</tr>
|
56
|
+
</tbody>
|
57
|
+
</table>
|
58
|
+
</div>
|
59
|
+
<font color="yellow">
|
60
|
+
{% endfor %}
|
61
|
+
<h5>
|
62
|
+
<center>©爱丽数码</center></br>
|
63
|
+
<center>
|
64
|
+
Power by Nonebot2 & Design by Agnes Digital
|
65
|
+
</center>
|
66
|
+
</h5>
|
67
|
+
</font>
|
68
|
+
</body>
|
Binary file
|