Skip to content

Commit

Permalink
修复玩家列表底下的多余空行
Browse files Browse the repository at this point in the history
  • Loading branch information
lgc2333 committed Jan 29, 2023
1 parent 9853ba4 commit 5339f66
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 10 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -171,3 +171,4 @@ cython_debug/
# End of https://www.toptal.com/developers/gitignore/api/python

testnb2/
.idea/
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<!-- markdownlint-disable MD033 MD036 MD041 -->

<div align="center">
<a href="https://v2.nonebot.dev/store"><img src="readme/picmcstat.png" width="180" height="180" alt="NoneBotPluginLogo"></a>
<br>
Expand Down Expand Up @@ -116,9 +118,7 @@ _✨ Minecraft 服务器 MOTD 查询 图片版 ✨_

最终的配置项看起来是这样子的,当你发送 `查服` 时,机器人会把 EaseCation 服务器的状态发送出来

```env
MCSTAT_SHORTCUTS=[{"regex":"^查服$","host":"asia.easecation.net","type":"be"}]
```
MCSTAT_SHORTCUTS=[{"regex":"^查服$","host":"asia.easecation.net","type":"be"}]

## 🎉 使用

Expand Down Expand Up @@ -153,6 +153,10 @@ Telegram:[@lgc2333](https://t.me/lgc2333)

## 📝 更新日志

### 0.2.4

- 修复玩家列表底下的多余空行

### 0.2.3

- 修复 JE 服务器 Motd 中粗体意外显示为蓝色的 bug
Expand All @@ -170,7 +174,8 @@ Telegram:[@lgc2333](https://t.me/lgc2333)

- 加入快捷指令,详见配置项
- 修复某些 JE 服无法正确显示 Motd 的问题
-
-

### 0.1.1

- 将查 JE 服时的 `游戏延迟` 字样 改为 `测试延迟`
2 changes: 1 addition & 1 deletion nonebot_plugin_picmcstat/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
usage="使用 motd 指令查看使用帮助",
)

__version__ = "0.2.3"
__version__ = "0.2.4"
4 changes: 2 additions & 2 deletions nonebot_plugin_picmcstat/__main__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Awaitable, Callable, NoReturn
from typing import Any, Awaitable, Callable, NoReturn

from nonebot import on_command, on_regex, require
from nonebot.internal.adapter import Message
Expand Down Expand Up @@ -32,7 +32,7 @@ async def _(matcher: Matcher, arg: Message = CommandArg()):

def get_shortcut_handler(
host: str, svr_type: ServerType
) -> Callable[[...], Awaitable[NoReturn]]:
) -> Callable[[Any], Awaitable[NoReturn]]:
async def shortcut_handler(matcher: Matcher):
await matcher.finish(await draw(host, svr_type))

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 @@ -85,7 +85,9 @@ def format_code_to_bbcode(text: str) -> str:
return "".join(parsed)


def format_list(sample: List[str], items_per_line=2, line_start_spaces=10, list_gap=2):
def format_list(
sample: List[str], items_per_line=2, line_start_spaces=10, list_gap=2
) -> str:
sample = [x for x in sample if x]
if not sample:
return ""
Expand All @@ -107,7 +109,7 @@ def format_list(sample: List[str], items_per_line=2, line_start_spaces=10, list_
tmp.append(" " * line_start_spaces)
line_added = 0

return "".join(tmp)
return "".join(tmp).strip()


class RawTextDictType(TypedDict):
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "nonebot-plugin-picmcstat"
version = "0.2.3"
version = "0.2.4"
description = "A NoneBot2 plugin generates a pic from a Minecraft server's MOTD"
authors = ["lgc2333 <[email protected]>"]
license = "MIT"
Expand Down

0 comments on commit 5339f66

Please sign in to comment.