peyk.platforms.telegram.types.poll_option

Classes

PollOption([persistent_id, text, ...])

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

class peyk.platforms.telegram.types.poll_option.PollOption(persistent_id: str | None = None, text: str = '', text_entities: List[MessageEntity] | None = None, media: PollMedia | None = None, voter_count: int = 0, added_by_user: User | None = None, added_by_chat: Chat | None = None, addition_date: int | None = None)[source]

Bases: object

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

Variables:
  • persistent_id (str | None) – Unique identifier of the option, persistent on option addition and deletion

  • text (str) – Option text, 1-100 characters

  • voter_count (int) – Number of users who voted for this option; may be 0 if unknown

  • text_entities (List[peyk.platforms.telegram.types.message_entity.MessageEntity] | None) – Special entities that appear in the option text. Currently, only custom emoji entities are allowed in poll option texts

  • media (peyk.platforms.telegram.types.poll_media.PollMedia | None) – Media added to the poll option

  • added_by_user (peyk.platforms.telegram.types.user.User | None) – User who added the option; omitted if the option wasn’t added by a user after poll creation

  • added_by_chat (peyk.platforms.telegram.types.chat.Chat | None) – Chat that added the option; omitted if the option wasn’t added by a chat after poll creation

  • addition_date (int | None) – Point in time (Unix timestamp) when the option was added; omitted if the option existed in the original poll

persistent_id: str | None = None
text: str = ''
text_entities: List[MessageEntity] | None = None
media: PollMedia | None = None
voter_count: int = 0
added_by_user: User | None = None
added_by_chat: Chat | None = None
addition_date: int | None = None
classmethod from_dict(data: dict | None) PollOption | None[source]

Parse a Telegram API mapping into this type.

Parameters:

data – Raw Telegram API mapping, or None.

Returns:

Parsed type instance, or None when data is None.