Skip to content
Fast async php telegram client: MadelineProto + Swoole Server
Branch: master
Clone or download
Latest commit 55c2ff4 May 16, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
src Multiple headers support May 12, 2019
.env.example Update logger level May 14, 2019
.gitignore Readme update & new api methods Jan 23, 2019
LICENSE Initial commit Dec 24, 2018 Readme update Mar 18, 2019
bootstrap.php Update vendor May 14, 2019
composer.json Update vendor May 16, 2019
composer.lock Update vendor May 16, 2019
config.php Update logger level May 14, 2019
server.php Code Style Mar 18, 2019


Fast, simple, async php telegram client and parser: MadelineProto and Swoole Server


  • Fast async swoole server
  • Use as micro-service to access telegram api
  • Get any public telegram posts from groups as json


  1. Get app_id and app_hash at

  2. Swoole extension required: Install swoole

  3. composer install to install required libs

  4. Create .env from .env.example

  5. Fill variables in .env


  6. Use supervisor to monitor and restart swoole servers. Example of /etc/supervisor/conf.d/telegram_rss.conf:

    command=/usr/bin/php /home/admin/web/


  1. Run server/parser

    php server.php [--help] [-a|--address=] [-p|--port=9503]
            --help      Show this message
        -a  --address   Server ip (optional) (example:
        -p  --port      Server port (optional) (example: 9503)
        -s  --session   Prefix for session file (optional) (example: xtrime)
    Also  options can be set in .env file (see .env.example)
  2. Access telegram api directly via simple get requests.

    • All methods from MadelineProto supported: Methods List
    • Url: http://%address%:%port%/api/%class%.%method%/?%param1%=%val%
    • Important: api available only from ip in whitelist. By default it is: You can add client ip in .env file to API_CLIENT_WHITELIST (use json format)
    • If method is inside class (messages, contacts and etc.) use '.' to separate class from method:
    • If method requires array of values, use any name of array, for example 'data': ?data[peer]=@xtrime&data[message]=Hello!. Order of parameters does't matter in this case.
    • If method requires one or multiple separate parameters (not inside array) then pass parameters with any names but in strict order: or works the same


    • get_info about channel/user:
    • get_info about currect account:
    • repost:[from_peer]=@xtrime&data[to_peer]=@xtrime&data[id]=1234
    • get messages from channel/user:[peer]=@breakingmash&data[limit]=10
    • search:[q]=Hello%20World&data[limit]=10
    • sendMessage:[peer]=@xtrime&data[message]=Hello!
    • copy message from one channel to other (not repost):[from_peer]=@xtrime&data[to_peer]=@xtrime&data[id][0]=1


  • Telegram: @xtrime
  • Email: alexander(at)
You can’t perform that action at this time.