Skip to main content

A NoneBot2 plugin generates a pic from a Minecraft server's MOTD

Project description

NoneBotPluginLogo

NoneBotPluginText

NoneBot-Plugin-PicMCStat

✨ Minecraft 服务器 MOTD 查询 图片版 ✨

license pypi python pypi download wakatime

📖 介绍

插件实际上是可以展示 玩家列表Mod 端信息 以及 Mod 列表(还未测试) 的,这里没有找到合适的例子所以没在效果图里展示出来,如果遇到问题可以发 issue

插件包体内并没有自带图片内 Unifont 字体,需要的话请参考 这里 安装字体

因为下划线、删除线和斜体 nonebot-plugin-imageutils 的 bbcode 还不支持,所以还没做
(如果 wq 佬看到这个能不能酌情考虑一下呢 awa)

效果图

example
example

💿 安装

插件

[推荐] 使用 nb-cli 安装 在 nonebot2 项目的根目录下打开命令行, 输入以下指令即可安装
nb plugin install nonebot-plugin-picmcstat
使用包管理器安装 在 nonebot2 项目的插件目录下, 打开命令行, 根据你使用的包管理器, 输入相应的安装命令
pip
pip install nonebot-plugin-picmcstat
pdm
pdm add nonebot-plugin-picmcstat
poetry
poetry add nonebot-plugin-picmcstat
conda
conda install nonebot-plugin-picmcstat

打开 nonebot2 项目的 bot.py 文件, 在其中写入

nonebot.load_plugin('nonebot_plugin_picmcstat')

字体

字体文件请自行去自行去 这里 下载

有两种方式可以安装该字体

  • 方式一:直接安装在系统中
  • 方式二:放在 nonebot-plugin-imageutils 插件的字体文件目录中并将文件重命名为 unifont 即可使用,该插件配置可以参考 这里

⚙️ 配置

MCSTAT_SHORTCUTS - 快捷指令列表

这个配置项能够帮助你简化一些查询指令

此配置项的类型是一个列表,里面的元素需要为一个特定结构的字典
这个字典需要有三个元素

  • regex - 用于匹配指令的正则,例如 ^查服$
    (注意,nb2 以 JSON 格式解析配置项,所以当你要在正则表达式里表示\时,你需要将其转义为\\
  • host - 要查询的服务器地址,格式为 <IP>[:端口]
    例如 hypixel.netexample.com:1919
  • type - 要查询服务器的类型,je 表示 Java 版服,be 表示基岩版服

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

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

🎉 使用

发送 motd 指令 查看使用指南

usage

📞 联系

QQ:3076823485
Telegram:@lgc2333
吹水群:1105946125
邮箱:lgc2333@126.com

💡 鸣谢

nonebot-plugin-imageutils

  • 超好用的 Pillow 辅助库,快去用 awa

💰 赞助

感谢大家的赞助!你们的赞助将是我继续创作的动力!

  • 爱发电

  • 赞助二维码(点击展开)

    讨饭

📝 更新日志

0.2.0

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

0.1.1

  • 将查 JE 服时的 游戏延迟 字样 改为 测试延迟

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nonebot_plugin_picmcstat-0.2.0.tar.gz (27.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nonebot_plugin_picmcstat-0.2.0-py3-none-any.whl (25.5 kB view details)

Uploaded Python 3

File details

Details for the file nonebot_plugin_picmcstat-0.2.0.tar.gz.

File metadata

  • Download URL: nonebot_plugin_picmcstat-0.2.0.tar.gz
  • Upload date:
  • Size: 27.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.2 CPython/3.10.9 Linux/5.15.0-1031-azure

File hashes

Hashes for nonebot_plugin_picmcstat-0.2.0.tar.gz
Algorithm Hash digest
SHA256 cac23a33ec80950e510c0dff620cb28fe72c55adf6e5e5496b64ec55f2bf8aee
MD5 3373c9c94d0d9c68168e9e478b2d44bb
BLAKE2b-256 59a3f16e8ec8b0cfe0a4dfee1201c4e6f244860073ec5ef06072267f14b608a3

See more details on using hashes here.

File details

Details for the file nonebot_plugin_picmcstat-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for nonebot_plugin_picmcstat-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ed6069b2e85ac333ba4d91ae2d0c71080f3da2a84fec585ee69867bc20a750e8
MD5 3af24f26fe4ec396b6ad9709df5dc6ec
BLAKE2b-256 ea2516520e3fbbdd0090701929b9c73a104140cfc51116ad9f1f46f7293df503

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page