trackmania.ad module

class trackmania.ad.Ad(uid: str, name: str, type: str, url: str, img2x3: str, img16x9: str, img64x10: str, media: str, display_format: str)[source]

Bases: object

New in version 0.3.0.

Represents an Ad in Trackmania

Parameters
  • uid (str) – The unique ID of the ad

  • name (str) – The name of the ad

  • type (str) – The type of the ad. Can be “nadeo” or “ugc”. “Nadeo” is for official advertisements while “UGC” is for user generated content.

  • url (str) – URL set for the ad by the uploaders of the ad.

  • img2x3 (str) – Link to where the 2x3 image of the ad is stored. Can be empty if it does not exist.

  • img16x9 (str) – Link to where the 16x9 image of the ad is stored. Can be empty if it does not exist.

  • img64x10 (str) – Link to where the 64x10 image of the ad is stored. Can be empty if it does not exist.

  • media (str) – Link to get the media of the ad.

  • display_format (str) – The display format of the ad.

async classmethod get_ad(ad_uid: str) Optional[Self][source]

New in version 0.3.0.

Changed in version 0.4.0: Changed to classmethod

Gets an ad by its unique ID.

Parameters

ad_uid (str) – The unique ID of the ad

Returns

The ad

Return type

Self

async classmethod list_ads() List[Self][source]

New in version 0.3.0.

Changed in version 0.4.0: Changed to classmethod

Lists all ads currently in trackmania.

Returns

All the Ads

Return type

List[Self]

Raises

TMIOException – If an unexpected error occurs.