Commit c2b66c8
Changed files (3)
src
messages
src/history/d1.py
@@ -97,7 +97,7 @@ async def backup_chat_history_to_d1(
num_sync = 0
tasks = []
real_cid = chatinfo["chandle"] or (int(chatinfo["cid"]) if chatinfo["ctype"] in ["BOT", "PRIVATE"] else int(f"-100{chatinfo['cid']}"))
- async for message in client.get_chat_history(real_cid, offset_id=offset_id): # type: ignore
+ async for message in client.get_chat_history(real_cid, max_id=offset_id): # type: ignore
if not isinstance(message, Message) or message.empty or message.service or message.id in saved_mids:
continue
info = parse_msg(message, silent=True, use_cache=False)
src/history/turso.py
@@ -97,7 +97,7 @@ async def backup_chat_history_to_turso(
num_sync = 0
statements = []
real_cid = chatinfo["chandle"] or (int(chatinfo["cid"]) if chatinfo["ctype"] in ["BOT", "PRIVATE"] else int(f"-100{chatinfo['cid']}"))
- async for message in client.get_chat_history(real_cid, offset_id=offset_id): # type: ignore
+ async for message in client.get_chat_history(real_cid, max_id=offset_id): # type: ignore
if not isinstance(message, Message) or message.empty or message.service or message.id in saved_mids:
continue
info = parse_msg(message, silent=True, use_cache=False)
src/messages/chat_history.py
@@ -119,7 +119,7 @@ async def get_history_info_list_via_telegram(
chat = await get_chat(client, chat_id)
if chat.id == 0:
return []
- async for msg in client.get_chat_history(chat_id=chat.username or chat.id, offset_id=offset_id): # type: ignore
+ async for msg in client.get_chat_history(chat_id=chat.username or chat.id, max_id=offset_id): # type: ignore
# iterate messages from new to old
retrieved += 1
if retrieved > MAX_MESSAGE_RETRIEVED: