-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Did some experimenting with the photos:
Telegram::Bot::Client.run(token) do |bot|
bot.api.get_user_profile_photos(user_id: fake-user-id)
endreturns the following
{"ok"=>true,
"result"=>
{"total_count"=>1,
"photos"=>
[[{"file_id"=>fake-file-id, "file_size"=>8786, "width"=>160, "height"=>160},
{"file_id"=>fake-file-id-2, "file_size"=>23897, "width"=>320, "height"=>320},
{"file_id"=>fake-file-id-3, "file_size"=>62566, "width"=>640, "height"=>640}]]}}Did some experimenting with getting profile pics:
Now we can request a link for one of those files:
Telegram::Bot::Client.run(token) do |bot|
bot.api.get_file(file_id: fake-file-id)
endThis returns:
{"ok"=>true, "result"=>{"file_id"=> fake-file-id, "file_size"=>8786, "file_path"=>"photo/file_0.jpg"}}The photo can now be downloaded from: https://api.telegram.org/file/bot<token>/photo/file_0.jpg
(Link expires after a while though).
Metadata
Metadata
Assignees
Labels
No labels