Skip to content

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

Class: PollAttachment ​

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

This object contains information about a poll.

Extends ​

Constructors ​

Constructor ​

new PollAttachment(payload): PollAttachment

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

Parameters ​

ParameterType
payloadTelegramPoll

Returns ​

PollAttachment

Inherited from ​

Poll.constructor

Properties ​

PropertyTypeInherited fromDefined in
attachmentTypeAttachmentTypeAttachment.attachmentTypecontexts/index.d.ts:1088
payloadTelegramPollPoll.payloadcontexts/index.d.ts:1019

Accessors ​

[toStringTag] ​

Get Signature ​

get [toStringTag](): string

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

MDN

Returns ​

string

Inherited from ​

Poll.[toStringTag]


allowsMultipleAnswers ​

Get Signature ​

get allowsMultipleAnswers(): boolean

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

true, if the poll allows multiple answers

Returns ​

boolean

Inherited from ​

Poll.allowsMultipleAnswers


allowsRevoting ​

Get Signature ​

get allowsRevoting(): boolean

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

true, if the poll allows to change the chosen answer options

Returns ​

boolean

Inherited from ​

Poll.allowsRevoting


closeDate ​

Get Signature ​

get closeDate(): number

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

Point in time (Unix timestamp) when the poll will be automatically closed

Returns ​

number

Inherited from ​

Poll.closeDate


correctOptionIds ​

Get Signature ​

get correctOptionIds(): number[]

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

Array of 0-based identifiers of the correct answer options. Available only for polls in quiz mode which are closed or were sent (not forwarded) by the bot or to the private chat with the bot.

Returns ​

number[]

Inherited from ​

Poll.correctOptionIds


countryCodes ​

Get Signature ​

get countryCodes(): string[]

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

Optional. A list of two-letter ISO 3166-1 alpha-2 country codes indicating the countries from which users can vote in the poll. If omitted, then users from any country can participate in the poll.

Returns ​

string[]

Inherited from ​

Poll.countryCodes


description ​

Get Signature ​

get description(): string

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

Optional. Description of the poll; for polls inside the Message object only

Returns ​

string

Inherited from ​

Poll.description


descriptionEntities ​

Get Signature ​

get descriptionEntities(): MessageEntity[]

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

Optional. Special entities like usernames, URLs, bot commands, etc. that appear in the description

Returns ​

MessageEntity[]

Inherited from ​

Poll.descriptionEntities


explanation ​

Get Signature ​

get explanation(): string

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

Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a quiz-style poll, 0-200 characters

Returns ​

string

Inherited from ​

Poll.explanation


explanationEntities ​

Get Signature ​

get explanationEntities(): MessageEntity[]

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

Special entities like usernames, URLs, bot commands, etc. that appear in the explanation

Returns ​

MessageEntity[]

Inherited from ​

Poll.explanationEntities


explanationMedia ​

Get Signature ​

get explanationMedia(): PollMedia

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

Optional. Media added to the quiz explanation

Returns ​

PollMedia

Inherited from ​

Poll.explanationMedia


id ​

Get Signature ​

get id(): string

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

Unique poll identifier

Returns ​

string

Inherited from ​

Poll.id


media ​

Get Signature ​

get media(): PollMedia

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

Optional. Media added to the poll description; for polls inside the Message object only

Returns ​

PollMedia

Inherited from ​

Poll.media


membersOnly ​

Get Signature ​

get membersOnly(): boolean

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

true if voting is limited to users who have been members of the chat where the poll was originally sent for more than 24 hours

Returns ​

boolean

Inherited from ​

Poll.membersOnly


openPeriod ​

Get Signature ​

get openPeriod(): number

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

Amount of time in seconds the poll will be active after creation

Returns ​

number

Inherited from ​

Poll.openPeriod


options ​

Get Signature ​

get options(): PollOption[]

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

List of poll options

Returns ​

PollOption[]

Inherited from ​

Poll.options


question ​

Get Signature ​

get question(): string

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

Poll question, 1-300 characters

Returns ​

string

Inherited from ​

Poll.question


questionEntities ​

Get Signature ​

get questionEntities(): MessageEntity[]

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

Optional. Special entities that appear in the question. Currently, only custom emoji entities are allowed in poll questions

Returns ​

MessageEntity[]

Inherited from ​

Poll.questionEntities


totalVoterCount ​

Get Signature ​

get totalVoterCount(): number

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

Total number of users that voted in the poll

Returns ​

number

Inherited from ​

Poll.totalVoterCount


type ​

Get Signature ​

get type(): TelegramPollType

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

Poll type, currently can be regular or quiz

Returns ​

TelegramPollType

Inherited from ​

Poll.type

Methods ​

isAnonymous() ​

isAnonymous(): boolean

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

true, if the poll is anonymous

Returns ​

boolean

Inherited from ​

Poll.isAnonymous


isClosed() ​

isClosed(): boolean

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

true, if the poll is closed

Returns ​

boolean

Inherited from ​

Poll.isClosed