Skip to main content

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

NameTypeRequiredDescription
PeerInputPeerClassyesThe Telegram chat where the messages should be imported, click here for more info »
ImportIDint64yesIdentifier of a history import session, returned by messages.initHistoryImport.

Returns

bool

Possible errors

CodeTypeDescription
400CHAT_ADMIN_REQUIREDYou must be an admin in this chat to do this.
400IMPORT_ID_INVALIDThe specified import ID is invalid.
400PEER_ID_INVALIDThe provided peer id is invalid.

References