List contacts alphabetically

master
Andrew Ferrazzutti 1 year ago
parent f39781cdcc
commit 0dd2cf60b1
  1. 1
      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:

Loading…
Cancel
Save