Skip to main content

messages.getMessagesViews

Get and increase the view counter of a message sent or forwarded from a channel

func (c *Client) MessagesGetMessagesViews(ctx context.Context, request *MessagesGetMessagesViewsRequest) (*MessagesMessageViews, error)

Calling this method

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

res, err := api.MessagesGetMessagesViews(ctx, &tg.MessagesGetMessagesViewsRequest{
// see Parameters
})
if err != nil {
return err
}
_ = res // *MessagesMessageViews
return nil
})

Parameters

NameTypeRequiredDescription
PeerInputPeerClassyesPeer where the message was found
ID[]intyesID of message
IncrementboolyesWhether to mark the message as viewed and increment the view counter

Returns

*MessagesMessageViews

Possible errors

CodeTypeDescription
400CHANNEL_INVALIDThe provided channel is invalid.
406CHANNEL_PRIVATEYou haven't joined this channel/supergroup.
400CHAT_ID_INVALIDThe provided chat id is invalid.
400CHAT_NOT_MODIFIEDNo changes were made to chat information because the new information you passed is identical to the current information.
400MSG_ID_INVALIDInvalid message ID provided.
400PEER_ID_INVALIDThe provided peer id is invalid.

References