2
0
mirror of https://github.com/Nick80835/microbot synced 2025-08-31 22:46:01 +00:00

add support for hiding commands from help

This commit is contained in:
Nick80835
2020-06-17 19:20:19 -04:00
parent ac28a658be
commit 7f6d519d2c
6 changed files with 47 additions and 20 deletions

View File

@@ -30,7 +30,20 @@ async def help_cmd(event):
await event.reply(f"**Available commands:**\n{help_string}")
@ldr.add("ping")
@ldr.add("sudohelp", sudo=True)
async def sudohelp(event):
help_string = ""
for key, value in ldr.help_hidden_dict.items():
help_string += f"\n**{key}**: "
for info in value:
help_string += f"`{info}`, "
help_string = help_string.rstrip(", ")
await event.reply(f"**Available (hidden) commands:**\n{help_string}")
@ldr.add("ping", hide_help=True)
async def ping(event):
start = time_ns()
ping_msg = await event.reply("Ping…")