Skip to content

Commit 1a562e5

Browse files
committed
Added the field question_entities to the class Poll.
1 parent 71346d8 commit 1a562e5

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

telebot/types.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6916,16 +6916,13 @@ class Poll(JsonDeserializable):
69166916
:param allows_multiple_answers: True, if the poll allows multiple answers
69176917
:type allows_multiple_answers: :obj:`bool`
69186918
6919-
:param correct_option_id: Optional. 0-based identifier of the correct answer option. Available only for polls in
6920-
the quiz mode, which are closed, or was sent (not forwarded) by the bot or to the private chat with the bot.
6919+
:param correct_option_id: Optional. 0-based identifier of the correct answer option. Available only for polls in the quiz mode, which are closed, or was sent (not forwarded) by the bot or to the private chat with the bot.
69216920
:type correct_option_id: :obj:`int`
69226921
6923-
:param explanation: Optional. Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a
6924-
quiz-style poll, 0-200 characters
6922+
:param explanation: Optional. 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
69256923
:type explanation: :obj:`str`
69266924
6927-
:param explanation_entities: Optional. Special entities like usernames, URLs, bot commands, etc. that appear in
6928-
the explanation
6925+
:param explanation_entities: Optional. Special entities like usernames, URLs, bot commands, etc. that appear in the explanation
69296926
:type explanation_entities: :obj:`list` of :class:`telebot.types.MessageEntity`
69306927
69316928
:param open_period: Optional. Amount of time in seconds the poll will be active after creation
@@ -6934,6 +6931,9 @@ class Poll(JsonDeserializable):
69346931
:param close_date: Optional. Point in time (Unix timestamp) when the poll will be automatically closed
69356932
:type close_date: :obj:`int`
69366933
6934+
:param question_entities: Optional. Special entities that appear in the question. Currently, only custom emoji entities are allowed in poll questions
6935+
:type question_entities: :obj:`list` of :class:`telebot.types.MessageEntity`
6936+
69376937
:return: Instance of the class
69386938
:rtype: :class:`telebot.types.Poll`
69396939
"""
@@ -6948,6 +6948,8 @@ def de_json(cls, json_string):
69486948
obj['options'] = options or None
69496949
if 'explanation_entities' in obj:
69506950
obj['explanation_entities'] = Message.parse_entities(obj['explanation_entities'])
6951+
if 'question_entities' in obj:
6952+
obj['question_entities'] = Message.parse_entities(obj['question_entities'])
69516953
return cls(**obj)
69526954

69536955
# noinspection PyShadowingBuiltins
@@ -6956,7 +6958,8 @@ def __init__(
69566958
question, options,
69576959
poll_id=None, total_voter_count=None, is_closed=None, is_anonymous=None, type=None,
69586960
allows_multiple_answers=None, correct_option_id=None, explanation=None, explanation_entities=None,
6959-
open_period=None, close_date=None, poll_type=None, **kwargs):
6961+
open_period=None, close_date=None, poll_type=None, question_entities=None,
6962+
**kwargs):
69606963
self.id: str = poll_id
69616964
self.question: str = question
69626965
self.options: List[PollOption] = options
@@ -6972,6 +6975,7 @@ def __init__(
69726975
self.correct_option_id: int = correct_option_id
69736976
self.explanation: str = explanation
69746977
self.explanation_entities: List[MessageEntity] = explanation_entities
6978+
self.question_entities: List[MessageEntity] = question_entities
69756979
self.open_period: int = open_period
69766980
self.close_date: int = close_date
69776981

0 commit comments

Comments
 (0)