From 0dd2cf60b17cefb2483a03c5122824ef98751063 Mon Sep 17 00:00:00 2001 From: Andrew Ferrazzutti Date: Thu, 22 Jul 2021 03:16:20 -0400 Subject: [PATCH] List contacts alphabetically --- matrix_puppeteer_line/commands/line.py | 1 + 1 file changed, 1 insertion(+) diff --git a/matrix_puppeteer_line/commands/line.py b/matrix_puppeteer_line/commands/line.py index 2551465..cf7e242 100644 --- a/matrix_puppeteer_line/commands/line.py +++ b/matrix_puppeteer_line/commands/line.py @@ -26,6 +26,7 @@ SECTION_CHATS = HelpSection("Contacts & Chats", 40, "") async def list_contacts(evt: CommandEvent) -> None: # TODO Use a generator if it's worth it puppets = await pu.Puppet.get_all() + puppets.sort(key=lambda puppet: puppet.name) results = "".join(f"* [{puppet.name}](https://matrix.to/#/{puppet.default_mxid})\n" for puppet in puppets) if results: