diff options
author | ben <ben@nagy.contact> | 2025-05-12 16:10:07 -0700 |
---|---|---|
committer | ben <ben@nagy.contact> | 2025-05-12 16:10:07 -0700 |
commit | 8cdcdb165409789c34f7a35f1c707a2c637fa408 (patch) | |
tree | 5de9ff20cfdc505c5a0252a05b1077fdbf575115 | |
parent | f076cfafbae7f055dab71cbe3221a56314ee80a1 (diff) |
fix
-rw-r--r-- | README.md | 3 | ||||
-rw-r--r-- | matrix-mcnt.py | 5 |
2 files changed, 3 insertions, 5 deletions
@@ -5,8 +5,11 @@ 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 |