tgl
tgl copied to clipboard
Getting entire history of a chat
I'm trying to get the entire history of a chat, and I was using a lua script to write to csv, but I noticed that if I try to get more than 1.5k messages (the chat has something like 500k messages), get_history doesn't return.
Going into the cli, the same thing happens. I managed to get 10k once, but anything above that has never worked for me. I'm just using the command, history [CHATNAME] 10000.
Is there an implicit limit or something? How would I go about getting the entire history of a chat?
history command has another argument named offset.
history [chat_name] [count_of_messages] [offset]
e.g history [chat_name] 100 0 returns first 100 messages and history [chat_name] 100 100 returns next 100 messages and so on. you should do it by a loop.
BTW, do anyone have any success with using offset parameter for fetching channels? For me it returns always the same data. I'm using the test branch