Skip to content

changeChatPhoto

Sahri Riza Umami edited this page Jun 10, 2017 · 5 revisions

Changes chat photo.

changeChatPhoto(chat_id, file)

Photo can't be changed for private chats.
Photo will not change until change will be synchronized with the server.
Photo will not be changed if application is killed before it can send request to the server.
There will be update about change of the photo on success. Otherwise error will be returned.

Option Description
chat_id Chat identifier.
photo New chat photo. You can use zero InputFileId to delete photo. Files accessible only by HTTP URL are not acceptable.

Example

  • Change chat 1234567890 photo by the message_id of sent photo message.

    changeChatPhoto(1234567890, 212)

    Response:

    {
      ID = "Ok"
    }
  • Change chat 1234567890 photo by the persistent_id of sent photo message.

    changeChatPhoto(1234567890, 'AgADBQADWagxG2dukwvtaMb44zOBXrYfyjIABHH4Zoiei4pn0RgBAAEC')

    Response:

    {
      ID = "Ok"
    }
  • Change chat 1234567890 photo from local storage.

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

    Response:

    {
      ID = "Ok"
    }

Test script
Frequently Asked Questions
The Functions

Clone this wiki locally