Skip to content
Back to top
View this page

# InputPollOption

class telegram.InputPollOption(text, text_parse_mode=None, text_entities=None, *, api_kwargs=None)

  Bases: `telegram.TelegramObject`

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

  Objects of this class are comparable in terms of equality. Two objects of this class are considered equal, if their `text` is equal.

  Use In

  `telegram.Bot.send_poll()`

  Added in version 21.2.

  Parameters:

    - text (`str`) – Option text, `1`-`100` characters.

    - text_parse_mode (`str`, optional) – Mode for parsing entities. See `telegram.constants.ParseMode` and formatting options for more details. Currently, only custom emoji entities are allowed.

    - text_entities (Sequence[`telegram.MessageEntity`], optional) – Special entities that appear in the option `text`. It can be specified instead of `text_parse_mode`. Currently, only custom emoji entities are allowed. This list is empty if the text does not contain entities.

  text

    Option text, `1`-`100` characters.

    Type:

      `str`

  text_parse_mode

    Optional. Mode for parsing entities. See `telegram.constants.ParseMode` and formatting options for more details. Currently, only custom emoji entities are allowed.

    Type:

      `str`

  text_entities

    Special entities that appear in the option `text`. It can be specified instead of `text_parse_mode`. Currently, only custom emoji entities are allowed. This list is empty if the text does not contain entities.

    Type:

      Sequence[`telegram.MessageEntity`]

  classmethod de_json(data, bot=None)

    See `telegram.TelegramObject.de_json()`.