MCPcopy
hub / github.com/python-telegram-bot/python-telegram-bot / to_dict

Method to_dict

src/telegram/_bot.py:12163–12170  ·  view source on GitHub ↗

See :meth:`telegram.TelegramObject.to_dict`.

(self, recursive: bool = True)

Source from the content-addressed store, hash-verified

12161 )
12162
12163 def to_dict(self, recursive: bool = True) -> JSONDict: # noqa: ARG002
12164 """See :meth:`telegram.TelegramObject.to_dict`."""
12165 data: JSONDict = {"id": self.id, "username": self.username, "first_name": self.first_name}
12166
12167 if self.last_name:
12168 data["last_name"] = self.last_name
12169
12170 return data
12171
12172 # camelCase aliases
12173 getMe = get_me

Callers 15

differenceMethod · 0.45
decrypted_dataMethod · 0.45
test_to_dictMethod · 0.45
test_to_dictMethod · 0.45
test_to_dictMethod · 0.45
test_to_dictMethod · 0.45
test_de_json_subclassMethod · 0.45
test_to_dictMethod · 0.45
test_de_jsonMethod · 0.45
test_to_dictMethod · 0.45
test_de_jsonMethod · 0.45

Calls

no outgoing calls

Tested by 15

test_to_dictMethod · 0.36
test_to_dictMethod · 0.36
test_to_dictMethod · 0.36
test_to_dictMethod · 0.36
test_de_json_subclassMethod · 0.36
test_to_dictMethod · 0.36
test_de_jsonMethod · 0.36
test_to_dictMethod · 0.36
test_de_jsonMethod · 0.36
test_to_dictMethod · 0.36
test_to_dictMethod · 0.36
test_de_jsonMethod · 0.36