Skip to content

Commit

Permalink
中英双语
Browse files Browse the repository at this point in the history
  • Loading branch information
molanp committed Aug 22, 2024
1 parent 41d6090 commit 2c1b321
Show file tree
Hide file tree
Showing 2 changed files with 123 additions and 6 deletions.
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ _✨ Minecraft 服务器查询插件 ✨_
<img src="https://img.shields.io/pypi/dm/nonebot-plugin-mccheck" alt="pypi-download-count">
</div>

简体中文|[English](README_en.md)

## 📖 介绍

Expand Down Expand Up @@ -56,12 +57,12 @@ conda install nonebot-plugin-mccheck
```

打开 nonebot2 项目根目录下的 `pyproject.toml` 文件, 在 `[tool.nonebot]` 部分追加写入

plugins = ["nonebot_plugin_mccheck"]

```toml
plugin["nonebot_plugin_mccheck"]
```
</details>

## 已实现的功能
## 📈 已实现的功能

- [x] 适配Unicode全字体与字形
- [x] 渲染Motd样式
Expand All @@ -83,13 +84,13 @@ conda install nonebot-plugin-mccheck
- [x] 多语言
- [x] SRV支持

## 未来的功能
## 📑 未来的功能

- [ ] 获取服务器协议号
- [ ] 获取服务器官网[如果存在]
- [ ] 敬请期待

## 效果图
## 🖼️ 效果图

图片消息
![pic](https://github.com/user-attachments/assets/abcda34f-0783-4c1e-b5c1-de9228047a69)
Expand All @@ -107,6 +108,7 @@ HTML消息
| `MCC__TYPE` || `0` | 插件发送的消息类型(`0`为HTML, `1`为图片, `2`为文本) |

## 🎉 使用

|命令|参数|范围|说明|
|:---:|:---:|:---:|:---:|
|`查服/mcheck`|`[ip]:[端口]``[ip]`|私聊/群聊|查询服务器状态|
Expand Down
115 changes: 115 additions & 0 deletions README_en.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
<div align="center">
<a href="https://v2.nonebot.dev/store"><img src="https://github.com/KomoriDev/nonebot-plugin-kawaii-status/raw/master/docs/NoneBotPlugin.svg" alt="NoneBotPluginLogo"></a>
</div>

<div align="center">

# nonebot-plugin-mccheck

_✨ Minecraft Server Query Plug-in_

<a href="./LICENSE">
<img src="https://img.shields.io/github/license/molanp/nonebot_plugin_mccheck.svg" alt="license">
</a>
<a href="https://pypi.python.org/pypi/nonebot-plugin-mccheck">
<img src="https://img.shields.io/pypi/v/nonebot-plugin-mccheck.svg" alt="pypi">
</a>
<img src="https://img.shields.io/badge/python-3.9+-blue.svg" alt="python">
<img src="https://img.shields.io/pypi/dm/nonebot-plugin-mccheck" alt="pypi-download-count">
</div>

English|[简体中文](README.md)

## 📖 Introduction

Minecraft server status query, supporting IPv6.

> update synchronously with [https://github.com/molanp/zhenxun_check_minecraft/](https://github.com/molanp/zhenxun_check_minecraft).
## 💿 Installation

One of the methods mentioned below can be selected.

<details open>
<summary>[recommended] install using nb-cli</summary>
Open the command line in the root directory of Bot and enter the following instructions to install.

```shell
nb plugin install nonebot-plugin-mccheck
```

</details>

<details>
<summary> install using package manager </summary>
In the plug-in directory of the nonebot2 project, open the command line and enter the corresponding installation command according to the package manager you use.

```shell
pip install nonebot-plugin-mccheck
# or
pdm add nonebot-plugin-mccheck
# or
poetry add nonebot-plugin-mccheck
# or
conda install nonebot-plugin-mccheck
```

Open the `pyproject.toml` file in the root directory of the nonebot2 project, and write in the ` [tool.nonebot] ` section.
```toml
plugins = ["nonebot_plugin_mccheck"]
```
</details>

## 📈 Implemented functions

- [x] Adapted unicode full fonts and glyphs
- [x] Render Motd styles
- [x] Query server nickname
- [x] Query the maximum number of servers, the current number of people
- [x] Query server motd
- [x] returns the server address and port
- [x] Returns the server online status
- [x] Query server latency
- [x] More precise delay
- [x] UDP server is supported
- [x] Error message feedback
- [x] Port autocompletion
- [x] Wisdom~~Barrier~~ can determine whether the IP address is correct
- [x] Get the JSON version of the server motd (only if the server motd is set to JSON format)
- [x] Does not depend on any external API :)
- [x] Support special port queries (e.g. `2`, `80`, `443` etc.)
- [x] Query server favicon
- [x] Multilingual
- [x] SRV support

## 📑 Future functions

- [ ] Get server protocol number
- [ ] Get server official website (if any)
- [ ] And more...

## 🖼️ Test screenshot

Picture Message
![pic](https://github.com/user-attachments/assets/abcda34f-0783-4c1e-b5c1-de9228047a69)

HTML Message
![html](https://github.com/user-attachments/assets/18069f2a-4f7e-4994-837b-2b9e0cbf1f74)

## ⚙️ Configuration

Add the required configuration in the following table to the `.env` file of the nonebot2 project.

| Configuration Item | Required | Default Value | Description |
|:-----:|:----:|:----:|:----:|
| `MCC__LANGUAGE` | False | `zh-cn` | Languages used by the plugin to render images<br>Available languages: [`zh-cn`,`zh-tw`,`en`] |
| `MCC__TYPE` | False | `0` | The type of message the plugin sends (`0` for HTML, `1` for image, `2` for text) |


## 🎉 Usage
| Command | Parameter | Scope | Description |
|:-------:|:---------:|:-----:|:-----------:|
| `mcheck` | `[ip]:[port]` or `[ip]` | Private/Group Chat | Check Minecraft server status |
| `set_lang` | Language name | Private/Group Chat | Set the language used by the plugin for rendering images |
| `lang_now` | None | Private/Group Chat | View the current language used by the plugin for rendering images |
| `lang_list` | None | Private/Group Chat | View the list of languages supported by the plugin |

0 comments on commit 2c1b321

Please sign in to comment.