Skip to main content

messages.editChatPhoto

Changes chat photo and sends a service message on it

func (c *Client) MessagesEditChatPhoto(ctx context.Context, request *MessagesEditChatPhotoRequest) (UpdatesClass, error)

Calling this method

client.Run(ctx, func(ctx context.Context) error {
api := client.API()

res, err := api.MessagesEditChatPhoto(ctx, &tg.MessagesEditChatPhotoRequest{
// see Parameters
})
if err != nil {
return err
}
_ = res // UpdatesClass
return nil
})

Parameters

NameTypeRequiredDescription
ChatIDint64yesChat ID
PhotoInputChatPhotoClassyesPhoto to be set

Returns

UpdatesClass

Possible errors

CodeTypeDescription
400CHAT_ID_INVALIDThe provided chat id is invalid.
400CHAT_NOT_MODIFIEDNo changes were made to chat information because the new information you passed is identical to the current information.
400IMAGE_PROCESS_FAILEDFailure while processing image.
400PEER_ID_INVALIDThe provided peer id is invalid.
400PHOTO_CROP_SIZE_SMALLPhoto is too small.
400PHOTO_EXT_INVALIDThe extension of the photo is invalid.
400PHOTO_INVALIDPhoto invalid.

References