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
| Name | Type | Required | Description |
|---|---|---|---|
Peer | InputPeerClass | yes | The Telegram chat where the media will be imported |
ImportID | int64 | yes | Identifier of a history import session, returned by messages.initHistoryImport |
FileName | string | yes | File name |
Media | InputMediaClass | yes | Media metadata |
Returns
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. |
References
- Official documentation
- Generated Go reference
- TL definition:
messages.uploadImportedMedia#2a862092