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 of history do not work with channels #947

Open
RezaSR opened this issue Jan 19, 2016 · 12 comments
Open

offset of history do not work with channels #947

RezaSR opened this issue Jan 19, 2016 · 12 comments

Comments

@RezaSR
Copy link

RezaSR commented Jan 19, 2016

When set offset greater than 0 in history command of channels, it always returns the following error:
{"result": "FAIL", "error_code": 71, "error": "RPC_CALL_FAIL 400: OFFSET_INVALID"}

It works with super groups with no problem, but with channels it does not work at all.
(I tested this with the latest version of test branch)

Please help me.

@pishgaman-org
Copy link

I have same problem.

@pishgaman-org
Copy link

I solved it!
open queries.c file located in tgl directory.
find _tgl_do_get_history function and comment some lines as follows :

static void _tgl_do_get_history (struct tgl_state *TLS, struct get_history_extra *E, void (*callback)(struct tgl_state *TLS,void *callback_extra, int success, int size, struct tgl_message *list[]), void *callback_extra) {
  clear_packet ();
  //tgl_peer_t *C = tgl_peer_get (TLS, E->id);
  //if (tgl_get_peer_type (E->id) != TGL_PEER_CHANNEL || (C && (C->flags & TGLCHF_MEGAGROUP))) {
    out_int (CODE_messages_get_history);
    out_peer_id (TLS, E->id);
  //} else {    
  //  out_int (CODE_channels_get_important_history);

  //  out_int (CODE_input_channel);
  //  out_int (tgl_get_peer_id (E->id));
  //  out_long (E->id.access_hash);
  // }
  out_int (E->max_id);
  out_int (E->offset);
  out_int (E->limit);
  out_int (0);
  out_int (0);
  tglq_send_query (TLS, TLS->DC_working, packet_ptr - packet_buffer, packet_buffer, &get_history_methods, E, callback, callback_extra);
}

save and recompile and enjoy!

@RezaSR
Copy link
Author

RezaSR commented Feb 20, 2016

Thanks for ur help, I will try it.

@che-shr-cat
Copy link

@pishgaman-org Thanks a lot! It works!

@Goblenus
Copy link

Fixed - vysheng/tgl#115

@alisafari2017
Copy link

hi
I can dumping message for channel but I can not dump all message or 1000 number of message, i can dump 50 number of message, are you have solution for dump increase messages?

thank you.
thank

@Goblenus
Copy link

@alisafari2017 So...this project is dead. There is a pretty nice python api for telegram https://github.com/LonamiWebs/Telethon. If you have some questions, write me @Goblenus (Telegram)

@yoossarian
Copy link

Not solved yet :(
telegram-history-dump.rb:51:in exec_tg_command': Telegram command failed: {"result"=>"FAIL", "error_code"=>71, "error"=>"RPC_CALL_FAIL 400: OFFSET_INVALID"} (RuntimeError)`

@Goblenus
Copy link

@yoossarian Do not use it! This project is dead!

@perronet
Copy link

perronet commented Aug 8, 2018

@pishgaman-org Thank you sooo much, works like a charm.

@tomasi-o
Copy link

@yoossarian Do not use it! This project is dead!

is ist? like, really?

@JulienNGirard
Copy link

Just used telethon, worked like a charm and easy to use. Download 2000+ worth of photos from 2017... The readthedocs is not easy to build the queries but I could manage with partial information from different sources.

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

9 participants