Skip to main content

messages.uploadImportedMedia

Upload a media file associated with an imported chat, click here for more info ».

func (c *Client) MessagesUploadImportedMedia(ctx context.Context, request *MessagesUploadImportedMediaRequest) (MessageMediaClass, error)

Calling this method

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

res, err := api.MessagesUploadImportedMedia(ctx, &tg.MessagesUploadImportedMediaRequest{
// see Parameters
})
if err != nil {
return err
}
_ = res // MessageMediaClass
return nil
})

Parameters

NameTypeRequiredDescription
PeerInputPeerClassyesThe Telegram chat where the media will be imported
ImportIDint64yesIdentifier of a history import session, returned by messages.initHistoryImport
FileNamestringyesFile name
MediaInputMediaClassyesMedia metadata

Returns

MessageMediaClass

Possible errors

CodeTypeDescription
400CHAT_ADMIN_REQUIREDYou must be an admin in this chat to do this.
400IMPORT_ID_INVALIDThe specified import ID is invalid.
400MEDIA_INVALIDMedia invalid.

References