✨ 新的sr帮助
@ -3,25 +3,25 @@
|
||||
"desc": "需要先绑定uid",
|
||||
"data": [
|
||||
{
|
||||
"name": "sr绑定uid",
|
||||
"name": "绑定uid",
|
||||
"desc": "绑定你的星铁UID",
|
||||
"eg": "sr绑定uid123456",
|
||||
"eg": "绑定uid123456",
|
||||
"need_ck": false,
|
||||
"need_sk": false,
|
||||
"need_admin": false
|
||||
},
|
||||
{
|
||||
"name": "sr删除uid",
|
||||
"name": "删除uid",
|
||||
"desc": "删除你的星铁UID",
|
||||
"eg": "sr删除uid123456",
|
||||
"eg": "删除uid123456",
|
||||
"need_ck": false,
|
||||
"need_sk": false,
|
||||
"need_admin": false
|
||||
},
|
||||
{
|
||||
"name": "sr切换uid",
|
||||
"name": "切换uid",
|
||||
"desc": "切换你的星铁UID",
|
||||
"eg": "sr切换uid123456",
|
||||
"eg": "切换uid123456",
|
||||
"need_ck": false,
|
||||
"need_sk": false,
|
||||
"need_admin": false
|
||||
@ -32,73 +32,81 @@
|
||||
"desc": "查询一些基本信息",
|
||||
"data": [
|
||||
{
|
||||
"name": "sruid",
|
||||
"name": "查询",
|
||||
"desc": "角色信息一览,后可跟UID",
|
||||
"eg": "sruid100740568",
|
||||
"eg": "uid100740568",
|
||||
"need_ck": true,
|
||||
"need_sk": false,
|
||||
"need_admin": false
|
||||
},
|
||||
{
|
||||
"name": "sr深渊",
|
||||
"name": "深渊",
|
||||
"desc": "查询星铁深渊信息",
|
||||
"eg": "sr深渊100740568",
|
||||
"eg": "深渊100740568",
|
||||
"need_ck": true,
|
||||
"need_sk": false,
|
||||
"need_admin": false
|
||||
},
|
||||
{
|
||||
"name": "srmr",
|
||||
"name": "mr",
|
||||
"desc": "查询自己的体力派遣",
|
||||
"eg": "sr每日",
|
||||
"eg": "每日",
|
||||
"need_ck": true,
|
||||
"need_sk": false,
|
||||
"need_admin": false
|
||||
},
|
||||
{
|
||||
"name": "sr札记",
|
||||
"name": "札记",
|
||||
"desc": "查询自己的每月收入",
|
||||
"eg": "srzj",
|
||||
"eg": "zj",
|
||||
"need_ck": true,
|
||||
"need_sk": false,
|
||||
"need_admin": false
|
||||
},
|
||||
{
|
||||
"name": "sr签到",
|
||||
"name": "签到",
|
||||
"desc": "米游社签到",
|
||||
"eg": "sr签到",
|
||||
"eg": "签到",
|
||||
"need_ck": true,
|
||||
"need_sk": false,
|
||||
"need_admin": false
|
||||
},
|
||||
{
|
||||
"name": "sr抽卡记录",
|
||||
"name": "抽卡记录",
|
||||
"desc": "查询自己的抽卡记录",
|
||||
"eg": "sr抽卡记录",
|
||||
"eg": "抽卡记录",
|
||||
"need_ck": false,
|
||||
"need_sk": false,
|
||||
"need_admin": false
|
||||
},
|
||||
{
|
||||
"name": "sr每月统计",
|
||||
"desc": "srzj的文字版",
|
||||
"eg": "sr每月统计",
|
||||
"name": "每月统计",
|
||||
"desc": "zj的文字版",
|
||||
"eg": "每月统计",
|
||||
"need_ck": true,
|
||||
"need_sk": false,
|
||||
"need_admin": false
|
||||
},
|
||||
{
|
||||
"name": "sr当前状态",
|
||||
"desc": "srmr的文字版",
|
||||
"eg": "sr当前状态",
|
||||
"name": "当前状态",
|
||||
"desc": "mr的文字版",
|
||||
"eg": "当前状态",
|
||||
"need_ck": true,
|
||||
"need_sk": false,
|
||||
"need_admin": false
|
||||
},
|
||||
{
|
||||
"name": "sr查询模拟宇宙",
|
||||
"name": "查询模拟宇宙",
|
||||
"desc": "查询模拟宇宙的信息",
|
||||
"eg": "sr查询宇宙",
|
||||
"eg": "查询宇宙",
|
||||
"need_ck": true,
|
||||
"need_sk": false,
|
||||
"need_admin": false
|
||||
},
|
||||
{
|
||||
"name": "查询寰宇蝗灾",
|
||||
"desc": "查询寰宇蝗灾的信息",
|
||||
"eg": "查询寰宇蝗灾",
|
||||
"need_ck": true,
|
||||
"need_sk": false,
|
||||
"need_admin": false
|
||||
@ -109,17 +117,17 @@
|
||||
"desc": "数据源由Mihomo提供",
|
||||
"data": [
|
||||
{
|
||||
"name": "sr强制刷新",
|
||||
"name": "强制刷新",
|
||||
"desc": "刷新自己游戏内面板数据",
|
||||
"eg": "sr强制刷新",
|
||||
"eg": "强制刷新",
|
||||
"need_ck": false,
|
||||
"need_sk": false,
|
||||
"need_admin": false
|
||||
},
|
||||
{
|
||||
"name": "sr查询xx",
|
||||
"name": "查询[角色]",
|
||||
"desc": "查询游戏内面板数据",
|
||||
"eg": "sr查询希儿",
|
||||
"eg": "查询希儿",
|
||||
"need_ck": false,
|
||||
"need_sk": false,
|
||||
"need_admin": false
|
||||
@ -130,33 +138,33 @@
|
||||
"desc": "提供 WIKI 查询",
|
||||
"data": [
|
||||
{
|
||||
"name": "sr角色攻略",
|
||||
"name": "角色攻略",
|
||||
"desc": "获取角色攻略",
|
||||
"eg": "sr角色攻略 希儿",
|
||||
"eg": "角色攻略 希儿",
|
||||
"need_ck": false,
|
||||
"need_sk": false,
|
||||
"need_admin": false
|
||||
},
|
||||
{
|
||||
"name": "sr遗器",
|
||||
"name": "遗器",
|
||||
"desc": "获取遗器图鉴",
|
||||
"eg": "sr遗器 星体差分机",
|
||||
"eg": "遗器 星体差分机",
|
||||
"need_ck": false,
|
||||
"need_sk": false,
|
||||
"need_admin": false
|
||||
},
|
||||
{
|
||||
"name": "sr突破材料",
|
||||
"name": "突破材料",
|
||||
"desc": "获取角色突破材料图鉴",
|
||||
"eg": "sr突破材料 希儿",
|
||||
"eg": "突破材料 希儿",
|
||||
"need_ck": false,
|
||||
"need_sk": false,
|
||||
"need_admin": false
|
||||
},
|
||||
{
|
||||
"name": "sr武器",
|
||||
"name": "武器",
|
||||
"desc": "查询武器图鉴",
|
||||
"eg": "sr武器 于夜色中",
|
||||
"eg": "武器 于夜色中",
|
||||
"need_ck": false,
|
||||
"need_sk": false,
|
||||
"need_admin": false
|
||||
@ -167,9 +175,9 @@
|
||||
"desc": "一些仅供私聊调用的服务",
|
||||
"data": [
|
||||
{
|
||||
"name": "sr导入抽卡链接",
|
||||
"name": "导入抽卡链接",
|
||||
"desc": "后跟抽卡记录连接以导入",
|
||||
"eg": "sr导入抽卡链接",
|
||||
"eg": "导入抽卡链接",
|
||||
"need_ck": false,
|
||||
"need_sk": false,
|
||||
"need_admin": false
|
||||
@ -180,17 +188,17 @@
|
||||
"desc": "一些仅供管理员调用的服务",
|
||||
"data": [
|
||||
{
|
||||
"name": "sr下载全部资源",
|
||||
"name": "下载全部资源",
|
||||
"desc": "下载一些机器人必须的资源",
|
||||
"eg": "sr下载全部资源",
|
||||
"eg": "下载全部资源",
|
||||
"need_ck": false,
|
||||
"need_sk": false,
|
||||
"need_admin": true
|
||||
},
|
||||
{
|
||||
"name": "sr强制推送体力提醒",
|
||||
"name": "强制推送体力提醒",
|
||||
"desc": "强制推送一次体力提醒",
|
||||
"eg": "sr强制推送体力提醒",
|
||||
"eg": "强制推送体力提醒",
|
||||
"need_ck": false,
|
||||
"need_sk": false,
|
||||
"need_admin": true
|
||||
|
@ -6,7 +6,7 @@ from gsuid_core.logger import logger
|
||||
from gsuid_core.help.utils import register_help
|
||||
|
||||
from ..utils.sr_prefix import PREFIX
|
||||
from .get_help import ICON, get_core_help
|
||||
from .get_help import ICON, get_help
|
||||
|
||||
sv_sr_help = SV("sr帮助")
|
||||
|
||||
@ -14,7 +14,7 @@ sv_sr_help = SV("sr帮助")
|
||||
@sv_sr_help.on_fullmatch(f"{PREFIX}帮助")
|
||||
async def send_help_img(bot: Bot, ev: Event):
|
||||
logger.info("开始执行[sr帮助]")
|
||||
im = await get_core_help()
|
||||
im = await get_help()
|
||||
await bot.send(im)
|
||||
|
||||
register_help('StarRailUID', f'{PREFIX}帮助', Image.open(ICON))
|
||||
|
@ -1,39 +1,41 @@
|
||||
from typing import Dict
|
||||
from pathlib import Path
|
||||
from typing import Dict, Union, Optional
|
||||
|
||||
import aiofiles
|
||||
from PIL import Image
|
||||
from msgspec import json as msgjson
|
||||
from gsuid_core.help.model import PluginHelp
|
||||
from gsuid_core.help.draw_plugin_help import get_help
|
||||
from gsuid_core.help.draw_new_plugin_help import get_new_help
|
||||
|
||||
from ..version import StarRail_version
|
||||
from ..utils.fonts.starrail_fonts import starrail_font_origin
|
||||
from ..utils.image import get_footer
|
||||
from ..utils.sr_prefix import PREFIX
|
||||
from ..version import StarRailUID_version
|
||||
|
||||
TEXT_PATH = Path(__file__).parent / "texture2d"
|
||||
HELP_DATA = Path(__file__).parent / "Help.json"
|
||||
ICON = Path(__file__).parent.parent.parent / 'ICON.png'
|
||||
HELP_DATA = Path(__file__).parent / 'help.json'
|
||||
ICON_PATH = Path(__file__).parent / 'icon_path'
|
||||
TEXT_PATH = Path(__file__).parent / 'texture2d'
|
||||
|
||||
|
||||
async def get_help_data() -> Optional[Dict[str, PluginHelp]]:
|
||||
if HELP_DATA.exists():
|
||||
with Path.open(HELP_DATA, "rb") as file:
|
||||
return msgjson.decode(file.read(), type=Dict[str, PluginHelp])
|
||||
return None
|
||||
async def get_help_data() -> Dict[str, PluginHelp]:
|
||||
async with aiofiles.open(HELP_DATA, 'rb') as file:
|
||||
return msgjson.decode(await file.read(), type=Dict[str, PluginHelp])
|
||||
|
||||
|
||||
async def get_core_help() -> Union[bytes, str]:
|
||||
help_data = await get_help_data()
|
||||
if help_data is None:
|
||||
return "暂未找到帮助数据..."
|
||||
|
||||
return await get_help(
|
||||
"StarRailUID",
|
||||
f"版本号:{StarRail_version}",
|
||||
help_data,
|
||||
Image.open(TEXT_PATH / "bg.jpg"),
|
||||
Image.open(TEXT_PATH / "ICON.png"),
|
||||
Image.open(TEXT_PATH / "badge.png"),
|
||||
Image.open(TEXT_PATH / "banner.png"),
|
||||
Image.open(TEXT_PATH / "button.png"),
|
||||
starrail_font_origin,
|
||||
async def get_help():
|
||||
return await get_new_help(
|
||||
plugin_name='StarRailUID',
|
||||
plugin_info={f'v{StarRailUID_version}': ''},
|
||||
plugin_icon=Image.open(ICON),
|
||||
plugin_help=await get_help_data(),
|
||||
plugin_prefix=PREFIX,
|
||||
help_mode='dark',
|
||||
banner_bg=Image.open(TEXT_PATH / 'banner_bg.jpg'),
|
||||
banner_sub_text='「愿此行, 终抵群星!」',
|
||||
help_bg=Image.open(TEXT_PATH / 'bg.jpg'),
|
||||
cag_bg=Image.open(TEXT_PATH / 'cag_bg.png'),
|
||||
item_bg=Image.open(TEXT_PATH / 'item.png'),
|
||||
icon_path=ICON_PATH,
|
||||
footer=get_footer(),
|
||||
enable_cache=True,
|
||||
)
|
||||
|
BIN
StarRailUID/starrailuid_help/icon_path/mr.png
Normal file
After Width: | Height: | Size: 15 KiB |
BIN
StarRailUID/starrailuid_help/icon_path/下载全部资源.png
Normal file
After Width: | Height: | Size: 15 KiB |
BIN
StarRailUID/starrailuid_help/icon_path/切换.png
Normal file
After Width: | Height: | Size: 24 KiB |
BIN
StarRailUID/starrailuid_help/icon_path/删除.png
Normal file
After Width: | Height: | Size: 24 KiB |
BIN
StarRailUID/starrailuid_help/icon_path/寰宇蝗灾.png
Normal file
After Width: | Height: | Size: 29 KiB |
BIN
StarRailUID/starrailuid_help/icon_path/导入抽卡链接.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
StarRailUID/starrailuid_help/icon_path/强制刷新.png
Normal file
After Width: | Height: | Size: 25 KiB |
BIN
StarRailUID/starrailuid_help/icon_path/强制推送体力提醒.png
Normal file
After Width: | Height: | Size: 19 KiB |
BIN
StarRailUID/starrailuid_help/icon_path/当前状态.png
Normal file
After Width: | Height: | Size: 20 KiB |
BIN
StarRailUID/starrailuid_help/icon_path/抽卡记录.png
Normal file
After Width: | Height: | Size: 37 KiB |
BIN
StarRailUID/starrailuid_help/icon_path/攻略.png
Normal file
After Width: | Height: | Size: 26 KiB |
BIN
StarRailUID/starrailuid_help/icon_path/札记.png
Normal file
After Width: | Height: | Size: 19 KiB |
BIN
StarRailUID/starrailuid_help/icon_path/查询.png
Normal file
After Width: | Height: | Size: 7.7 KiB |
BIN
StarRailUID/starrailuid_help/icon_path/查询[角色].png
Normal file
After Width: | Height: | Size: 24 KiB |
BIN
StarRailUID/starrailuid_help/icon_path/模拟宇宙.png
Normal file
After Width: | Height: | Size: 25 KiB |
BIN
StarRailUID/starrailuid_help/icon_path/武器.png
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
StarRailUID/starrailuid_help/icon_path/每月统计.png
Normal file
After Width: | Height: | Size: 34 KiB |
BIN
StarRailUID/starrailuid_help/icon_path/深渊.png
Normal file
After Width: | Height: | Size: 20 KiB |
BIN
StarRailUID/starrailuid_help/icon_path/添加.png
Normal file
After Width: | Height: | Size: 25 KiB |
BIN
StarRailUID/starrailuid_help/icon_path/突破材料.png
Normal file
After Width: | Height: | Size: 28 KiB |
BIN
StarRailUID/starrailuid_help/icon_path/签到.png
Normal file
After Width: | Height: | Size: 21 KiB |
BIN
StarRailUID/starrailuid_help/icon_path/练度统计.png
Normal file
After Width: | Height: | Size: 24 KiB |
BIN
StarRailUID/starrailuid_help/icon_path/虚构叙事.png
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
StarRailUID/starrailuid_help/icon_path/通用.png
Normal file
After Width: | Height: | Size: 20 KiB |
BIN
StarRailUID/starrailuid_help/icon_path/遗器.png
Normal file
After Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 82 KiB |
Before Width: | Height: | Size: 6.9 KiB |
Before Width: | Height: | Size: 3.7 KiB |
BIN
StarRailUID/starrailuid_help/texture2d/banner_bg.jpg
Normal file
After Width: | Height: | Size: 230 KiB |
Before Width: | Height: | Size: 182 KiB After Width: | Height: | Size: 193 KiB |
Before Width: | Height: | Size: 25 KiB |
BIN
StarRailUID/starrailuid_help/texture2d/cag_bg.png
Normal file
After Width: | Height: | Size: 936 B |
BIN
StarRailUID/starrailuid_help/texture2d/item.png
Normal file
After Width: | Height: | Size: 2.9 KiB |
9
StarRailUID/utils/image.py
Normal file
@ -0,0 +1,9 @@
|
||||
from pathlib import Path
|
||||
|
||||
from PIL import Image
|
||||
|
||||
TEXT_PATH = Path(__file__).parent / 'texture2d'
|
||||
|
||||
|
||||
def get_footer():
|
||||
return Image.open(TEXT_PATH / 'footer.png')
|
BIN
StarRailUID/utils/texture2d/footer.png
Normal file
After Width: | Height: | Size: 14 KiB |