Skip to main content

channels.editPhoto

Change the photo of a channel/supergroup

func (c *Client) ChannelsEditPhoto(ctx context.Context, request *ChannelsEditPhotoRequest) (UpdatesClass, error)

Calling this method

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

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

Parameters

NameTypeRequiredDescription
ChannelInputChannelClassyesChannel/supergroup whose photo should be edited
PhotoInputChatPhotoClassyesNew photo

Returns

UpdatesClass

Possible errors

CodeTypeDescription
400CHANNEL_INVALIDThe provided channel is invalid.
400CHANNEL_PRIVATEYou haven't joined this channel/supergroup.
403CHAT_ADMIN_REQUIREDYou must be an admin in this chat to do this.
400CHAT_NOT_MODIFIEDNo changes were made to chat information because the new information you passed is identical to the current information.
403CHAT_WRITE_FORBIDDENYou can't write in this chat.
400FILE_PARTS_INVALIDThe number of file parts is invalid.
400FILE_REFERENCE_INVALIDThe specified file reference is invalid.
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_FILE_MISSINGProfile photo file missing.
400PHOTO_INVALIDPhoto invalid.
400STICKER_MIME_INVALIDThe specified sticker MIME type is invalid.

References