Layer 224
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
MessageMediaGogram Example
// MessagesUploadImportedMedia - positional arguments result, err := client.MessagesUploadImportedMedia(&tg.InputPeerUser{UserID: int64(777000)}, int64(1234567890), "Hello, World!", &tg.InputMediaPhoto{ID: &tg.InputPhoto{ID: int64(5678901234567890), AccessHash: int64(1234567890123456), FileReference: []byte{0x01}}}) if err != nil { // handle error } // result is *tg.MessageMedia
Possible 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. |