mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-25 10:53:44 +03:00
Removed references to TLSharp since they're "ads"
See their #197 issue.
This commit is contained in:
parent
a7c7fdd2e4
commit
0fe0cdf682
17
README.md
17
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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 *
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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))
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user