Raw updates
get_updates() returns Telegram’s raw update dictionaries and advances the internal offset for you:
Parsed updates
poll_updates() is a generator that parses each update into a Message object:
long_poll_timeout seconds, so polling_interval is only used when long_poll_timeout = 0.
max_retries limits consecutive network or server failures. Permanent errors such as an invalid token or a webhook conflict are raised immediately.
Parsed message data
Common fields are available directly on theMessage object:
Media properties such as
message.photo, message.document, message.audio, message.video, message.voice, message.animation, message.sticker, message.video_note, message.contact, and message.location are parsed objects with the fields Telegram provides.
Non-message updates
Updates such as callback queries are also returned asMessage objects. Their update_type is set, and the untouched update is available in .raw:
Backwards-compatible aliases
Older names are still available:message.idismessage.message_idsticker.typeissticker.sticker_typevideo.unique_idisvideo.file_unique_idvideo.video_sizeisvideo.file_size
A webhook and
poll_updates() cannot be used at the same time. Call delete_webhook() before switching back to polling.