Skip to content

GramIO API Reference / @gramio/contexts/dist / PollOption

Class: PollOption ​

Defined in: contexts/index.d.ts:982

This object contains information about one answer option in a poll.

Documentation

Constructors ​

Constructor ​

new PollOption(payload): PollOption

Defined in: contexts/index.d.ts:984

Parameters ​

ParameterType
payloadTelegramPollOption

Returns ​

PollOption

Properties ​

PropertyTypeDefined in
payloadTelegramPollOptioncontexts/index.d.ts:983

Accessors ​

[toStringTag] ​

Get Signature ​

get [toStringTag](): string

Defined in: contexts/index.d.ts:986

MDN

Returns ​

string


addedByChat ​

Get Signature ​

get addedByChat(): Chat

Defined in: contexts/index.d.ts:1010

Optional. Chat that added the option; omitted if the option wasn't added by a chat after poll creation

Returns ​

Chat


addedByUser ​

Get Signature ​

get addedByUser(): User

Defined in: contexts/index.d.ts:1006

Optional. User who added the option; omitted if the option wasn't added by a user after poll creation

Returns ​

User


additionDate ​

Get Signature ​

get additionDate(): number

Defined in: contexts/index.d.ts:1014

Optional. Point in time (Unix timestamp) when the option was added; omitted if the option existed in the original poll

Returns ​

number


media ​

Get Signature ​

get media(): PollMedia

Defined in: contexts/index.d.ts:998

Optional. Media added to the poll option

Returns ​

PollMedia


persistentId ​

Get Signature ​

get persistentId(): string

Defined in: contexts/index.d.ts:988

Unique identifier of the option, persistent on option addition and deletion

Returns ​

string


text ​

Get Signature ​

get text(): string

Defined in: contexts/index.d.ts:992

Option text, 1-100 characters

Returns ​

string


textEntities ​

Get Signature ​

get textEntities(): MessageEntity[]

Defined in: contexts/index.d.ts:996

Optional. Special entities that appear in the option text. Currently, only custom emoji entities are allowed in poll option texts

Returns ​

MessageEntity[]


voterCount ​

Get Signature ​

get voterCount(): number

Defined in: contexts/index.d.ts:1002

Number of users who voted for this option; may be 0 if unknown

Returns ​

number