mirror of
https://github.com/RYGhub/royalnet.git
synced 2024-11-27 13:34:28 +00:00
Add commands list
This commit is contained in:
parent
28e98cef31
commit
4948302324
1 changed files with 21 additions and 11 deletions
|
@ -11,6 +11,16 @@ class HelpCommand(rc.Command):
|
|||
syntax: str = "{comando}"
|
||||
|
||||
async def run(self, args: rc.CommandArgs, data: rc.CommandData) -> None:
|
||||
if len(args) == 0:
|
||||
message = [
|
||||
"ℹ️ Comandi disponibili:"
|
||||
]
|
||||
|
||||
for command in sorted(list(set(self.serf.commands.values())), key=lambda c: c.name):
|
||||
message.append(f"- [c]{self.interface.prefix}{command.name}[/c]")
|
||||
|
||||
await data.reply("\n".join(message))
|
||||
else:
|
||||
name: str = args[0].lstrip(self.interface.prefix)
|
||||
|
||||
try:
|
||||
|
@ -19,7 +29,7 @@ class HelpCommand(rc.Command):
|
|||
raise rc.InvalidInputError("Il comando richiesto non esiste.")
|
||||
|
||||
message = [
|
||||
f"[c]{self.interface.prefix}{command.name} {command.syntax}[/c]",
|
||||
f"ℹ️ [c]{self.interface.prefix}{command.name} {command.syntax}[/c]",
|
||||
"",
|
||||
f"{command.description}"
|
||||
]
|
||||
|
|
Loading…
Reference in a new issue