MCPcopy Index your code
hub / github.com/python-telegram-bot/python-telegram-bot / de_json

Method de_json

src/telegram/_poll.py:239–259  ·  view source on GitHub ↗

See :meth:`telegram.TelegramObject.de_json`. The :paramref:`media` field will not be included for deserialization. .. deprecated:: 22.8 This class is input only and will be removed in the next version.

(cls, data: JSONDict, bot: "Bot | None" = None)

Source from the content-addressed store, hash-verified

237 # tags: deprecated 22.8
238 @classmethod
239 def de_json(cls, data: JSONDict, bot: "Bot | None" = None) -> "InputPollOption":
240 """See :meth:`telegram.TelegramObject.de_json`. The :paramref:`media` field will
241 not be included for deserialization.
242
243 .. deprecated:: 22.8
244 This class is input only and will be removed in the next version.
245 """
246 warn(
247 PTBDeprecationWarning(
248 "22.8",
249 "`InputPollOption.de_json` is deprecated. This class is input only and will be "
250 "removed in the next version. The `media` field will not be included for "
251 "deserialization.",
252 ),
253 stacklevel=2,
254 )
255 data = cls._parse_data(data)
256
257 data["text_entities"] = de_list_optional(data.get("text_entities"), MessageEntity, bot)
258
259 return super().de_json(data=data, bot=bot)
260
261
262class PollOption(TelegramObject):

Callers

nothing calls this directly

Calls 5

warnFunction · 0.90
de_list_optionalFunction · 0.90
_parse_dataMethod · 0.80
de_jsonMethod · 0.45

Tested by

no test coverage detected