mirror of
https://github.com/xCyanGrizzly/DragonsStash.git
synced 2026-05-11 06:11:15 +00:00
fix: use searchChatMessages instead of getChatHistory for channel scanning
getChatHistory fails silently in supergroups with hidden history for new members, returning only system messages. searchChatMessages with document and photo filters works regardless of history visibility settings. Also adds getChats call after TDLib client creation to populate the chat list, preventing 'Chat not found' errors.
This commit is contained in:
@@ -333,6 +333,18 @@ export async function runWorkerForAccount(
|
||||
phone: account.phone,
|
||||
});
|
||||
|
||||
// Load the chat list so TDLib knows about all chats
|
||||
// Without this, getChat/getChatHistory fail with "Chat not found"
|
||||
try {
|
||||
await client.invoke({
|
||||
_: "getChats",
|
||||
chat_list: { _: "chatListMain" },
|
||||
limit: 1000,
|
||||
});
|
||||
} catch {
|
||||
// Ignore — chat list may already be loaded
|
||||
}
|
||||
|
||||
const counters = {
|
||||
messagesScanned: 0,
|
||||
zipsFound: 0,
|
||||
|
||||
Reference in New Issue
Block a user