Releases: xtrime-ru/TelegramApiServer
Initial Docker support
Run TelegramApiServer with simple command inside docker: docker-compose up -d
MadelineProto v5.1 update
MadelineProto dependency updated.
v1.6.5
Settings for addSession method
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.
Fixed issue when server stops if last MadelineProto session is removed.
Event handlers for added sessions
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
Sessions management
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
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
All sessions now stored in sessions folder. Existing session will be moved there on first restart.
Sessions can be stored in subfolders.