Skip to content

setChatPhoto

Sahri Riza Umami edited this page Jun 23, 2018 · 1 revision

Changes the photo of a chat.
Supported only for basic groups, supergroups and channels.
Requires administrator rights in basic groups and the appropriate administrator rights in supergroups and channels.
The photo will not be changed before request to the server has been completed.

setChatPhoto(chat_id, photo, callback, data)
Field Type Description
chat_id int32 Chat identifier.
photo inputFile New chat photo. You can use a zero InputFileId to delete the chat photo. Files that are accessible only by HTTP URL are not acceptable.

Example

  • Change chat 1234567890 photo by the message id 212 of sent photo message.

    changeChatPhoto(1234567890, 212)

    Response:

    {
      ["@type"] = "ok"
    }
  • Change chat 1234567890 photo by the remote id 'AgADBQADWagxG2dukwvtaMb44zOBXrYfyjIABHH4Zoiei4pn0RgBAAEC' of sent photo message.

    changeChatPhoto(1234567890, 'AgADBQADWagxG2dukwvtaMb44zOBXrYfyjIABHH4Zoiei4pn0RgBAAEC')

    Response:

    {
      ["@type"] = "ok"
    }
  • Change chat 1234567890 photo by photo from local storage.

    changeChatPhoto(1234567890, '/tmp/foto.jpg')

    Response:

    {
      ["@type"] = "ok"
    }

Frequently Asked Questions
The Functions

Clone this wiki locally