Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
lgc2333 committed Nov 13, 2024
1 parent 3c935d5 commit a2fe16c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,10 @@ Telegram:[@lgc2333](https://t.me/lgc2333)

## 📝 更新日志

### 0.6.3

- fix [#22](https://github.com/lgc-NB2Dev/nonebot-plugin-picmcstat/issues/22)

### 0.6.2

- 允许自定义向 Java 服务器发送的客户端协议版本,且提高默认协议版本以解决部分服务器 Motd 渐变显示异常的问题
Expand Down
2 changes: 1 addition & 1 deletion nonebot_plugin_picmcstat/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from . import __main__ as __main__ # noqa: E402
from .config import ConfigClass # noqa: E402

__version__ = "0.6.2"
__version__ = "0.6.3"
__plugin_meta__ = PluginMetadata(
name="PicMCStat",
description="将一个 Minecraft 服务器的 MOTD 信息绘制为一张图片",
Expand Down
6 changes: 4 additions & 2 deletions nonebot_plugin_picmcstat/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,11 @@ def trim_motd(motd: List[ParsedMotdComponent]) -> List[ParsedMotdComponent]:

in_content = False
for comp in motd:
if (not isinstance(comp, str)) or (not comp):
if not isinstance(comp, str):
modified_motd.append(comp)
continue
if not comp:
continue

if not in_content:
if comp[0] in WHITESPACE_EXCLUDE_NEWLINE:
Expand All @@ -156,7 +158,7 @@ def trim_motd(motd: List[ParsedMotdComponent]) -> List[ParsedMotdComponent]:

for i in range(len(modified_motd) - 1, -1, -1):
it = modified_motd[i]
if not isinstance(it, str):
if not (isinstance(it, str) and it):
continue
if it[-1] in WHITESPACE_EXCLUDE_NEWLINE:
modified_motd[i] = it = it.rstrip(WHITESPACE_EXCLUDE_NEWLINE)
Expand Down

0 comments on commit a2fe16c

Please sign in to comment.