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

add a help command to list available commands

This commit is contained in:
Nick80835
2020-05-06 11:10:00 -04:00
parent 3751d7de9a
commit 5272c0c85e
2 changed files with 20 additions and 0 deletions

View File

@@ -32,6 +32,19 @@ async def delete_message(event):
await message_to_delete.delete()
@ldr.add("help")
async def help_cmd(event):
help_string = ""
for key, value in ldr.help_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 commands:`\n{help_string}")
@ldr.add("alive", sudo=True)
async def alive(event):
alive_format = "`μBot is running under {0}.\n\n" \