Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Offset #12

Open
mjza opened this issue Feb 3, 2016 · 15 comments
Open

Offset #12

mjza opened this issue Feb 3, 2016 · 15 comments

Comments

@mjza
Copy link

mjza commented Feb 3, 2016

Hi, I want to retrieve all my 35000 messages of one of my contacts.

It is possible to send offset in history method but I don't know how to add this option.

Can you guide me?

@psamim
Copy link
Owner

psamim commented Feb 4, 2016

Hi,
I am not sure if I understood you correctly. Have you tried changing the MESSAGE_COUNT in line 3? If MESSAGE_COUNT is set to 500, it means that it tries to retrieve the last 500 messages.

@mjza
Copy link
Author

mjza commented Feb 4, 2016

I had 32000 messages in one account and it is not possible to retrieve all in one connection.

So it has to be send in smaller requests by using offset.

Anyway, thanks I wrote a program in php and solved my problem.

@psamim
Copy link
Owner

psamim commented Feb 4, 2016

Is it a limit impose by Telegram or you got some error?

On Thu, Feb 4, 2016, 2:53 PM Mahdi Jaberzadeh Ansari <
[email protected]> wrote:

I had 32000 messages in one account and it is not possible to retrieve all
in one connection.

So it has to be send in smaller requests by using offset.

Anyway, thanks I wrote a program in php and solved my problem.


Reply to this email directly or view it on GitHub
#12 (comment)
.

@mjza
Copy link
Author

mjza commented Feb 4, 2016

There was not any error. Just does not return anything.
You have to use offset.
Just take a look at telegram-cli for history function

history [limit] [offset] Prints messages with this peer (most recent message lower). Also marks messages as read

https://github.com/vysheng/tg/wiki/Telegram-CLI-Commands

@psamim
Copy link
Owner

psamim commented Feb 5, 2016

By looking at https://github.com/vysheng/tg/blob/master/lua-tg.c#L1128, it seems that in the Lua binding the offset is hardcoded as 0.

@psamim
Copy link
Owner

psamim commented Feb 6, 2016

I made a pull request and added a new function to the Lua binding to be able to get history with limit and offset, waiting to be merged.

vysheng/tg#987

@mjza
Copy link
Author

mjza commented Feb 7, 2016

Nice, Thanks.

@s0w4
Copy link

s0w4 commented Sep 2, 2016

@psamim Can only load 3000 messages, 3001 gives nothing

@psamim
Copy link
Owner

psamim commented Sep 2, 2016

@vstet Are you using my pull request for tg or the master branch of tg?

@s0w4
Copy link

s0w4 commented Sep 2, 2016

@psamim just the main instructions from the README.org

@psamim
Copy link
Owner

psamim commented Sep 3, 2016

@vstet Then it is a limit from Telegram API, you can fetch 3000 by 3000 using offsets.

@psamim psamim mentioned this issue Jun 7, 2017
@mrPsycho
Copy link

mrPsycho commented Jun 7, 2017

@mjza could you publish it?

@ToMas-hack
Copy link

ToMas-hack commented Sep 18, 2017

Hi.
Congratulations on the tool.
One question, I am not able to configure it to make me a backup of all the channels and superchannels ...
Can you help me?
Thank you

@ToMas-hack
Copy link

I would like to save the information in a database type sqlite3

@psamim
Copy link
Owner

psamim commented Sep 19, 2017

@ToMas-hack I have not tested this scripts for channels.

@psamim psamim closed this as completed Sep 19, 2017
@psamim psamim reopened this Sep 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants