feat: 更多的字体

This commit is contained in:
2024-04-05 08:48:51 +08:00
parent edc0a16cad
commit 71faffaa44
14 changed files with 352 additions and 244 deletions

View File

@ -157,14 +157,14 @@ class Minesweeper:
print([d.value for d in row])
for dot in row:
if dot.mask and not dot.flagged:
text += md.button(self.MASK, f"minesweeper reveal {dot.row} {dot.col}")
text += md.cmd(self.MASK, f"minesweeper reveal {dot.row} {dot.col}")
elif dot.flagged:
text += md.button(self.FLAG, f"minesweeper mark {dot.row} {dot.col}")
text += md.cmd(self.FLAG, f"minesweeper mark {dot.row} {dot.col}")
else:
text += self.NUMS[dot.value]
text += dis
text += "\n"
btn_mark = md.button("标记", f"minesweeper mark ", enter=False)
btn_end = md.button("结束", "minesweeper end", enter=True)
btn_mark = md.cmd("标记", f"minesweeper mark ", enter=False)
btn_end = md.cmd("结束", "minesweeper end", enter=True)
text += f" {btn_mark} {btn_end}"
return text

View File

@ -71,7 +71,7 @@ async def _(result: Arparma, event: T_MessageEvent, bot: T_Bot):
if len(rs):
reply = f"{ulang.get('npm.search_result')} | {ulang.get('npm.total', TOTAL=len(rs))}\n***"
for plugin in rs[:min(max_show, len(rs))]:
btn_install = md.button(ulang.get("npm.install"), "npm install %s" % plugin.module_name)
btn_install = md.cmd(ulang.get("npm.install"), "npm install %s" % plugin.module_name)
link_page = md.link(ulang.get("npm.homepage"), plugin.homepage)
link_pypi = md.link(ulang.get("npm.pypi"), plugin.homepage)
@ -96,7 +96,7 @@ async def _(result: Arparma, event: T_MessageEvent, bot: T_Bot):
if not store_plugin:
await npm_alc.finish(ulang.get("npm.plugin_not_found", NAME=plugin_module_name))
homepage_btn = md.button(ulang.get("npm.homepage"), store_plugin.homepage)
homepage_btn = md.cmd(ulang.get("npm.homepage"), store_plugin.homepage)
if r:
r_load = nonebot.load_plugin(plugin_module_name) # 加载插件

View File

@ -67,7 +67,7 @@ async def _(event: T_MessageEvent, bot: T_Bot, result: Arparma):
for plugin in loaded_plugin_list[(page - 1) * num_per_page: min(page * num_per_page, len(loaded_plugin_list))]:
# 检查是否有 metadata 属性
# 添加帮助按钮
btn_usage = md.button(lang.get("npm.usage"), f"help {plugin.module_name}", False)
btn_usage = md.cmd(lang.get("npm.usage"), f"help {plugin.module_name}", False)
store_plugin = await get_store_plugin(plugin.module_name)
session_enable = get_plugin_session_enable(event, plugin.module_name)
@ -98,7 +98,7 @@ async def _(event: T_MessageEvent, bot: T_Bot, result: Arparma):
cmd_toggle = f"{'disable' if session_enable else 'enable'} {plugin.module_name}"
text_toggle = lang.get("npm.disable" if session_enable else "npm.enable")
can_be_toggle = get_plugin_can_be_toggle(plugin.module_name)
btn_toggle = text_toggle if not can_be_toggle else md.button(text_toggle, cmd_toggle)
btn_toggle = text_toggle if not can_be_toggle else md.cmd(text_toggle, cmd_toggle)
reply += f" {btn_toggle}"
@ -107,12 +107,12 @@ async def _(event: T_MessageEvent, bot: T_Bot, result: Arparma):
# 添加移除插件和全局切换按钮
global_enable = get_plugin_global_enable(plugin.module_name)
btn_uninstall = (
md.button(lang.get("npm.uninstall"), f'npm uninstall {plugin.module_name}')) if plugin_in_database else lang.get(
md.cmd(lang.get("npm.uninstall"), f'npm uninstall {plugin.module_name}')) if plugin_in_database else lang.get(
'npm.uninstall')
btn_toggle_global_text = lang.get("npm.disable_global" if global_enable else "npm.enable_global")
cmd_toggle_global = f"{'disable-global' if global_enable else 'enable-global'} {plugin.module_name}"
btn_toggle_global = btn_toggle_global_text if not can_be_toggle else md.button(btn_toggle_global_text, cmd_toggle_global)
btn_toggle_global = btn_toggle_global_text if not can_be_toggle else md.cmd(btn_toggle_global_text, cmd_toggle_global)
reply += f" {btn_uninstall} {btn_toggle_global}"

View File

@ -90,8 +90,8 @@ async def _(result: Arparma, event: T_MessageEvent, bot: T_Bot):
continue
val = profile.dict()[key]
key_text = ulang.get(f"user.profile.{key}")
btn_set = md.button(ulang.get("user.profile.edit"), f"profile set {key}",
enter=True if key in enter_attr else False)
btn_set = md.cmd(ulang.get("user.profile.edit"), f"profile set {key}",
enter=True if key in enter_attr else False)
reply += (f"\n**{key_text}** **{val}**\n"
f"\n> {ulang.get(f'user.profile.{key}.desc')}"
f"\n> {btn_set} \n\n***\n")
@ -117,11 +117,11 @@ def get_profile_menu(key: str, ulang: Language) -> Optional[str]:
reply = f"**{setting_name} {ulang.get('user.profile.settings')}**\n***\n"
if key == "lang":
for lang_code, lang_name in get_all_lang().items():
btn_set = md.button(ulang.get("user.profile.set"), f"profile set {key} {lang_code}")
btn_set = md.cmd(ulang.get("user.profile.set"), f"profile set {key} {lang_code}")
reply += f"\n{btn_set} | **{lang_name}** - {lang_code}\n***\n"
elif key == "timezone":
for tz in representative_timezones_list:
btn_set_tz = md.button(tz, f"profile set {key} {tz}")
btn_set_tz = md.cmd(tz, f"profile set {key} {tz}")
reply += f"{btn_set_tz}\n"
return reply