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

Method de_json

src/telegram/_poll.py:159–173  ·  view source on GitHub ↗

See :meth:`telegram.TelegramObject.de_json`.

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

Source from the content-addressed store, hash-verified

157
158 @classmethod
159 def de_json(cls, data: JSONDict, bot: "Bot | None" = None) -> "PollMedia":
160 """See :meth:`telegram.TelegramObject.de_json`."""
161 data = cls._parse_data(data)
162
163 data["animation"] = de_json_optional(data.get("animation"), Animation, bot)
164 data["audio"] = de_json_optional(data.get("audio"), Audio, bot)
165 data["document"] = de_json_optional(data.get("document"), Document, bot)
166 data["live_photo"] = de_json_optional(data.get("live_photo"), LivePhoto, bot)
167 data["location"] = de_json_optional(data.get("location"), Location, bot)
168 data["photo"] = de_list_optional(data.get("photo"), PhotoSize, bot)
169 data["sticker"] = de_json_optional(data.get("sticker"), Sticker, bot)
170 data["venue"] = de_json_optional(data.get("venue"), Venue, bot)
171 data["video"] = de_json_optional(data.get("video"), Video, bot)
172
173 return super().de_json(data=data, bot=bot)
174
175
176class InputPollOption(TelegramObject):

Callers

nothing calls this directly

Calls 4

de_json_optionalFunction · 0.90
de_list_optionalFunction · 0.90
_parse_dataMethod · 0.80
de_jsonMethod · 0.45

Tested by

no test coverage detected