Layer 220
MessagesUploadImportedMedia
Upload a media file associated with an imported chat, click here for more info.
method
Users
messages.uploadImportedMedia#2a862092 peer:InputPeer import_id:long file_name:string media:InputMedia = MessageMedia;
Parameters
| Name | Type | Description |
|---|---|---|
| Peer | InputPeer | The Telegram chat where the media will be imported |
| ImportId | long | Identifier of a history import session, returned by messages. init History Import |
| FileName | string | File name |
| Media | InputMedia | Media metadata |
Returns
MessageMediaPossible Errors
| Code | Type | Description |
|---|---|---|
| 400 | CHAT_ADMIN_REQUIRED | You must be an admin in this chat to do this. |
| 400 | IMPORT_ID_INVALID | The specified import ID is invalid. |
| 400 | MEDIA_INVALID | Media invalid. |
Gogram Example
// MessagesUploadImportedMedia - positional arguments result, err := client.MessagesUploadImportedMedia(&tg.InputPeerUser{UserID: int64(123456789)}, int64(0), "...", &tg.InputMediaPhoto{ID: &tg.InputPhoto{ID: int64(0), AccessHash: int64(0), FileReference: []byte{}}}) if err != nil { // handle error } // result is *tg.MessageMedia