优化帮助消息
This commit is contained in:
@@ -221,12 +221,19 @@ class WPSAPIHelp(WPSAPI):
|
||||
|
||||
@override
|
||||
async def callback(self, message: str, chat_id: int, user_id: int) -> str|None:
|
||||
return await self.send_markdown_message(f"""# 指令帮助
|
||||
{"\n".join([f"- {key} 插件来源: {PluginInterface.plugin_instances.get(key).__class__.__name__}" for key in PluginInterface.plugin_instances.keys()])}
|
||||
""",
|
||||
chat_id,
|
||||
user_id
|
||||
)
|
||||
mapper: Dict[str, List[str]] = {}
|
||||
for key in PluginInterface.plugin_instances.keys():
|
||||
plugin = PluginInterface.plugin_instances.get(key)
|
||||
if plugin:
|
||||
if plugin.__class__.__name__ not in mapper:
|
||||
mapper[plugin.__class__.__name__] = []
|
||||
mapper[plugin.__class__.__name__].append(key)
|
||||
desc = ""
|
||||
for plugin_name, keys in mapper.items():
|
||||
desc += f"- {plugin_name}: {", ".join(keys)}\n"
|
||||
return await self.send_markdown_message(f"""# 指令入口
|
||||
{desc}
|
||||
""", chat_id, user_id)
|
||||
|
||||
@override
|
||||
def wake_up(self) -> None:
|
||||
|
||||
@@ -4,8 +4,9 @@ from __future__ import annotations
|
||||
|
||||
from typing import Optional
|
||||
|
||||
from PWF.Convention.Runtime.Config import *
|
||||
from PWF.Convention.Runtime.GlobalConfig import ConsoleFrontColor, ProjectConfig
|
||||
|
||||
from Plugins.WPSCombatSystem.combat_models import PlayerStats, EquipmentDefinition
|
||||
from .combat_plugin_base import WPSCombatBase
|
||||
|
||||
|
||||
@@ -52,7 +53,7 @@ class WPSCombatStatus(WPSCombatBase):
|
||||
|
||||
return await self.send_markdown_message(output, chat_id, user_id)
|
||||
|
||||
def _format_status(self, stats, equipped) -> str:
|
||||
def _format_status(self, stats: PlayerStats, equipped: Dict[str, Optional[EquipmentDefinition]]) -> str:
|
||||
"""格式化状态输出"""
|
||||
lines = ["# ⚔️ 战斗属性"]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user