Poll Option Media#
Bot API 10.1 allows poll options to have attached media — a photo, animation,
or a link. FTMGram exposes this via MessageContent and the Link type.
Link Media in Poll Options#
from ftmgram.enums import MessageMediaType
@app.on_message(filters.poll)
async def on_poll(client, message):
poll = message.poll
for option in poll.options:
if option.media and option.media.type == MessageMediaType.LINK:
link = option.media.link
print(f"Option '{option.text}' has link: {link.url}")
The Link Type#
Field |
Description |
|---|---|
|
HTTP URL of the link (always present) |
|
Optional title of the link |
|
Optional thumbnail URL |
MessageMediaType Values#
Enum value |
Media type |
|---|---|
|
Photo |
|
Video |
|
GIF/animation |
|
Sticker |
|
Audio file |
|
Voice message |
|
Document/file |
|
Rich web page preview |
|
Poll |
|
Checklist (new in Bot API 10.1) |
|
Link media (new in Bot API 10.1) |
|
Paid media |
|
Giveaway |
|
Dice |