tdlib / td

Cross-platform library for building Telegram clients
https://core.telegram.org/tdlib
Boost Software License 1.0
7.11k stars 1.44k forks source link

Joining supergroup/private channel #2463

Closed DenisTTTT closed 1 year ago

DenisTTTT commented 1 year ago

Hello! I have to get messages out of arbitrary telegram channels. UseMessageDatabase is set to false. Tried JoinChat and AddChatMembers providing chat id I know in advance. Both returned "chat is not found". Is there any correct way to do that with TdLib? Also maybe any way to get chat messages for non-member does exist?

Thanks, Denis

levlam commented 1 year ago

It is not possible to get a chat by its identifier. You can only use chat identifiers that were received from TDLib.

DenisTTTT commented 1 year ago

Could you please advice how could I get one from TDLib? If I know channel name but not subscribed yet...

levlam commented 1 year ago

You can use searchPublicChat to get a chat by its username.

DenisTTTT commented 1 year ago

Thanks a lot, I will try that! As for the second part of my question - is it possible to get messages out of the public chat without joining it?

levlam commented 1 year ago

If something is possible to do with a Telegram app, you can do the same with TDLib.