Skip to content

Latest commit

 

History

History
58 lines (41 loc) · 2.52 KB

README.md

File metadata and controls

58 lines (41 loc) · 2.52 KB

Telega

NuGet version

You can see the library usage example here.

Also you can read the introduction.

Quick start

  • Clone the repository.
  • Run Telega.Rpc.Dto.Generator to generate DTOs. You can use ./generate-dto.sh. NET Core 3.0 is used.
  • Create config.json in Telega.Example. It should look like
{
  "apiId": 12345,
  "apiHash": "api-hash",
  "phone": "123456789",
  "password": "password-if-needed"
}
  • Run Telega.Example. Sign in to your account. The app should send a picture to your 'Saved Messages' chat.

If you are not familiar with functional programming you can read LanguageExt introduction. If you are not familiar with LanguageExt you can read LanguageExt readme.

Structure

  • Telega.Rpc.Dto.Generator - a generator of DTO objects.
  • Telega.Rpc.Dto - a directory in Telega project that contains generated Types and Functions (they are excluded from git because the size is ~5MB). Based on LanguageExt. DTOs handle serialization without reflection.
  • Telega - the main project that contains MTProto and Telegram API implementations, TelegramClient and other auxiliary classes.

Project status

Telega is not actively developed. But it is supported. Feel free to open issues and text me in Telegram :)

Difference from TLSharp

The root of Telega is TLSharp. However the library is designed completely different.

  • netstandard 2.0 target
  • layer 114
  • a new DTO generator which is based on .tl scheme
  • completely redesigned DTOs
  • elimination of all reflection usages (even in deserialization)
  • RPC backround receive (vs pull after sending in the original library)
  • RPC queue (it is needed to fix a simultaneos requests problem)
  • session atomic-like updates (with a backup file usage)
  • enhanced exceptions (no more InvalidOperationException)
  • enhanced factorization via Pollard's rho algorithm
  • MTProto 2.0
  • major refactoring of the whole library

Versioning

Telega uses customized SemVer. Before 1.0.0 version is released Minor increments can break compatibility.