TLSharp alternatives and similar packages
Based on the "API" category.
Alternatively, view TLSharp alternatives based on common mentions on social networks and blogs.
-
NancyFx
DISCONTINUED. Lightweight, low-ceremony, framework for building HTTP based services on .Net and Mono. Note: This project is no longer maintained and has been archived. -
Hot Chocolate
Welcome to the home of the Hot Chocolate GraphQL server for .NET, the Strawberry Shake GraphQL client for .NET and Nitro the awesome Monaco based GraphQL IDE. -
WexFlow
DISCONTINUED. An easy and fast way to build automation and workflows on Windows, Linux, macOS, and the cloud. -
Xamarin.Essentials
DISCONTINUED. Xamarin.Essentials is no longer supported. Migrate your apps to .NET MAUI, which includes Maui.Essentials. -
FFImageLoading - Fast & Furious Image Loading
Image loading, caching & transforming library for Xamarin and Windows -
JsonApiDotNetCore
A framework for building JSON:API compliant REST APIs using ASP.NET and Entity Framework Core. -
SapphireDb
SapphireDb Server, a self-hosted, easy to use realtime database for Asp.Net Core and EF Core -
🎨 Awesome .Net Core Education
DISCONTINUED. A curated list of awesome articles and resources for learning and practicing .Net Core and its related technologies. -
Lib.AspNetCore.ServerSentEvents
Lib.AspNetCore.ServerSentEvents is a library which provides Server-Sent Events (SSE) support for ASP.NET Core -
EISK Web API
Project based on latest .NET (v6.0) technologies for building scalable web api, along with clean architecture patterns. -
RedditSharp
DISCONTINUED. C# Implementation of the Reddit API. This is an ("unofficial") Fork of SirCmpwn/RedditSharp with Nuget package/support. -
CommandQuery
Command Query Separation for 🌐ASP.NET Core ⚡AWS Lambda ⚡Azure Functions ⚡Google Cloud Functions -
Lib.Web.Mvc
Lib.Web.Mvc is a library which contains some helper classes for ASP.NET MVC such as strongly typed jqGrid helper, attribute and helper providing support for HTTP/2 Server Push with Cache Digest, attribute and helpers providing support for Content Security Policy Level 2, FileResult providing support for Range Requests, action result and helper providing support for XSL transformation and more. -
Cloud Storage
Storage library provides a universal interface for accessing and manipulating data in different cloud blob storage providers -
FileUltimate
FileUltimate is an ASP.NET File Manager and an ASP.NET File Uploader which supports ASP.NET Core 5.0+, ASP.NET Core 2.1+, ASP.NET MVC 3.0+ and ASP.NET WebForms 4.7.2+ web applications/web sites. -
Juka
🥣 Juka Programming Language - Fast Portable Programming Language. Run code anywhere without complicated installations and admin rights. Simple, yet powerful new programming language [Easy to code and run on any system] IOT devices supported! -
ابزار Persian Tools
Persian Tools for .NET Framework and .NET Core: Shamsi date convertor, All Iranian calendar holidays. Iranian City and provinces, Iranian national ID verification. -
Gamepad-Controller-Test
Gamepads are often used as replacements for Mouse / Keyboard. While it is not possible to use them with every game, there are several games available that support gamepad controls, especially console ports of PC titles or even games designed for gamepad controls in the first place. To ensure maximum compatibility, Windows uses a default gamepad driver which supports a wide variety of gamepads. The most notable exception is the Xbox controllers, which still use XBCD for their enhanced features (e.g., force feedback). Therefore I have decided to make an easy test for gamers to test their gamepad controller devices on the go online without wasting any time trying to install third-party softwares which are usually out of order on their PCs to get the job done. This project is inspired by the work of @greggman and tweaks his work a little bit for a better user experience, all credit goes to him for this amazing work and for making my job easy. -
How to Create Interactive Table View in SwiftUI
This is as example app for demonstration of latest 'Table' view api of SwiftUI -
Developer Exception Json Response Middleware
Http Middleware Extensions for ASP.NET Core application -
VideoUltimate
VideoUltimate is a .NET Video Reader and a .NET Video Thumbnailer which can read any video file format on the planet. It supports .NET 5.0+ or .NET Core 2.0+ and .NET Framework 4.7.2+ web/console/desktop applications. -
ASP.NET WebAPI
Framework that makes it easy to build HTTP services that reach a broad range of clients, including browsers and mobile devices -
ASP.NET Web API
Framework that makes it easy to build HTTP services that reach a broad range of clients, including browsers and mobile devices
CodeRabbit: AI Code Reviews for Developers

* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of TLSharp or a related project?
README
TLSharp
Unofficial Telegram (http://telegram.org) client library implemented in C#.
🚩 Check out TeleJS - a pure JavaScript implementation of Telegram MTP protocol
It's a perfect fit for any developer who would like to send data directly to Telegram users or write own custom Telegram client.
:star2: If you :heart: library, please star it! :star2:
Table of contents
- How do I add this to my project?
- Starter Guide
- Available Methods
- Contributors
- FAQ
- Donations
- Support
- License
How do I add this to my project?
Install via NuGet
> Install-Package TLSharp
or build from source
- Clone TLSharp from GitHub
- Compile source with VS2015 or MonoDevelop
- Add reference to
TLSharp.Core.dll
to your awesome project.
Starter Guide
Quick Configuration
Telegram API isn't that easy to start. You need to do some configuration first.
- Create a developer account in Telegram.
- Goto API development tools and copy API_ID and API_HASH from your account. You'll need it later.
First requests
To start work, create an instance of TelegramClient and establish connection
var client = new TelegramClient(apiId, apiHash);
await client.ConnectAsync();
Now you can work with Telegram API, but ->
Only a small portion of the API methods are available to unauthorized users. (full description)
For authentication you need to run following code
var hash = await client.SendCodeRequestAsync("<user_number>");
var code = "<code_from_telegram>"; // you can change code in debugger
var user = await client.MakeAuthAsync("<user_number>", hash, code);
Full code you can see at AuthUser test
When user is authenticated, TLSharp creates special file called session.dat. In this file TLSharp store all information needed for user session. So you need to authenticate user every time the session.dat file is corrupted or removed.
You can call any method on authenticated user. For example, let's send message to a friend by his phone number:
//get available contacts
var result = await client.GetContactsAsync();
//find recipient in contacts
var user = result.Users
.Where(x => x.GetType() == typeof (TLUser))
.Cast<TLUser>()
.FirstOrDefault(x => x.Phone == "<recipient_phone>");
//send message
await client.SendMessageAsync(new TLInputPeerUser() {UserId = user.Id}, "OUR_MESSAGE");
Full code you can see at SendMessage test
To send message to channel you could use the following code:
//get user dialogs
var dialogs = (TLDialogsSlice) await client.GetUserDialogsAsync();
//find channel by title
var chat = dialogs.Chats
.Where(c => c.GetType() == typeof(TLChannel))
.Cast<TLChannel>()
.FirstOrDefault(c => c.Title == "<channel_title>");
//send message
await client.SendMessageAsync(new TLInputPeerChannel() { ChannelId = chat.Id, AccessHash = chat.AccessHash.Value }, "OUR_MESSAGE");
Full code you can see at SendMessageToChannel test
Working with files
Telegram separate files to two categories -> big file and small file. File is Big if its size more than 10 Mb. TLSharp tries to hide this complexity from you, thats why we provide one method to upload files UploadFile.
var fileResult = await client.UploadFile("cat.jpg", new StreamReader("data/cat.jpg"));
TLSharp provides two wrappers for sending photo and document
await client.SendUploadedPhoto(new TLInputPeerUser() { UserId = user.Id }, fileResult, "kitty");
await client.SendUploadedDocument(
new TLInputPeerUser() { UserId = user.Id },
fileResult,
"some zips", //caption
"application/zip", //mime-type
new TLVector<TLAbsDocumentAttribute>()); //document attributes, such as file name
Full code you can see at SendPhotoToContactTest and SendBigFileToContactTest
To download file you should call GetFile method
await client.GetFile(
new TLInputDocumentFileLocation()
{
AccessHash = document.AccessHash,
Id = document.Id,
Version = document.Version
},
document.Size); //size of fileChunk you want to retrieve
Full code you can see at DownloadFileFromContactTest
Available Methods
For your convenience TLSharp have wrappers for several Telegram API methods. You could add your own, see details below.
- IsPhoneRegisteredAsync
- SendCodeRequestAsync
- MakeAuthAsync
- SignUpAsync
- GetContactsAsync
- SendMessageAsync
- SendTypingAsync
- GetUserDialogsAsync
- SendUploadedPhoto
- SendUploadedDocument
- GetFile
- UploadFile
- SendPingAsync
- GetHistoryAsync
What if you can't find needed method at the list?
Don't panic. You can call any method with help of SendRequestAsync
function. For example, send user typing method:
//Create request
var req = new TLRequestSetTyping()
{
Action = new TLSendMessageTypingAction(),
Peer = new TLInputPeerUser() { UserId = user.Id }
};
//run request, and deserialize response to Boolean
return await client.SendRequestAsync<Boolean>(req);
Where you can find a list of requests and its params?
The only way is Telegram API docs. Latest scheme in JSON format you can find here.
What things can I Implement (Project Roadmap)?
Latest Release
- [DONE] Add PHONE_MIGRATE handling
- [DONE] Add FILE_MIGRATE handling
- [DONE] Add NuGet package
- [DONE] Add wrappers for media uploading and downloading
- Add Updates handling (WIP)
- Store user session as JSON (WIP)
- Upgrade MTProto protocol version to 2.0 (WIP)
- SRP/2FA support (WIP)
FAQ
What API layer is supported?
The latest layer supported by TLSharp is 66. If you need a higher layer, help us test the preview version of TgSharp (your feedback is welcome!)
I get a xxxMigrationException or a MIGRATE_X error!
TLSharp library should automatically handle these errors. If you see such errors, please open a new Github issue with the details (include a stacktrace, etc.).
I get an exception: System.IO.EndOfStreamException: Unable to read beyond the end of the stream. All test methos except that AuthenticationWorks and TestConnection return same error. I did every thing including setting api id and hash, and setting server address.-
You should create a Telegram session. See configuration guide
Why do I get a FloodException/FLOOD_WAIT error?
After you get this, you cannot use Telegram's API for a while. You can know the time to wait by accessing the FloodException::TimeToWait property.
If this happens too often and/or the TimeToWait value is too long, there may be something odd going on. First and foremost, are you using TLSharp to manage more than one telegram account from the same host(server)? If yes, it's likely that you're hitting Telegram restrictions. We recommend that you use TLSharp in a standalone-device app (so that each instance of your program only uses one telegram account), so for example a mobile app, not a web app. If, on the other hand, you're completely sure that you found a bug in TLSharp about this, please open a Github issue.
Why does TLSharp lacks feature XXXX?
TLSharp only covers basic functionality of the Telegram protocol, you can be a contributor or a sponsor to speed-up developemnt of any more new features.
Where else to ask for help?
If you think you have found a bug in TLSharp, create a github issue. But if you just have questions about how to use TLSharp, use our gitter channel (https://gitter.im/TLSharp/Lobby) or our Telegram channel (https://t.me/joinchat/AgtDiBEqG1i-qPqttNFLbA).
Attach following information:
- Full problem description and exception message
- Stack-trace
- Your code that runs in to this exception
Without information listen above your issue will be closed.
Donations
Thanks for donations! It's highly appreciated.
List of donators:
Support
If you have troubles while using TLSharp, I can help you for an additional fee.
My pricing is 219$/hour. I accept PayPal. To request a paid support write me at Telegram @sochix, start your message with phrase [PAID SUPPORT].
Contributors
- Afshin Arani - TLGenerator, and a lot of other usefull things
- knocte
License
Please, provide link to an author when you using library
The MIT License
Copyright (c) 2015 Ilya Pirozhenko http://www.sochix.ru/
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*Note that all licence references and agreements mentioned in the TLSharp README section above
are relevant to that project's source code only.