ModernTlSharp 1.2.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package ModernTlSharp --version 1.2.1
NuGet\Install-Package ModernTlSharp -Version 1.2.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ModernTlSharp" Version="1.2.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ModernTlSharp --version 1.2.1
#r "nuget: ModernTlSharp, 1.2.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install ModernTlSharp as a Cake Addin
#addin nuget:?package=ModernTlSharp&version=1.2.1

// Install ModernTlSharp as a Cake Tool
#tool nuget:?package=ModernTlSharp&version=1.2.1

ModernTlSharp

A .Net Core 3.1 copy of TLSharp with extensions for easier use...

this project is a port of TLSharp

Differences

  • Changed target framework to .Net Core 3.1
  • Added Some extension methods and classes:
    • UpdateCatcher (This can help you receive updates immediately and returns TLDifference).
    • SendTextMessages (Can be useful to sent text messages to supergroups and private chats easily)
    • MakeSeen (To mark messages history readed)
    • Something more soon...

Install

Package Manager .Net Cli
Install-Package ModernTlSharp -Version 1.2.1 dotnet add package ModernTlSharp --version 1.2.1

Usage

After authorization you can call UpdateCatcher extension method and pass a callback function to handle Update (A of class of TLDifference) (here is UpdateCatched).

Also I add a MessageHandler method it easier to work with Update. you should change it depending on your need... (here we can handle texts from private and super-group chats in MessageHandler).

Update object contains every new updates that catched from telegram.

There is an example in project files (ModernTLSharp.Test)

Example

ConsoleAuthocate:
//var auth = new ModernTlSharp.TLSharp.Extensions.Authorization(TelegramClient,
//    "+12345678998");

//await auth.ConsoleAuthocate();

Authorization auth = new ModernTlSharp.TLSharp.Extensions.Authorization(TelegramClient);

await auth.ConsoleAuthocate();
UpdateCatcher:
static async Task Main()
{
    TelegramClient = new TelegramClient(API_ID, API_HASH);

    await TelegramClient.ConnectAsync();

    //var auth = new ModernTlSharp.TLSharp.Extensions.Authorization(TelegramClient,
    //    "+12345678998");

    //await auth.ConsoleAuthocate();

    Authorization auth = new ModernTlSharp.TLSharp.Extensions.Authorization(TelegramClient);

    await auth.ConsoleAuthocate();

    await TelegramClient.UpdateCatcher(UpdateCatched);
}

private static async Task UpdateCatched(Update arg)
{
    //handel updates here!
}
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp3.1 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.2.4 6,766 9/9/2020
1.2.1 463 8/10/2020
1.1.2 396 8/4/2020
1.1.1 415 8/1/2020
1.1.0 559 7/31/2020