diff --git a/README.md b/README.md index 85e87c1a..3daa78a2 100755 --- a/README.md +++ b/README.md @@ -1,10 +1,6 @@ # Telethon -**Telethon** is Telegram client implementation in Python. This project's _core_ is **completely based** on -[TLSharp](https://github.com/sochix/TLSharp). All the files which are fully based on it will have a notice -on the top of the file. Also don't forget to have a look to the original project. - -The files without the previously mentioned notice are no longer part of TLSharp itself, or have enough modifications -to make them entirely different. +**Telethon** is Telegram client implementation in Python which uses the latest available API of Telegram. +The project's **core only** is based on TLSharp, a C# Telegram client implementation. # Table of contents - [Why Telethon?](#why-telethon) @@ -20,19 +16,20 @@ to make them entirely different. - [Plans for the future](#plans-for-the-future) ## Why Telethon? -> Why should I bother with Telethon? You already mentioned [TLSharp](https://github.com/sochix/TLSharp). -> [telegram-cli](https://github.com/vysheng/tg) has also been around for a long while. And we have the +> Why should I bother with Telethon? There are more mature projects already, such as +> [telegram-cli](https://github.com/vysheng/tg) with even (limited) Python support. And we have the > [official](https://github.com/telegramdesktop/tdesktop) [clients](https://github.com/DrKLO/Telegram)! With Telethon you don't really need to know anything before using it. Create a client with your settings. Connect. You're ready to go. -Being written on Python, Telethon can run as a script under any environment you wish, (yes, +Being written **entirely** on Python, Telethon can run as a script under any environment you wish, (yes, [Android too](https://f-droid.org/repository/browse/?fdfilter=termux&fdid=com.termux)). You can schedule it, or use it in any other script you have. Want to send a message to someone when you're available? Write a script. Do you want check for new messages at a given time and find relevant ones? Write a script. -An official client has a feature which Telethon doesn't? [Implement it easily](#how-to-add-more-functions-to-telegramclient). +Hungry for more API calls which the `TelegramClient` class doesn't _seem_ to have implemented? +Please read [this section](#using-more-than-just-telegramclient). ## Requirements ### Python modules diff --git a/crypto/aes.py b/crypto/aes.py index cf442617..dc0eda39 100644 --- a/crypto/aes.py +++ b/crypto/aes.py @@ -1,5 +1,3 @@ -# This file is based on TLSharp -# https://github.com/sochix/TLSharp/blob/master/TLSharp.Core/MTProto/Crypto/AES.cs import pyaes diff --git a/crypto/auth_key.py b/crypto/auth_key.py index d6d60edd..ecd85f57 100755 --- a/crypto/auth_key.py +++ b/crypto/auth_key.py @@ -1,5 +1,3 @@ -# This file is based on TLSharp -# https://github.com/sochix/TLSharp/blob/master/TLSharp.Core/MTProto/Crypto/AuthKey.cs from utils import BinaryWriter, BinaryReader import utils diff --git a/crypto/factorizator.py b/crypto/factorizator.py index 70cb2a50..aecdd797 100755 --- a/crypto/factorizator.py +++ b/crypto/factorizator.py @@ -1,5 +1,3 @@ -# This file is based on TLSharp -# https://github.com/sochix/TLSharp/blob/master/TLSharp.Core/MTProto/Crypto/Factorizator.cs from random import randint diff --git a/crypto/rsa.py b/crypto/rsa.py index 4c6cc8ec..44f858c0 100755 --- a/crypto/rsa.py +++ b/crypto/rsa.py @@ -1,5 +1,3 @@ -# This file is based on TLSharp -# https://github.com/sochix/TLSharp/blob/master/TLSharp.Core/MTProto/Crypto/RSA.cs import utils from utils import BinaryWriter diff --git a/network/authenticator.py b/network/authenticator.py index 67cf25e3..ff7a6eba 100755 --- a/network/authenticator.py +++ b/network/authenticator.py @@ -1,9 +1,3 @@ -# This file is based on TLSharp -# https://github.com/sochix/TLSharp/blob/master/TLSharp.Core/Auth/Authenticator.cs -# https://github.com/sochix/TLSharp/blob/master/TLSharp.Core/Auth/Step1_PQRequest.cs -# https://github.com/sochix/TLSharp/blob/master/TLSharp.Core/Auth/Step2_DHExchange.cs -# https://github.com/sochix/TLSharp/blob/master/TLSharp.Core/Auth/Step3_CompleteDHExchange.cs - import time import utils from utils import BinaryWriter, BinaryReader diff --git a/network/mtproto_plain_sender.py b/network/mtproto_plain_sender.py index 08bf8541..3994f37a 100755 --- a/network/mtproto_plain_sender.py +++ b/network/mtproto_plain_sender.py @@ -1,5 +1,3 @@ -# This file is based on TLSharp -# https://github.com/sochix/TLSharp/blob/master/TLSharp.Core/Network/MtProtoPlainSender.cs import time import random from utils import BinaryWriter, BinaryReader diff --git a/network/mtproto_sender.py b/network/mtproto_sender.py index 528c3247..f49b6b84 100755 --- a/network/mtproto_sender.py +++ b/network/mtproto_sender.py @@ -1,5 +1,3 @@ -# This file is based on TLSharp -# https://github.com/sochix/TLSharp/blob/master/TLSharp.Core/Network/MtProtoSender.cs import gzip from errors import * from time import sleep diff --git a/network/tcp_transport.py b/network/tcp_transport.py index 73672793..6268e191 100755 --- a/network/tcp_transport.py +++ b/network/tcp_transport.py @@ -1,5 +1,3 @@ -# This file is based on TLSharp -# https://github.com/sochix/TLSharp/blob/master/TLSharp.Core/Network/TcpTransport.cs from network import TcpClient from binascii import crc32 from errors import * diff --git a/telegram_client.py b/telegram_client.py index 051353bf..a0cd9745 100644 --- a/telegram_client.py +++ b/telegram_client.py @@ -1,5 +1,3 @@ -# This file structure is based on TLSharp -# https://github.com/sochix/TLSharp/blob/master/TLSharp.Core/TelegramClient.cs import platform from datetime import datetime from hashlib import md5 diff --git a/tl/mtproto_request.py b/tl/mtproto_request.py index 08784d38..4f7d58db 100755 --- a/tl/mtproto_request.py +++ b/tl/mtproto_request.py @@ -1,5 +1,3 @@ -# This file is based on TLSharp -# https://github.com/sochix/TLSharp/blob/master/TLSharp.Core/Requests/MTProtoRequest.cs from datetime import datetime, timedelta diff --git a/tl/session.py b/tl/session.py index b5e8ef64..d3bb018b 100755 --- a/tl/session.py +++ b/tl/session.py @@ -1,5 +1,3 @@ -# This file is based on TLSharp -# https://github.com/sochix/TLSharp/blob/master/TLSharp.Core/Session.cs from os.path import isfile as file_exists import time import pickle diff --git a/unittests/utils_tests.py b/unittests/utils_tests.py index cff23965..edd0f668 100644 --- a/unittests/utils_tests.py +++ b/unittests/utils_tests.py @@ -50,7 +50,7 @@ class UtilsTests(unittest.TestCase): with BinaryWriter() as writer: writer.write_int(0x60469778) buffer = writer.get_bytes() - valid = b'\x78\x97\x46\x60' # Tested written bytes using TLSharp and C#'s MemoryStream + valid = b'\x78\x97\x46\x60' # Tested written bytes using C#'s MemoryStream assert buffer == valid, "Written type should be {} but is {}".format(list(valid), list(buffer))