InputWidgetMessageContent

class aiogram.types.input_widget_message_content.InputWidgetMessageContent(*, html: str, width: int | None = None, height: int | None = None, public_data: str | None = None, chat_data: str | None = None, caption: str | None = None, parse_mode: str | ~aiogram.client.default.Default | None = <Default('parse_mode')>, caption_entities: list[~aiogram.types.message_entity.MessageEntity] | None = None, show_caption_above_media: bool | ~aiogram.client.default.Default | None = <Default('show_caption_above_media')>, allow_queries: bool | None = None, is_shared: bool | None = None, **extra_data: ~typing.Any)[source]

Represents the content of a message with an HTML widget to be sent as the result of an inline query. Currently, widgets can’t be sent in response to inline queries in the production environment.

Source: https://core.telegram.org/bots/api#inputwidgetmessagecontent

html: str

HTML code of the widget, 1-32768 bytes. The code must not exceed 4096 bytes when compressed by zlib with the maximum compression level

width: int | None

Optional. Width of the widget in logical pixels; omit if the widget must occupy the whole width of the message bubble. The width is clamped by the app to the range from 200 to the maximum width of the message bubble

height: int | None

Optional. Height of the widget in logical pixels; omit if the height of the widget isn’t fixed. The height is clamped by the app to the range 50-600

public_data: str | None

Optional. Public data of the widget, 0-1024 bytes, which will be available wherever the widget is shown. If the widget is shared, then all messages with it will have the same public data

chat_data: str | None

Optional. Data of the widget, which is specific to the message, 0-1024 bytes

caption: str | None

Optional. Widget caption, 0-1024 characters after entities parsing

parse_mode: str | Default | None

Optional. Mode for parsing entities in the widget caption. See formatting options for more details

caption_entities: list[MessageEntity] | None

Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode

show_caption_above_media: bool | Default | None

Optional. Pass True if the caption must be shown above the widget

allow_queries: bool | None

Optional. Pass True to allow the widget to send queries to the bot

is_shared: bool | None

Optional. Pass True to create a shared widget. Each message sent from the result creates a separate shared widget, whose identifier is received by the bot only in the field widget_id of queries from the widget. To send an existing shared widget in response to an inline query, use aiogram.types.input_shared_widget_message_content.InputSharedWidgetMessageContent instead