messages.startHistoryImport
Complete the history import process, importing all messages into the chat. To be called only after initializing the import with messages.initHistoryImport and uploading all files using messages.uploadImportedMedia.
func (c *Client) MessagesStartHistoryImport(ctx context.Context, request *MessagesStartHistoryImportRequest) (bool, error)
Calling this method
client.Run(ctx, func(ctx context.Context) error {
api := client.API()
res, err := api.MessagesStartHistoryImport(ctx, &tg.MessagesStartHistoryImportRequest{
// see Parameters
})
if err != nil {
return err
}
_ = res // bool
return nil
})
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
Peer | InputPeerClass | yes | The Telegram chat where the messages should be imported, click here for more info » |
ImportID | int64 | yes | Identifier of a history import session, returned by messages.initHistoryImport. |
Returns
bool
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 | PEER_ID_INVALID | The provided peer id is invalid. |
References
- Official documentation
- Generated Go reference
- TL definition:
messages.startHistoryImport#b43df344