Skip to main content

messages.readHistory

Marks message history as read.

func (c *Client) MessagesReadHistory(ctx context.Context, request *MessagesReadHistoryRequest) (*MessagesAffectedMessages, error)

Calling this method

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

res, err := api.MessagesReadHistory(ctx, &tg.MessagesReadHistoryRequest{
// see Parameters
})
if err != nil {
return err
}
_ = res // *MessagesAffectedMessages
return nil
})

Parameters

NameTypeRequiredDescription
PeerInputPeerClassyesTarget user or group
MaxIDintyesIf a positive value is passed, only messages with identifiers less or equal than the given one will be read

Returns

*MessagesAffectedMessages

Possible errors

CodeTypeDescription
400BUSINESS_CONNECTION_INVALIDThe connection_id passed to the wrapping invokeWithBusinessConnection call is invalid.
400CHANNEL_PRIVATEYou haven't joined this channel/supergroup.
400CHAT_ID_INVALIDThe provided chat id is invalid.
400MSG_ID_INVALIDInvalid message ID provided.
400PEER_ID_INVALIDThe provided peer id is invalid.

References