BackgroundTypePattern

class aiogram.types.background_type_pattern.BackgroundTypePattern(*, type: Literal['pattern'] = 'pattern', document: Document, fill: BackgroundFillSolid | BackgroundFillGradient | BackgroundFillFreeformGradient, intensity: int, is_inverted: bool | None = None, is_moving: bool | None = None, **extra_data: Any)[source]

The background is a PNG or TGV (gzipped subset of SVG with MIME type ‘application/x-tgwallpattern’) pattern to be combined with the background fill chosen by the user.

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

type: Literal['pattern']

Type of the background, always ‘pattern’

document: Document

Document with the pattern

fill: BackgroundFillSolid | BackgroundFillGradient | BackgroundFillFreeformGradient

The background fill that is combined with the pattern

model_computed_fields: ClassVar[Dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_post_init(context: Any, /) None

We need to both initialize private attributes and call the user-defined model_post_init method.

intensity: int

Intensity of the pattern when it is shown above the filled background; 0-100

is_inverted: bool | None

Optional. True, if the background fill must be applied only to the pattern itself. All other pixels are black in this case. For dark themes only

is_moving: bool | None

Optional. True, if the background moves slightly when the device is tilted