nonebot-plugin-mccheck 0.3.1__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.
- {nonebot_plugin_mccheck-0.3.1 → nonebot_plugin_mccheck-0.3.2}/PKG-INFO +1 -1
- {nonebot_plugin_mccheck-0.3.1 → nonebot_plugin_mccheck-0.3.2}/nonebot_plugin_mccheck/__init__.py +2 -2
- {nonebot_plugin_mccheck-0.3.1 → nonebot_plugin_mccheck-0.3.2}/nonebot_plugin_mccheck/configs.py +1 -1
- {nonebot_plugin_mccheck-0.3.1 → nonebot_plugin_mccheck-0.3.2}/nonebot_plugin_mccheck/utils.py +2 -15
- {nonebot_plugin_mccheck-0.3.1 → nonebot_plugin_mccheck-0.3.2}/pyproject.toml +1 -1
- {nonebot_plugin_mccheck-0.3.1 → nonebot_plugin_mccheck-0.3.2}/LICENSE +0 -0
- {nonebot_plugin_mccheck-0.3.1 → nonebot_plugin_mccheck-0.3.2}/README.md +0 -0
- {nonebot_plugin_mccheck-0.3.1 → nonebot_plugin_mccheck-0.3.2}/nonebot_plugin_mccheck/language.json +0 -0
- {nonebot_plugin_mccheck-0.3.1 → nonebot_plugin_mccheck-0.3.2}/nonebot_plugin_mccheck/templates/Minecraft_AE.ttf +0 -0
- {nonebot_plugin_mccheck-0.3.1 → nonebot_plugin_mccheck-0.3.2}/nonebot_plugin_mccheck/templates/README.md +0 -0
- {nonebot_plugin_mccheck-0.3.1 → nonebot_plugin_mccheck-0.3.2}/nonebot_plugin_mccheck/templates/background.png +0 -0
- {nonebot_plugin_mccheck-0.3.1 → nonebot_plugin_mccheck-0.3.2}/nonebot_plugin_mccheck/templates/default.html +0 -0
- {nonebot_plugin_mccheck-0.3.1 → nonebot_plugin_mccheck-0.3.2}/nonebot_plugin_mccheck/templates/imagelesshoverbg.png +0 -0
- {nonebot_plugin_mccheck-0.3.1 → nonebot_plugin_mccheck-0.3.2}/nonebot_plugin_mccheck/templates/main.css +0 -0
- {nonebot_plugin_mccheck-0.3.1 → nonebot_plugin_mccheck-0.3.2}/nonebot_plugin_mccheck/templates/no_favicon.png +0 -0
{nonebot_plugin_mccheck-0.3.1 → nonebot_plugin_mccheck-0.3.2}/nonebot_plugin_mccheck/__init__.py
RENAMED
|
@@ -12,6 +12,7 @@ from nonebot_plugin_alconna import (
|
|
|
12
12
|
Text,
|
|
13
13
|
UniMessage,
|
|
14
14
|
on_alconna,
|
|
15
|
+
SupportScope
|
|
15
16
|
)
|
|
16
17
|
from nonebot_plugin_uninfo import Uninfo
|
|
17
18
|
|
|
@@ -20,7 +21,6 @@ from .utils import (
|
|
|
20
21
|
change_language_to,
|
|
21
22
|
get_message_list,
|
|
22
23
|
handle_exception,
|
|
23
|
-
is_qbot,
|
|
24
24
|
valid_urlparse,
|
|
25
25
|
)
|
|
26
26
|
|
|
@@ -85,7 +85,7 @@ async def _(host: Match[str], session: Uninfo):
|
|
|
85
85
|
await check.finish(Text(f"{lang_data[lang]['where_port']}"), reply_to=True)
|
|
86
86
|
try:
|
|
87
87
|
message_list = await get_message_list(address, port)
|
|
88
|
-
if
|
|
88
|
+
if session.scope == SupportScope.qq_api:
|
|
89
89
|
for m in message_list:
|
|
90
90
|
await check.send(UniMessage(m), reply_to=True)
|
|
91
91
|
else:
|
{nonebot_plugin_mccheck-0.3.1 → nonebot_plugin_mccheck-0.3.2}/nonebot_plugin_mccheck/utils.py
RENAMED
|
@@ -12,14 +12,13 @@ from mcstatus.responses import (
|
|
|
12
12
|
JavaStatusResponse,
|
|
13
13
|
)
|
|
14
14
|
from nonebot import require
|
|
15
|
-
from nonebot_plugin_uninfo import Uninfo
|
|
16
15
|
|
|
17
16
|
from nonebot.log import logger
|
|
18
17
|
|
|
19
18
|
from .configs import VERSION, lang, lang_data, message_type
|
|
20
19
|
|
|
21
20
|
require("nonebot_plugin_alconna")
|
|
22
|
-
from nonebot_plugin_alconna import Image,
|
|
21
|
+
from nonebot_plugin_alconna import Image, Text
|
|
23
22
|
|
|
24
23
|
|
|
25
24
|
def handle_exception(e):
|
|
@@ -147,7 +146,7 @@ async def get_java(host: str, port: int | None) -> JavaStatusResponse | None:
|
|
|
147
146
|
"""
|
|
148
147
|
address = f"{host}:{port}" if port else host
|
|
149
148
|
try:
|
|
150
|
-
return await (await JavaServer.async_lookup(address)).async_status()
|
|
149
|
+
return await (await JavaServer.async_lookup(address)).async_status(version=760)
|
|
151
150
|
except Exception:
|
|
152
151
|
return None
|
|
153
152
|
|
|
@@ -204,18 +203,6 @@ def valid_urlparse(address: str) -> tuple[str, int | None]:
|
|
|
204
203
|
return tmp.hostname, tmp.port
|
|
205
204
|
|
|
206
205
|
|
|
207
|
-
def is_qbot(session: Uninfo) -> bool:
|
|
208
|
-
"""判断bot是否为qq官bot
|
|
209
|
-
|
|
210
|
-
参数:
|
|
211
|
-
session: Uninfo
|
|
212
|
-
|
|
213
|
-
返回:
|
|
214
|
-
bool: 是否为官bot
|
|
215
|
-
"""
|
|
216
|
-
return session.scope == SupportScope.qq_api
|
|
217
|
-
|
|
218
|
-
|
|
219
206
|
def parse_motd2html(data: str | dict) -> str:
|
|
220
207
|
"""
|
|
221
208
|
解析MOTD数据并转换为带有自定义颜色的HTML字符串。
|
|
File without changes
|
|
File without changes
|
{nonebot_plugin_mccheck-0.3.1 → nonebot_plugin_mccheck-0.3.2}/nonebot_plugin_mccheck/language.json
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|