Top Related Projects
Telegram for Android source
Telegram-iOS
Cross-platform library for building Telegram clients
Telegram web application, GPL v3
Unofficial, FOSS-friendly fork of the original Telegram client for Android
Pure Python 3 MTProto API Telegram client library, for bots too!
Quick Overview
Telegram Desktop is the official desktop version of the Telegram messaging app. It's an open-source project that provides a feature-rich, secure, and fast messaging experience for desktop users across multiple platforms.
Pros
- Cross-platform support (Windows, macOS, Linux)
- Open-source, allowing for community contributions and transparency
- Strong focus on security and privacy
- Regular updates and feature parity with mobile versions
Cons
- Complex codebase, which can be challenging for new contributors
- Some users report higher resource usage compared to other messaging apps
- Occasional sync issues between desktop and mobile versions
- Limited customization options compared to third-party Telegram clients
Getting Started
To build Telegram Desktop from source:
-
Clone the repository:
git clone --recursive https://github.com/telegramdesktop/tdesktop.git
-
Install dependencies (example for Ubuntu):
sudo apt-get install cmake gcc-11 g++-11 libssl-dev libffi-dev libicu-dev libxcb1-dev libxcb-keysyms1-dev libxcb-icccm4-dev libxcb-image0-dev libxcb-shm0-dev libxcb-xfixes0-dev libxcb-render-util0-dev libxcb-shape0-dev libxcb-randr0-dev libxcb-xinerama0-dev libxcb-xkb-dev libxkbcommon-dev libxkbcommon-x11-dev
-
Build the project:
cd tdesktop mkdir build cd build cmake -DCMAKE_BUILD_TYPE=Release .. cmake --build .
-
Run the built executable:
./bin/Telegram
For more detailed instructions and platform-specific guides, refer to the project's README file.
Competitor Comparisons
Telegram for Android source
Pros of Telegram
- Native Android app with better performance and integration
- More frequent updates and active development
- Smaller app size, optimized for mobile devices
Cons of Telegram
- Limited to Android platform, not cross-platform like tdesktop
- Less customizable UI compared to tdesktop
- May lack some advanced features available in the desktop version
Code Comparison
Telegram (Java):
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// Android-specific initialization
}
tdesktop (C++):
int main(int argc, char *argv[]) {
Sandbox sandbox(argc, argv);
return Messenger::main(sandbox);
}
The code snippets highlight the different languages and platforms: Telegram uses Java for Android development, while tdesktop employs C++ for cross-platform desktop applications. Telegram's code focuses on Android-specific lifecycle methods, whereas tdesktop's main function initializes the application using custom classes for sandboxing and messaging functionality.
Both repositories are actively maintained and contribute to the Telegram ecosystem, with Telegram focusing on the Android platform and tdesktop providing a cross-platform desktop solution.
Telegram-iOS
Pros of Telegram-iOS
- Native iOS experience with smooth performance and UI/UX optimized for Apple devices
- Swift-based codebase, leveraging modern iOS development practices
- Tighter integration with iOS-specific features like Siri, widgets, and app extensions
Cons of Telegram-iOS
- Limited to iOS platform, lacking cross-platform compatibility
- Smaller contributor base due to platform-specific nature
- Potentially slower feature rollout compared to the desktop version
Code Comparison
Telegram-iOS (Swift):
class ChatListController: ViewController {
private let chatListNode: ChatListNode
init(context: AccountContext) {
self.chatListNode = ChatListNode(context: context)
super.init(navigationBarPresentationData: nil)
}
}
tdesktop (C++):
class MainWidget : public QWidget, private base::Subscriber {
public:
MainWidget(QWidget *parent);
void showSettings();
void setInnerFocus();
void updateOnlineDisplay();
};
The code snippets demonstrate the different languages and approaches used in each project. Telegram-iOS uses Swift with a more modern, object-oriented structure, while tdesktop employs C++ with Qt framework integration for cross-platform development.
Cross-platform library for building Telegram clients
Pros of td
- More focused and lightweight library for Telegram API integration
- Better suited for cross-platform development and embedding in other applications
- Provides a lower-level API, offering more flexibility and control
Cons of td
- Requires more setup and configuration compared to tdesktop
- Less user-friendly for developers who want a ready-to-use Telegram client
- May require additional work to implement a full-featured Telegram client
Code Comparison
td (C++ example):
auto client = td::Client::create();
client->send({1, td_api::make_object<td_api::setAuthenticationPhoneNumber>(
phone_number, nullptr)});
tdesktop (C++ example):
auto &account = Core::App().domain().active();
account.setPhoneNumber(phone_number);
Summary
td is a more flexible and lightweight library for Telegram API integration, suitable for cross-platform development and embedding in other applications. It offers a lower-level API, providing developers with more control but requiring additional setup and configuration.
tdesktop, on the other hand, is a full-featured Telegram desktop client, offering a more user-friendly experience for developers who want a ready-to-use application. It may be less flexible for custom integrations but provides a complete Telegram client out of the box.
The choice between td and tdesktop depends on the specific requirements of the project and the level of customization needed.
Telegram web application, GPL v3
Pros of Webogram
- Web-based client, accessible from any browser without installation
- Lightweight and faster to load initially compared to desktop app
- Easier to maintain and update across platforms
Cons of Webogram
- Limited access to system-level features and notifications
- May have slower performance for resource-intensive tasks
- Potentially less secure due to browser vulnerabilities
Code Comparison
Webogram (JavaScript):
function sendMessage(message) {
return $q(function (resolve, reject) {
MtpApiManager.invokeApi('messages.sendMessage', {
peer: getInputPeer(peerID),
message: message
}).then(function (result) {
resolve(result);
}, reject);
});
}
TDesktop (C++):
bool MainWidget::sendMessage(const QString &message) {
if (!_history) {
return false;
}
auto result = _history->sendMessage(
message,
MessageFlag::HasFromId,
0,
false,
nullptr,
nullptr,
nullptr);
return result != nullptr;
}
The code snippets show different approaches to sending messages, with Webogram using JavaScript and promises, while TDesktop uses C++ and object-oriented programming.
Unofficial, FOSS-friendly fork of the original Telegram client for Android
Pros of Telegram-FOSS
- Fully open-source, allowing for community audits and contributions
- Removes proprietary dependencies, enhancing privacy and security
- Excludes Google Play Services, reducing data collection concerns
Cons of Telegram-FOSS
- May lack some features present in the official Telegram app
- Potentially slower update cycle compared to the official version
- Might have compatibility issues with certain devices or systems
Code Comparison
Telegram-FOSS:
#define TDESKTOP_DISABLE_AUTOUPDATE
#define TDESKTOP_DISABLE_CRASH_REPORTS
#define TDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME
tdesktop:
// These features are typically enabled in the official version
// #define TDESKTOP_DISABLE_AUTOUPDATE
// #define TDESKTOP_DISABLE_CRASH_REPORTS
// #define TDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME
The Telegram-FOSS codebase disables certain features by default to enhance privacy and reduce reliance on proprietary services. The tdesktop repository typically keeps these features enabled, providing a more feature-rich but potentially less privacy-focused experience.
Pure Python 3 MTProto API Telegram client library, for bots too!
Pros of Telethon
- Written in Python, making it more accessible for scripting and rapid development
- Focuses on API interactions, ideal for building bots and automated tools
- Lightweight and easy to integrate into existing Python projects
Cons of Telethon
- Limited to backend functionality, not suitable for creating full-fledged desktop applications
- May require additional libraries for advanced features like GUI development
- Performance may be slower compared to C++ implementations for resource-intensive tasks
Code Comparison
Telethon (Python):
from telethon import TelegramClient, events
client = TelegramClient('session', api_id, api_hash)
@client.on(events.NewMessage(pattern='/start'))
async def start_handler(event):
await event.reply('Hello, I am a Telethon bot!')
client.start()
client.run_until_disconnected()
tdesktop (C++):
#include "api/api_text_entities.h"
#include "core/application.h"
#include "main/main_session.h"
void sendMessage(const QString &text) {
auto &session = Core::App().session();
session.sendMessage(text, Api::EntitiesInText());
}
The code snippets demonstrate the difference in approach and language between the two projects. Telethon focuses on event-based bot creation, while tdesktop provides lower-level access to Telegram's functionality for building a complete desktop application.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
Telegram Desktop â Official Messenger
This is the complete source code and the build instructions for the official Telegram messenger desktop client, based on the Telegram API and the MTProto secure protocol.
The source code is published under GPLv3 with OpenSSL exception, the license is available here.
Supported systems
The latest version is available for
- Windows 7 and above (64 bit) (portable)
- Windows 7 and above (32 bit) (portable)
- macOS 10.13 and above
- Linux static build for 64 bit
- Snap
- Flatpak
Old system versions
Version 4.9.9 was the last that supports older systems
Version 2.4.4 was the last that supports older systems
Version 1.8.15 was the last that supports older systems
Third-party
- Qt 6 (LGPL) and Qt 5.15 (LGPL) slightly patched
- OpenSSL 3.2.1 (Apache License 2.0)
- WebRTC (New BSD License)
- zlib 1.2.11 (zlib License)
- LZMA SDK 9.20 (public domain)
- liblzma (public domain)
- Google Breakpad (License)
- Google Crashpad (Apache License 2.0)
- GYP (BSD License)
- Ninja (Apache License 2.0)
- OpenAL Soft (LGPL)
- Opus codec (BSD License)
- FFmpeg (LGPL)
- Guideline Support Library (MIT License)
- Range-v3 (Boost License)
- Open Sans font (Apache License 2.0)
- Vazir font (SIL Open Font License 1.1)
- Emoji alpha codes (MIT License)
- xxHash (BSD License)
- QR Code generator (MIT License)
- CMake (New BSD License)
- Hunspell (LGPL)
Build instructions
- Windows (32-bit) (64-bit)
- macOS
- GNU/Linux using Docker
Top Related Projects
Telegram for Android source
Telegram-iOS
Cross-platform library for building Telegram clients
Telegram web application, GPL v3
Unofficial, FOSS-friendly fork of the original Telegram client for Android
Pure Python 3 MTProto API Telegram client library, for bots too!
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot