Skip to content

Commit

Permalink
chore
Browse files Browse the repository at this point in the history
  • Loading branch information
lgc2333 committed Sep 14, 2023
1 parent 17f28bd commit faf1590
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions nonebot_plugin_picmcstat/draw.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,16 +316,17 @@ async def draw(ip: str, svr_type: ServerType) -> Union[BytesIO, str]:
if not ip:
return draw_help(svr_type)

original_ip = ip
ip = format_ip(ip)

if svr_type == "je":
return draw_java(
await (await JavaServer.async_lookup(format_ip(ip))).async_status(),
ip,
)
server = await JavaServer.async_lookup(ip)
status = await server.async_status()
return draw_java(status, original_ip)

return draw_bedrock(
await BedrockServer.lookup(format_ip(ip)).async_status(),
ip,
)
# else:
status = await BedrockServer.lookup(ip).async_status()
return draw_bedrock(status, original_ip)

except Exception as e:
logger.exception("获取服务器状态/画服务器状态图出错")
Expand Down

0 comments on commit faf1590

Please sign in to comment.