TDLib.Api 1.8.45

dotnet add package TDLib.Api --version 1.8.45                
NuGet\Install-Package TDLib.Api -Version 1.8.45                
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="TDLib.Api" Version="1.8.45" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add TDLib.Api --version 1.8.45                
#r "nuget: TDLib.Api, 1.8.45"                
#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 TDLib.Api as a Cake Addin
#addin nuget:?package=TDLib.Api&version=1.8.45

// Install TDLib.Api as a Cake Tool
#tool nuget:?package=TDLib.Api&version=1.8.45                

TDLib

.NET bindings for TDLib (Telegram Database Library): https://github.com/tdlib/td

  • Generated API bindings
  • Supports .NET Standard 2.0 and later

Installation

Install via NuGet: TDLib

NuGet

Dependencies

You're recommended to use precompiled version of TDLib native artifacts from NuGet: tdlib.native.

NuGet

Note that this is the main cross-platform package, and there are per-platform packages and additional options described in the tdlib.native documentation.

Note that tdlib.native is not a dependency of TDLib, so you may choose to build the binaries yourself and provide them at the runtime.

To do that, build TDLib and put the compiled library into your project's output directory

  • tdjson.dll (Windows) (optionally accompanied by other DLL files from the build directory if you want to bundle OpenSSL and ZLib dependencies as well)
  • libtdjson.dylib (MacOS)
  • libtdjson.so (Linux)

Have a question?

Report bugs to the issue tracker.

Ask questions at the discussion section on GitHub.

Using json client

TdJsonClient is a wrapper around native JSON APIs. Use it to send/receive data as strings.

using TdLib;

var json = ""; // json data
double timeout = 1.0; // 1 second

using (var jsonClient = new TdJsonClient())
{
    jsonClient.Send(json); // send request
    var result = jsonClient.Receive(timeout); // receive response
}

Using strongly typed APIs

This library contains generated classes for objects and functions. JSON serialization and deserialization is handled automatically. Use TdClient to asynchronously execute functions.

using TdLib;

using (var client = new TdClient())
{
    try
    {
        // asynchronously execute function
        TdApi.Ok ok = await client.ExecuteAsync(new TdApi.SetAuthenticationPhoneNumber
        {
            PhoneNumber = phoneNumber
        });

        // or use extension method
        ok = await client.SetAuthenticationPhoneNumberAsync(phoneNumber);

        // do something...
    }
    catch (ErrorException e)
    {
        TdApi.Error error = e.Error;

        // handle error...
    }
}

Overriding native bindings

By default, TdSharp will try to detect the platform and use the corresponding bindings to native td library. In case you want to override it (e.g. for Xamarin), create a custom implementation of ITdLibBindings (which corresponds to native library interface used by TdSharp) and pass it to TdClient constructor.

Documentation

License

All the project code is licensed under the MIT license.

The code generated from the upstream TDLib has the same license as TDLib, which is the Boost Software License - Version 1.0.

The license indication in the project's sources is compliant with the [REUSE specification v3.0][reuse.spec].

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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on TDLib.Api:

Package Downloads
TDLib

.NET bindings for TDLib (Telegram Database Library): https://github.com/tdlib/td This is the main binding library. For TL API, see TDLib.Api package.

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on TDLib.Api:

Repository Stars
egramtel/egram.tel
Crossplatform Telegram client
Version Downloads Last updated
1.8.45 31 2/13/2025
1.8.29 5,478 5/29/2024
1.8.21 3,724 11/26/2023
1.8.12 23,591 3/18/2023
1.8.9.1 3,234 1/18/2023
1.8.9 1,382 12/10/2022
1.8.1.1 7,417 6/26/2022
1.8.1 3,262 4/10/2022
1.7.9 14,836 12/4/2021
1.7.0.2 1,628 11/20/2021
1.7.0.1 679 11/6/2021
1.7.0 3,493 2/5/2021
1.6.0 8,124 2/21/2020
1.3.0 6,094 9/8/2018
1.2.1 1,114 8/12/2018
1.2.0 1,615 4/6/2018
1.0.0 1,252 4/1/2018