Back to rankings

danog/MadelineProto

PHPdocs.madelineproto.xyz

Async PHP client API for the telegram MTProto protocol

mtprotobotphpmadelineprototelegrameasytelegram-apisecret-chatsproxyvoipamphpstickers
Star Growth
Stars
3.5k
Forks
866
Weekly Growth
Issues
65
1k2k3k
Jul 2016Nov 2019Mar 2023Jul 2026
ArtifactsPackagistcomposer require danog/madelineproto
README

MadelineProto, a PHP MTProto telegram client

Created by Daniil Gentili

#StandWithUkraine 🇺🇦

Do join the official channel, @MadelineProto and the support groups!

Approved by Telegram!

What's this?

This library can be used to easily interact with Telegram without the bot API, just like the official apps.

It can login with a phone number (MTProto API), or with a bot token (MTProto API, no bot API involved!).

It is now fully async!

Getting started (now fully async!)

<?php

// PHP 8.2+ is required.

if (!file_exists('madeline.php')) {
    copy('https://phar.madelineproto.xyz/madeline.php', 'madeline.php');
}
include 'madeline.php';

$MadelineProto = new \danog\MadelineProto\API('session.madeline');
$MadelineProto->start();

$me = $MadelineProto->getSelf();

$MadelineProto->logger($me);

if (!$me['bot']) {
    $MadelineProto->messages->sendMessage(peer: '@stickeroptimizerbot', message: "/start");

    $MadelineProto->channels->joinChannel(channel: '@MadelineProto');

    try {
        $MadelineProto->messages->importChatInvite(hash: 'https://t.me/+Por5orOjwgccnt2w');
    } catch (\danog\MadelineProto\RPCErrorException $e) {
        $MadelineProto->logger($e);
    }
}
$MadelineProto->echo('OK, done!');

Try running this code in a browser or in a console!

Tip: if you receive an error (or nothing), send us the error message and the MadelineProto.log file that was created in the same directory (if running from a browser).

Made with MadelineProto

The following open source projects were created using MadelineProto: you can directly install them, or explore the source code as direct examples on how to use MadelineProto's many features!

Want to add your own open-source project to this list? Click here!

Some of MadelineProto's core components are also available as separate, standalone libraries:

Documentation

Related repositories
MHSanaei/3x-ui

Xray panel supporting multi-protocol multi-user expire day & traffic & IP limit (Vmess, Vless, Trojan, ShadowSocks, Wireguard, Hysteria, Tunnel, Mixed, HTTP, Tun, MTProto)

GoGo ModulesGNU General Public License v3.0trojanvless
docs.sanaei.dev
43.4k8.3k
LonamiWebs/Telethon

Pure Python 3 MTProto API Telegram client library, for bots too!

PythonPyPIMIT Licenselibrarytelegram
docs.telethon.dev
12.1k1.6k
Jrohy/multi-v2ray

v2ray/xray多用户管理部署程序

PythonPyPIGNU General Public License v3.0v2rayvmess
7k2.3k
telemt/telemt

MTProxy for Telegram on Rust + Tokio

Rustcrates.ioOtheraes-ctrasync
5.5k251
UnigramDev/Unigram

Telegram for Windows

C#GNU General Public License v3.0unigramuwp
microsoft.com/store/apps/9n97zckpd60q
5.3k653
pyrogram/pyrogram

Elegant, modern and asynchronous Telegram MTProto API framework in Python for users and bots

PythonPyPIGNU Lesser General Public License v3.0telegrammtproto
pyrogram.org
4.6k1.4k
9seconds/mtg

Highly opinionated MTPROTO proxy for Telegram

GoGo ModulesMIT Licensemtprotomtproxy
3.6k370
evgeny-nadymov/telegram-react

Experimental Telegram web client with tdlib, webassembly and react js under the hood

JavaScriptnpmGNU General Public License v3.0telegramreact
evgeny-nadymov.github.io/telegram-react/
2.6k683
gotd/td

Telegram client, in Go. (MTProto API)

GoGo ModulesMIT Licensetelegrammtproto
gotd.dev
2.3k199
teamgram/teamgram-server

Unofficial open source mtproto server written in golang with compatible telegram client.

GoGo ModulesApache License 2.0chatim
teamgram.net
2.2k436
alexbers/mtprotoproxy

Async MTProto proxy for Telegram

PythonPyPIMIT Licensepythonmtproto
2.2k517
EverythingSuckz/TG-FileStreamBot

A telegram bot that will give instant stream links for telegram files without the need of waiting till the download completes. (Telegram File Stream Bot)

GoGo ModulesGNU Affero General Public License v3.0pyrogramstreaming
filestream.bot
1.9k1.8k