Hide navigation sidebar
Hide table of contents sidebar
Skip to content
Back to top
View this page
Toggle table of contents sidebar

# BackgroundTypePattern

Added in version 21.2.

class telegram.BackgroundTypePattern(document, fill, intensity, is_inverted=None, is_moving=None, *, api_kwargs=None)

  Bases: `telegram.BackgroundType`

  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.

  Objects of this class are comparable in terms of equality. Two objects of this class are considered equal, if their `document` and `fill` and `intensity` are equal.

  Available In

  `telegram.ChatBackground.type`

  Added in version 21.2.

  Parameters:

    - document (`telegram.Document`) – Document with the pattern.

    - fill (`telegram.BackgroundFill`) – The background fill that is combined with the pattern.

    - intensity (`int`) – Intensity of the pattern when it is shown above the filled background; 0-`100`.

    - is_inverted (`int`, 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`, optional) – `True`, if the background moves slightly when the device is tilted.

  type

    Type of the background. Always `PATTERN`.

    Type:

      `str`

  document

    Document with the pattern.

    Type:

      `telegram.Document`

  fill

    The background fill that is combined with the pattern.

    Type:

      `telegram.BackgroundFill`

  intensity

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

    Type:

      `int`

  is_inverted

    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.

    Type:

      `int`

  is_moving

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

    Type:

      `bool`