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

Chat not found 400 #2857

Closed LsdLucifer closed 5 months ago

LsdLucifer commented 6 months ago

Hello. I have a user who should join a group via its chat ID. However, the user cannot do this because... TO JOIN THE GROUP, YOU NEED TO RECEIVE INFORMATION ABOUT THE GROUP, WHICH CANNOT BE OBTAINED WITHOUT JOINING IT...

LsdLucifer commented 6 months ago

Can I somehow retrieve data about groups (chats) from another user-bot's db.sqlite for my new user-bot?

levlam commented 6 months ago

No. You can't access chats by their identifier. You must find them in the same way as you would do in any Telegram app.

LsdLucifer commented 6 months ago

@levlam How can I implement functionality for my program to automatically join a group and subscribe to it?

levlam commented 6 months ago

You need to do exactly the same actions as you would do in a Telegram app.

LsdLucifer commented 6 months ago

@levlam Why does TdApi.JoinChat even exist then? I want my program to add a user to a group. How can I do that? I'm not interested in doing it manually through Telegram.

levlam commented 6 months ago

You must do the same actions with appropriate methods.

LsdLucifer commented 6 months ago

@levlam When I use this method, I get a 400 error 'chat not found,' as I mentioned above. Please provide an example of using this method.

levlam commented 6 months ago

You don't enter chat identifier in apps. You must find the chat first in the same way you do in the apps.

LsdLucifer commented 6 months ago

@levlam I understand. You're suggesting that I manually enter the Telegram app and join the group. However, I have a link and a chat ID for the group. I want to join it automatically without opening Telegram. How can I use tdlib Java to join groups using their links or chat IDs? Ideally, I'd like to join via a regular link. (I've been able to join using invitation links, but I need to join the group via a regular link).

levlam commented 6 months ago

No, I suggest that you call the same methods, you would use in any other app.

Any internal link can be processed using getInternalLinkType and following documentation for the returned object.