From 8cdcdb165409789c34f7a35f1c707a2c637fa408 Mon Sep 17 00:00:00 2001 From: ben Date: Mon, 12 May 2025 16:10:07 -0700 Subject: fix --- README.md | 3 +++ matrix-mcnt.py | 5 ----- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 0f656b5..2f57609 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,10 @@ Matrix message count outputs the number of unread messages of all or of specifie # Usage +``` python3 matrix-mcnt.py --username USERNAME [options] +``` + ``` Required arguments: --username USERNAME Your Matrix username without the @username:matrix.org format diff --git a/matrix-mcnt.py b/matrix-mcnt.py index aae0f37..505f16b 100644 --- a/matrix-mcnt.py +++ b/matrix-mcnt.py @@ -56,7 +56,6 @@ async def main() -> None: timeout=30000, full_state=True ) - #print(f"Logged on as {USERNAME} to {HOME}") tmp_rooms = await get_rooms(client, sync_resp) rooms = [] @@ -84,7 +83,6 @@ async def main() -> None: await client.logout() await client.close() -# SEE: room_context(), events.room_events.Event(), room_read_markers, and responses.RoomInfo() with unread_notifications async def sum_unread(client: AsyncClient, rooms: list[dict]) -> int: return sum(room["unread_count"] for room in rooms) @@ -92,11 +90,8 @@ async def get_rooms(client: AsyncClient, sync_response) -> list[dict]: rooms = [] for room_id, room in client.rooms.items(): - # Skip if we have INCLUDE_ONLY_ROOM_IDS and this room isn't in it if INCLUDE_ONLY_ROOM_IDS and room_id not in INCLUDE_ONLY_ROOM_IDS: continue - - # Skip if this room is in EXCLUDE_ROOM_IDS if room_id in EXCLUDE_ROOM_IDS: continue -- cgit v1.2.3