mirror of
https://github.com/MuRuLOSE/limoka.git
synced 2026-06-18 15:14:18 +02:00
b
This commit is contained in:
24
Limoka.py
24
Limoka.py
@@ -481,18 +481,19 @@ class Limoka(loader.Module):
|
|||||||
|
|
||||||
def generate_commands(self, module_info, lang: str = "en"):
|
def generate_commands(self, module_info, lang: str = "en"):
|
||||||
commands = []
|
commands = []
|
||||||
for i, func in enumerate(module_info.get("commands", []), 1):
|
for i, cmd in enumerate(module_info.get("new_commands", []), 1):
|
||||||
for command, description in func.items():
|
name = cmd.get("name", "")
|
||||||
emoji = self.strings["emojis"].get(i, "")
|
desc_map = cmd.get("description", {})
|
||||||
desc = description or self.strings["no_info"]
|
emoji = self.strings["emojis"].get(i, "")
|
||||||
commands.append(
|
desc = _get_lang_value(desc_map, lang) or self.strings["no_info"]
|
||||||
self.strings["command_template"].format(
|
commands.append(
|
||||||
prefix=self.get_prefix(),
|
self.strings["command_template"].format(
|
||||||
command=html.escape(command.replace("cmd", "")),
|
prefix=self.get_prefix(),
|
||||||
emoji=emoji,
|
command=html.escape(name),
|
||||||
description=html.escape(desc),
|
emoji=emoji,
|
||||||
)
|
description=html.escape(desc),
|
||||||
)
|
)
|
||||||
|
)
|
||||||
for i, handler in enumerate(module_info.get("inline_handlers", []), 1):
|
for i, handler in enumerate(module_info.get("inline_handlers", []), 1):
|
||||||
name = handler.get("name", "")
|
name = handler.get("name", "")
|
||||||
desc_map = handler.get("description", {})
|
desc_map = handler.get("description", {})
|
||||||
@@ -506,6 +507,7 @@ class Limoka(loader.Module):
|
|||||||
)
|
)
|
||||||
return commands
|
return commands
|
||||||
|
|
||||||
|
|
||||||
def _format_module_content(
|
def _format_module_content(
|
||||||
self,
|
self,
|
||||||
module_info: Dict[str, Any],
|
module_info: Dict[str, Any],
|
||||||
|
|||||||
Reference in New Issue
Block a user