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.
Files changed (15) hide show
  1. {nonebot_plugin_mccheck-0.3.1 → nonebot_plugin_mccheck-0.3.2}/PKG-INFO +1 -1
  2. {nonebot_plugin_mccheck-0.3.1 → nonebot_plugin_mccheck-0.3.2}/nonebot_plugin_mccheck/__init__.py +2 -2
  3. {nonebot_plugin_mccheck-0.3.1 → nonebot_plugin_mccheck-0.3.2}/nonebot_plugin_mccheck/configs.py +1 -1
  4. {nonebot_plugin_mccheck-0.3.1 → nonebot_plugin_mccheck-0.3.2}/nonebot_plugin_mccheck/utils.py +2 -15
  5. {nonebot_plugin_mccheck-0.3.1 → nonebot_plugin_mccheck-0.3.2}/pyproject.toml +1 -1
  6. {nonebot_plugin_mccheck-0.3.1 → nonebot_plugin_mccheck-0.3.2}/LICENSE +0 -0
  7. {nonebot_plugin_mccheck-0.3.1 → nonebot_plugin_mccheck-0.3.2}/README.md +0 -0
  8. {nonebot_plugin_mccheck-0.3.1 → nonebot_plugin_mccheck-0.3.2}/nonebot_plugin_mccheck/language.json +0 -0
  9. {nonebot_plugin_mccheck-0.3.1 → nonebot_plugin_mccheck-0.3.2}/nonebot_plugin_mccheck/templates/Minecraft_AE.ttf +0 -0
  10. {nonebot_plugin_mccheck-0.3.1 → nonebot_plugin_mccheck-0.3.2}/nonebot_plugin_mccheck/templates/README.md +0 -0
  11. {nonebot_plugin_mccheck-0.3.1 → nonebot_plugin_mccheck-0.3.2}/nonebot_plugin_mccheck/templates/background.png +0 -0
  12. {nonebot_plugin_mccheck-0.3.1 → nonebot_plugin_mccheck-0.3.2}/nonebot_plugin_mccheck/templates/default.html +0 -0
  13. {nonebot_plugin_mccheck-0.3.1 → nonebot_plugin_mccheck-0.3.2}/nonebot_plugin_mccheck/templates/imagelesshoverbg.png +0 -0
  14. {nonebot_plugin_mccheck-0.3.1 → nonebot_plugin_mccheck-0.3.2}/nonebot_plugin_mccheck/templates/main.css +0 -0
  15. {nonebot_plugin_mccheck-0.3.1 → nonebot_plugin_mccheck-0.3.2}/nonebot_plugin_mccheck/templates/no_favicon.png +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nonebot-plugin-mccheck
3
- Version: 0.3.1
3
+ Version: 0.3.2
4
4
  Summary: Minecraft服务器状态查询的nonebot插件,支持IPv6/Minecraft server status query plugin for nonebot, IPv6 supported
5
5
  License: GPL-3.0
6
6
  License-File: LICENSE
@@ -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 is_qbot(session):
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:
@@ -28,4 +28,4 @@ def readInfo(file: str) -> dict:
28
28
  message_type = config.type
29
29
  lang = config.language
30
30
  lang_data = readInfo("language.json")
31
- VERSION = "0.3.1"
31
+ VERSION = "0.3.2"
@@ -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, SupportScope, Text
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字符串。
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "nonebot-plugin-mccheck"
3
- version = "0.3.1"
3
+ version = "0.3.2"
4
4
  description = "Minecraft服务器状态查询的nonebot插件,支持IPv6/Minecraft server status query plugin for nonebot, IPv6 supported"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.9"