All Projects → egramtel → Tdsharp

egramtel / Tdsharp

Licence: mit
C#/.NET Core bindings for TDLib (Telegram MTProto API)

Programming Languages

csharp
926 projects

Projects that are alternatives of or similar to Tdsharp

Telethon
Pure Python 3 MTProto API Telegram client library, for bots too!
Stars: ✭ 5,805 (+5535.92%)
Mutual labels:  telegram-api, telegram
Telegram Api
Complete async capable Telegram bot API implementation for PHP7
Stars: ✭ 650 (+531.07%)
Mutual labels:  telegram-api, telegram
Telegram Mtproto
Telegram client api (MTProto) library
Stars: ✭ 542 (+426.21%)
Mutual labels:  telegram-api, telegram
Telegram
Telegram Bot API Wrapper for Scala
Stars: ✭ 310 (+200.97%)
Mutual labels:  telegram-api, telegram
Tlsharp
Telegram client library implemented in C#
Stars: ✭ 895 (+768.93%)
Mutual labels:  telegram-api, telegram
Groupbutler
This bot can help you in managing your group with rules, anti-flood, description, custom triggers, and much more!
Stars: ✭ 399 (+287.38%)
Mutual labels:  telegram-api, telegram
Telegramd
Unofficial open source telegram server written in golang
Stars: ✭ 609 (+491.26%)
Mutual labels:  telegram-api, telegram
Go Tdlib
Golang Telegram TdLib JSON bindings
Stars: ✭ 244 (+136.89%)
Mutual labels:  telegram-api, telegram
Java Telegram Bot Api
Telegram Bot API for Java
Stars: ✭ 819 (+695.15%)
Mutual labels:  telegram-api, telegram
Chatistics
💬 Python scripts to parse Messenger, Hangouts, WhatsApp and Telegram chat logs into DataFrames.
Stars: ✭ 814 (+690.29%)
Mutual labels:  telegram-api, telegram
telegram-bot-delphi
A simple example of integration with a telegram bot API.
Stars: ✭ 22 (-78.64%)
Mutual labels:  telegram, telegram-api
Drone Telegram
Drone plugin for sending Telegram notifications
Stars: ✭ 67 (-34.95%)
Mutual labels:  telegram-api, telegram
tg
`telegram-cli` for Telegram IM
Stars: ✭ 306 (+197.09%)
Mutual labels:  telegram, telegram-api
Tgbot Cpp
C++ library for Telegram bot API
Stars: ✭ 439 (+326.21%)
Mutual labels:  telegram-api, telegram
Python Telegram
Python client for the Telegram's tdlib
Stars: ✭ 246 (+138.83%)
Mutual labels:  telegram-api, telegram
Mtproto
Full-native go implementation of Telegram API
Stars: ✭ 566 (+449.51%)
Mutual labels:  telegram-api, telegram
Core
PHP Telegram Bot based on the official Telegram Bot API
Stars: ✭ 2,899 (+2714.56%)
Mutual labels:  telegram-api, telegram
Mtproto Core
Telegram API JS (MTProto) client library for browser and nodejs
Stars: ✭ 242 (+134.95%)
Mutual labels:  telegram-api, telegram
Informer
A Telegram Mass Surveillance Bot in Python
Stars: ✭ 745 (+623.3%)
Mutual labels:  telegram-api, telegram
Mypackbot
🤖 Your own unlimited pack of Telegram-stickers
Stars: ✭ 18 (-82.52%)
Mutual labels:  telegram-api, telegram

TDLib

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

  • Generated API bindings
  • .NET Core and .NET Standard support

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 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)

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].