Skip to content

Releases: xtrime-ru/TelegramApiServer

Initial Docker support

08 Mar 23:44
Compare
Choose a tag to compare

Run TelegramApiServer with simple command inside docker: docker-compose up -d

MadelineProto v5.1 update

03 Mar 21:58
Compare
Choose a tag to compare

MadelineProto dependency updated.

v1.6.5

06 Feb 00:11
Compare
Choose a tag to compare
Check if session exists

Settings for addSession method

06 Feb 00:03
Compare
Choose a tag to compare

Now session can be added with custom settings: http://127.0.0.1:9503/system/addSession?session=users/xtrime&settings[app_info][app_id]=xxx&&settings[app_info][app_hash]=xxx

Settings is optional, and will be merged with settings from config file. Provide only those keys, which needs to be overridden.

Server stop issue fixed.

26 Jan 22:59
Compare
Choose a tag to compare

Fixed issue when server stops if last MadelineProto session is removed.

Event handlers for added sessions

26 Jan 20:36
Compare
Choose a tag to compare

After new session was added and authorization/registration complete eventHandler need to be set.

This will allow to receive updates for new session (users/xtrime in example) in /events websocket: http://127.0.0.1:9503/api/users/xtrime/setEventHandler

v1.6.1

22 Jan 11:42
Compare
Choose a tag to compare
AddSession bugfix

Sessions management

20 Jan 20:37
Compare
Choose a tag to compare

New in this version:

  • /system http endpoint added, to add and remove sessions (experimental);
  • Ability to start without sessions;
  • Custom api method to download any supported media: downloadToResponse.
    Example POST request (GET also supported):
    curl --location --request POST '127.0.0.1:9503/api/downloadToResponse' \
    --header 'Content-Type: application/json' \
    --data-raw '{
        "media": {
            "_": "messageMediaDocument",
            "document": {
                "_": "document",
                "id": 5470079466401169993,
                "access_hash": -6754208767885394084,
                "file_reference": {
                    "_": "bytes",
                    "bytes": "AkKdqJkAACnyXiaBgp3M3DfBh8C0+mGKXwSsGUY="
                },
                "date": 1551713685,
                "mime_type": "video/mp4",
                "size": 400967,
                "dc_id": 2
            }
        }
    }'
    

JSON-RPC 2.0 websocket response format

15 Jan 22:54
Compare
Choose a tag to compare

Format of updates in events websocket endpoint was changed to JSON-RPC 2.0 standard.

Now updates looks like:

{
    "jsonrpc":"2.0",
    "result":{
        "session":"session",
        "update":{
            "_":"updateUserStatus",
            "user_id":64459193,
            "status":{
                "_":"userStatusOnline",
                "expires":1579128837
            }
        }
    },
    "id":null
}

Sessions in subfolders

14 Jan 22:47
Compare
Choose a tag to compare

All sessions now stored in sessions folder. Existing session will be moved there on first restart.
Sessions can be stored in subfolders.