TDLib 1.8.45
dotnet add package TDLib --version 1.8.45
NuGet\Install-Package TDLib -Version 1.8.45
<PackageReference Include="TDLib" Version="1.8.45" />
paket add TDLib --version 1.8.45
#r "nuget: TDLib, 1.8.45"
// Install TDLib as a Cake Addin #addin nuget:?package=TDLib&version=1.8.45 // Install TDLib as a Cake Tool #tool nuget:?package=TDLib&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
Dependencies
You're recommended to use precompiled version of TDLib native artifacts from NuGet: tdlib.native.
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 | Versions 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. |
-
.NETStandard 2.0
- Newtonsoft.Json (>= 13.0.1)
- TDLib.Api (>= 1.8.45)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on TDLib:
Package | Downloads |
---|---|
Roxxel.TeleSharp
Telegram TDLib Api |
GitHub repositories (1)
Showing the top 1 popular GitHub repositories that depend on TDLib:
Repository | Stars |
---|---|
egramtel/egram.tel
Crossplatform Telegram client
|
Version | Downloads | Last updated |
---|---|---|
1.8.45 | 35 | 2/13/2025 |
1.8.29 | 5,259 | 5/29/2024 |
1.8.21 | 3,741 | 11/26/2023 |
1.8.12 | 23,547 | 3/18/2023 |
1.8.9.1 | 2,752 | 1/18/2023 |
1.8.9 | 1,192 | 12/10/2022 |
1.8.1.1 | 7,138 | 6/26/2022 |
1.8.1 | 2,980 | 4/10/2022 |
1.7.9 | 14,584 | 12/4/2021 |
1.7.0.2 | 1,496 | 11/20/2021 |
1.7.0.1 | 515 | 11/6/2021 |
1.7.0 | 3,309 | 2/5/2021 |
1.6.0 | 7,970 | 2/21/2020 |
1.3.0 | 5,952 | 9/8/2018 |
1.2.1 | 956 | 8/12/2018 |
1.2.0 | 1,446 | 4/6/2018 |
1.0.0 | 1,053 | 4/1/2018 |
[Changed]
- Update to TDLib v1.8.45 (https://github.com/tdlib/td/tree/721300bcb4d0f2114505712f4dc6350af1ce1a09).