Skip to content
This repository was archived by the owner on Feb 11, 2026. It is now read-only.

Commit 5bc4fc1

Browse files
committed
фикс
1 parent ebd75dd commit 5bc4fc1

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

src/pymax/mixins/group.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -427,14 +427,14 @@ async def leave_channel(self, chat_id: int) -> None:
427427
"""
428428
await self.leave_group(chat_id)
429429

430-
async def fetch_chats(self, marker: int | None = None) -> list[Chat]:
430+
async def fetch_chats(self, marker: int | None = None) -> tuple[list[Chat], int]:
431431
"""
432432
Загружает список чатов
433433
434434
:param marker: Маркер для пагинации, по умолчанию None
435435
:type marker: int | None
436-
:return: Список объектов Chat
437-
:rtype: list[Chat]
436+
:return: Список объектов Chat и маркер
437+
:rtype: tuple[list[Chat], int]
438438
"""
439439
if marker is None:
440440
marker = int(time.time() * 1000)
@@ -448,6 +448,7 @@ async def fetch_chats(self, marker: int | None = None) -> list[Chat]:
448448

449449
chats_data = data["payload"].get("chats", [])
450450
chats: list[Chat] = []
451+
marker = int(data["payload"].get("marker"))
451452
for chat_dict in chats_data:
452453
chat = Chat.from_dict(chat_dict)
453454
chats.append(chat)
@@ -458,7 +459,7 @@ async def fetch_chats(self, marker: int | None = None) -> list[Chat]:
458459
idx = self.chats.index(cached_chat)
459460
self.chats[idx] = chat
460461

461-
return chats
462+
return chats, marker
462463

463464
async def _subscribe_action(self, chat_id: int, subscribe: bool) -> None:
464465
payload = ChatSubscriptionPayload(chat_id=chat_id, subscribe=subscribe).model_dump(

0 commit comments

Comments
 (0)