Skip to main content

messages.getPollVotes

Get poll results for non-anonymous polls

func (c *Client) MessagesGetPollVotes(ctx context.Context, request *MessagesGetPollVotesRequest) (*MessagesVotesList, error)

Calling this method

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

res, err := api.MessagesGetPollVotes(ctx, &tg.MessagesGetPollVotesRequest{
// see Parameters
})
if err != nil {
return err
}
_ = res // *MessagesVotesList
return nil
})

Parameters

NameTypeRequiredDescription
PeerInputPeerClassyesChat where the poll was sent
IDintyesMessage ID
Option[]byteGet only results for the specified poll option
OffsetstringOffset for results, taken from the next_offset field of messages.votesList, initially an empty string. Note: if no more results are available, the method call will return an empty next_offset; thus, avoid providing the next_offset returned in messages.votesList if it is empty, to avoid an infinite loop.
LimitintyesNumber of results to return

Returns

*MessagesVotesList

Possible errors

CodeTypeDescription
403BROADCAST_FORBIDDENChannel poll voters and reactions cannot be fetched to prevent deanonymization.
400MSG_ID_INVALIDInvalid message ID provided.
403POLL_VOTE_REQUIREDCast a vote in the poll before calling this method.

References