trackmania.room module

class trackmania.room.Room(room_id: int, club_id: int, nadeo: bool, login: str | None, name: int, max_players_count: int, player_count: int, region: str, script: str, image_url: str, maps: list[trackmania.tmmap.TMMap])[source]

Bases: RoomObject

New in version 0.5.

Represents a Club Room in trackmania 2020.

Parameters
  • room_id (int) – The id of the room.

  • image_url (str) – The url of the image of the room.

  • nadeo (bool) – Whether the room is hosted in a cloud server. True only if it’s by nadeo.

  • login (str | None) – The login of the room. None if the room is in the cloud.

  • max_players_count (int) – The maximum number of players allowed to join the room.

  • name (int) – The name of the room

  • player_count (int) – The current number of players in the room.

  • region (str) –

    Where the room is hosted. There can only be 2 locations:-

    1. eu-west - Europe West

    2. ca-central - Canada Central

  • script (str) – The name of the script that is currently in use in the room.

async club() Club[source]

New in version 0.5.

Gets the club the room belongs to.

Returns

The club the room belongs to.

Return type

Club

async classmethod get_room(club_id: int, room_id: int) Self[source]

New in version 0.5.

Gets a room using it’s club and room id.

Parameters
  • club_id (int) – The club to which the room belongs to

  • room_id (int) – The room’s id.

Returns

The room.

Return type

Room

property maps: list[trackmania.tmmap.TMMap]

New in version 0.5.

The maps of the room.

Returns

The maps of the room.

Return type

list[TMMap]

async static popular_rooms(page: int = 0) list[trackmania.room.RoomSearchResult][source]

New in version 0.5.

Gets the popular club rooms. Popular club rooms are based on the number of players currently playing on the server.

Parameters

page (int, optional) – The page of the popular rooms data, by default 0

Returns

The popular rooms.

Return type

list[RoomSearchResult]

class trackmania.room.RoomSearchResult(name: str, room_id: int, club_id: int, nadeo: bool, player_count: int, max_player_count: int)[source]

Bases: RoomObject

New in version 0.5.

Represents a SearchResult from the Room.search() and Room.popular_rooms() command

Parameters
  • name (str) – The name of the room.

  • room_id (int) – The id of the room.

  • club_id (int) – The club id of the club the room belongs to.

  • nadeo (bool) – Whether nadeo owns this room.

  • player_count (int) – The current number of players currently online and in the room.

  • max_player_count (int) – The number of players allowed to join the room.

async club() Club[source]

New in version 0.5.

Returns the club the room belongs to.

Returns

The club the room belongs to.

Return type

Club

async room()[source]

New in version 0.5.

Returns the Room itself with its full data from the api.

Returns

The room itself.

Return type

Room