wiz0u / WTelegramClient

Telegram Client API (MTProto) library written 100% in C# and .NET
https://wiz0u.github.io/WTelegramClient/
MIT License
996 stars 164 forks source link

Question: Can this API bypass the prohibition about copying message contents?. #198

Closed ElektroStudios closed 1 year ago

ElektroStudios commented 1 year ago

Hi. Recently the account and main channel/group of a friend has been hacked, and Telegram support service doesn't answer to requests of account recovery in more than 2 months.

My friend is the owner of the group/channel, and I'm an admin but I don't have enough permissions. The channel has a restriction that does not allow anybody to copy posts links neither content of the posts.

I would like to know whether this API could allows me to enumerate and copy the content of the messages in order to migrate them to a new channel created by the owner / my friend.

In other words, this API could bypass the prohibition about copying message contents and post links?. Thanks in advance.

Note that I'm not requesting the code, just to know the possibilities of this API before I can go deep with the learning of its usage.

PS: If you know any other viable alternative to migrate the posts, or else to recovery the hacked account, please tell it to me.

wiz0u commented 1 year ago

This library is a wrapper around the official Telegram Client API. That's the lowest level API. You will not find other API that go beyond what is possible here.

So try it. Either it works, or you will get an error about content restriction.

As last resort, you can always download the medias (even with content restriction) and reupload them.

wiz0u commented 1 year ago

See 3 different methods for forward/copying without downloading: https://wiz0u.github.io/WTelegramClient/EXAMPLES#forward

ElektroStudios commented 1 year ago

Thank you. Very nice, huge and useful API.

Just for the record if helpful for someone else: If the channel is restricted like in my case, the first and second solution from the three examples above can't forward messages (TL.RpcException: 'CHAT_FORWARDS_RESTRICTED'). The third alternative solution works!! ( Await client.SendMessageAsync(to_chat, msg.message, msg.media?.ToInputMedia(), entities:=msg.entities) )