Skip to main content

messages.checkHistoryImportPeer

Check whether chat history exported from another chat app can be imported into a specific Telegram chat, click here for more info ». If the check succeeds, and no RPC errors are returned, a messages CheckedHistoryImportPeer constructor will be returned, with a confirmation text to be shown to the user, before actually initializing the import.

func (c *Client) MessagesCheckHistoryImportPeer(ctx context.Context, peer InputPeerClass) (*MessagesCheckedHistoryImportPeer, error)

Calling this method

client.Run(ctx, func(ctx context.Context) error {
api := client.API()

res, err := api.MessagesCheckHistoryImportPeer(ctx, peer)
if err != nil {
return err
}
_ = res // *MessagesCheckedHistoryImportPeer
return nil
})

Parameters

NameTypeRequiredDescription
PeerInputPeerClassyesThe chat where we want to import history ».

Returns

*MessagesCheckedHistoryImportPeer

Possible errors

CodeTypeDescription
400CHAT_ADMIN_REQUIREDYou must be an admin in this chat to do this.
400PEER_ID_INVALIDThe provided peer id is invalid.
400USER_NOT_MUTUAL_CONTACTThe provided user is not a mutual contact.

References