BlackBrain BlackBrain - 11 days ago 6
reST (reStructuredText) Question

Telegram Get Channel Profile Photo using Bot API

I need to get the profile picture of a channel in Telegram. According to this doc:
https://core.telegram.org/bots/api

I first try to use getChat to get the basic information about a channel . Which I get successfully. It gives me a json like this:

{"ok":true,"result":{"id":-1001003587533,"title":"\u06a9\u0627\u0641","username":"kafiha","type":"channel"}}


After this I try to use 'getUserProfilePhotos' to get the profile photo. But I can't get it to work because it responds with error when I either pass the id I got from the last request or the channeld username (@channelName).

Do you know how can I accomplish this using Bot API for Telegram?

Answer

It's not available now in Bot API. getUserProfilePhotos method require user_id parameter, not chat_id as you tryed.

Comments