Skip to content

Commit 4bee6ff

Browse files
committed
Added the field questiAdded the field question_entities to the class Poll.on_entities to the class Poll.
1 parent 1a562e5 commit 4bee6ff

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

telebot/types.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6868,18 +6868,24 @@ class PollOption(JsonDeserializable):
68686868
:param voter_count: Number of users that voted for this option
68696869
:type voter_count: :obj:`int`
68706870
6871+
:param text_entities: Optional. Special entities that appear in the option text. Currently, only custom emoji entities are allowed in poll option texts
6872+
:type text_entities: :obj:`list` of :class:`telebot.types.MessageEntity`
6873+
68716874
:return: Instance of the class
68726875
:rtype: :class:`telebot.types.PollOption`
68736876
"""
68746877
@classmethod
68756878
def de_json(cls, json_string):
68766879
if json_string is None: return None
68776880
obj = cls.check_json(json_string, dict_copy=False)
6881+
if 'text_entities' in obj:
6882+
obj['text_entities'] = Message.parse_entities(obj['text_entities'])
68786883
return cls(**obj)
68796884

6880-
def __init__(self, text, voter_count = 0, **kwargs):
6885+
def __init__(self, text, voter_count = 0, text_entities=None, **kwargs):
68816886
self.text: str = text
68826887
self.voter_count: int = voter_count
6888+
self.text_entities: List[MessageEntity] = text_entities
68836889
# Converted in _convert_poll_options
68846890
# def to_json(self):
68856891
# # send_poll Option is a simple string: https://core.telegram.org/bots/api#sendpoll

0 commit comments

Comments
 (0)