### Install ro.py from Git Source: https://ro.py.jmk.gg/v2.0.0 Install ro.py directly from its GitHub repository. Ensure git-scm is installed. ```bash pip install git+git://github.com/ro-py/ro.py.git ``` -------------------------------- ### Install ro.py from PyPI Source: https://ro.py.jmk.gg/v2.0.0 Use this command to install the ro.py library from the Python Package Index. ```bash pip install roblox ``` -------------------------------- ### Install python-dotenv Library Source: https://ro.py.jmk.gg/v2.0.0/tutorials/authentication Install the python-dotenv library using pip to manage environment variables. ```bash $ pip install python-dotenv ``` -------------------------------- ### Get Asset Instance Source: https://ro.py.jmk.gg/v2.0.0/reference/roblox/bases/baseuser Placeholder for a method to get an asset instance for a user. The implementation is not provided in the source. ```python async def get_asset_instance(self, asset: AssetOrAssetId) -> Optional[AssetInstance]: """ ``` -------------------------------- ### GET /v1/plugins/{pluginId} Source: https://ro.py.jmk.gg/v2.0.0/reference/roblox/client Grabs a plugin with the passed ID. ```APIDOC ## GET /v1/plugins/{pluginId} ### Description Grabs a plugin with the passed ID. ### Method GET ### Endpoint /v1/plugins/{pluginId} ### Query Parameters - **pluginId** (int) - Required - A Roblox plugin ID. ### Response #### Success Response (200) - **Plugin** - A Plugin object. ### Response Example { "pluginId": 12345, "name": "Example Plugin", "description": "This is an example plugin.", "creatorId": 67890 } ``` -------------------------------- ### GET /v1/plugins Source: https://ro.py.jmk.gg/v2.0.0/reference/roblox/client Grabs a list of plugins corresponding to each ID in the list. ```APIDOC ## GET /v1/plugins ### Description Grabs a list of plugins corresponding to each ID in the list. ### Method GET ### Endpoint /v1/plugins ### Query Parameters - **pluginIds** (list[int]) - Required - A list of Roblox plugin IDs. ### Response #### Success Response (200) - **data** (list[Plugin]) - A list of Plugins. ### Response Example { "data": [ { "pluginId": 12345, "name": "Example Plugin", "description": "This is an example plugin.", "creatorId": 67890 } ] } ``` -------------------------------- ### GET /plugins Source: https://ro.py.jmk.gg/v2.0.0/reference/roblox/client Retrieves a list of plugins based on provided IDs. ```APIDOC ## GET /plugins ### Description Grabs a list of plugins corresponding to each ID in the list. ### Method GET ### Endpoint /plugins ### Parameters #### Query Parameters - **plugin_ids** (List[int]) - Required - A list of Roblox plugin IDs. ### Response #### Success Response (200) - **List[Plugin]** (List[Plugin]) - A list of Plugin objects. #### Response Example { "example": "[{\"id\": 12345, \"name\": \"Example Plugin 1\"}, {\"id\": 67890, \"name\": \"Example Plugin 2\"}]" } ``` -------------------------------- ### Client Initialization and Authentication Source: https://ro.py.jmk.gg/v2.0.0/reference/roblox/client Details on how to initialize the Client object and set authentication tokens. ```APIDOC ## Client Initialization and Authentication ### Description Initializes the Roblox client and provides methods for authentication. ### Method `__init__` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```python client = Client(token=".ROBLOSECURITY_TOKEN") ``` ### Response None ## POST /set_token ### Description Authenticates the client with a .ROBLOSECURITY token. This method does not send requests and will not throw if the token is invalid. ### Method `set_token` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **token** (str) - Required - A .ROBLOSECURITY token to authenticate the client with. ### Request Example ```python client.set_token(".ROBLOSECURITY_TOKEN") ``` ### Response None ``` -------------------------------- ### Get User Friend Count (Async) Source: https://ro.py.jmk.gg/v2.0.0/reference/roblox/bases/baseuser Asynchronously retrieves the number of friends a user has. No specific setup is required beyond having a user object. ```python async def get_friend_count(self) -> int: """ Gets the user's friend count. Returns: The user's friend count. """ return await self._get_friend_channel_count("friends") ``` -------------------------------- ### Get User Follower Count (Async) Source: https://ro.py.jmk.gg/v2.0.0/reference/roblox/bases/baseuser Asynchronously retrieves the number of followers a user has. No specific setup is required beyond having a user object. ```python async def get_follower_count(self) -> int: """ Gets the user's follower count. Returns: The user's follower count. """ return await self._get_friend_channel_count("followers") ``` -------------------------------- ### Get User Following Count (Async) Source: https://ro.py.jmk.gg/v2.0.0/reference/roblox/bases/baseuser Asynchronously retrieves the number of users the current user is following. No specific setup is required beyond having a user object. ```python async def get_following_count(self) -> int: """ Gets the user's following count. Returns: The user's following count. """ return await self._get_friend_channel_count("followings") ``` -------------------------------- ### Initialize UserPromotionChannels Source: https://ro.py.jmk.gg/v2.0.0/reference/roblox/promotionchannels Constructor for UserPromotionChannels, populating social media links from a dictionary. Ensure the input dictionary contains keys for 'facebook', 'twitter', 'youtube', 'twitch', and 'guilded'. ```python def __init__(self, data: dict): self.facebook: Optional[str] = data["facebook"] self.twitter: Optional[str] = data["twitter"] self.youtube: Optional[str] = data["youtube"] self.twitch: Optional[str] = data["twitch"] self.guilded: Optional[str] = data["guilded"] ``` -------------------------------- ### GET Request Source: https://ro.py.jmk.gg/v2.0.0/reference/roblox/utilities/requests Sends an asynchronous GET request. ```APIDOC ## GET ### Description Sends an asynchronous GET request. ### Method GET ### Endpoint This method is part of a class and does not have a fixed endpoint. The endpoint is determined by the arguments passed to the `request` method. ### Parameters #### Path Parameters None (handled by `*args` and `**kwargs`) #### Query Parameters None (handled by `*args` and `**kwargs`) #### Request Body None (handled by `*args` and `**kwargs`) ### Request Example ```python # Assuming 'request_utils' is an instance of the class response = await request_utils.get("https://example.com/resource") ``` ### Response #### Success Response (200) - **Response** (Response) - An HTTP response object. ``` -------------------------------- ### Universe Initialization Source: https://ro.py.jmk.gg/v2.0.0/reference/roblox/universes Details on how to initialize a Universe object, including parameters and attributes. ```APIDOC ## `__init__(self, shared: ClientSharedObject, data: dict)` ### Description Initializes a Universe object with shared client data and universe-specific data. ### Method `__init__` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **shared** (ClientSharedObject) - Required - The ClientSharedObject. - **data** (dict) - Required - The universe data. ### Request Example ```json { "shared": "", "data": { "id": 12345, "rootPlaceId": 67890, "name": "Example Universe", "description": "This is an example universe.", "creator": { "type": "User", "userId": 11111 }, "price": 0, "allowedGearGenres": [], "allowedGearCategories": [], "isGenreEnforced": false, "copyingAllowed": true, "playing": 100, "visits": 10000, "maxPlayers": 20, "created": "2023-01-01T12:00:00Z", "updated": "2023-01-01T12:00:00Z", "studioAccessToApisAllowed": true, "createVipServersAllowed": true, "universeAvatarType": "MorphToR15", "genre": "Adventure", "isAllGenre": false, "isFavoritedByUser": true, "favoritedCount": 500 } } ``` ### Response This method does not return a value directly, but initializes the Universe object with the following attributes: - **id** (int) - **root_place** (BaseUniverse) - **name** (str) - **description** (str) - **creator_type** (Enum) - **creator** (Union[PartialUser, UniversePartialGroup]) - **price** (Optional[int]) - **allowed_gear_genres** (List[str]) - **allowed_gear_categories** (List[str]) - **is_genre_enforced** (bool) - **copying_allowed** (bool) - **playing** (int) - **visits** (int) - **max_players** (int) - **created** (datetime) - **updated** (datetime) - **studio_access_to_apis_allowed** (bool) - **create_vip_servers_allowed** (bool) - **universe_avatar_type** (UniverseAvatarType) - **genre** (UniverseGenre) - **is_all_genre** (bool) - **is_favorited_by_user** (bool) - **favorited_count** (int) #### Response Example None (initialization method) ``` -------------------------------- ### Initialize AccountProvider Source: https://ro.py.jmk.gg/v2.0.0/reference/roblox/account Initializes the AccountProvider with a ClientSharedObject. This is required for all account-related operations. ```python def __init__(self, shared: ClientSharedObject): """ Arguments: shared: The ClientSharedObject to be used when getting information on an account. """ self._shared: ClientSharedObject = shared ``` -------------------------------- ### GET /badges/v1/badges/{badge_id} Source: https://ro.py.jmk.gg/v2.0.0/reference/roblox/client Gets a badge with the passed ID. ```APIDOC ## GET /badges/v1/badges/{badge_id} ### Description Gets a badge with the passed ID. ### Method GET ### Endpoint /badges/v1/badges/{badge_id} ### Query Parameters - **badge_id** (int) - Required - A Roblox badge ID. ### Response #### Success Response (200) - **Badge** - A Badge object. ### Response Example { "badgeId": 12345, "name": "Example Badge", "description": "This is an example badge." } ``` -------------------------------- ### GET /promotion-channels Source: https://ro.py.jmk.gg/v2.0.0/reference/roblox/bases/baseuser Gets the user's promotion channels. ```APIDOC ## GET /promotion-channels ### Description Gets the user's promotion channels. ### Method GET ### Endpoint /v1/users/{userId}/promotion-channels ### Response #### Success Response (200) - **User promotion channels** (object) - An object containing the user's promotion channel settings. ``` -------------------------------- ### Initialize ChatSettings Source: https://ro.py.jmk.gg/v2.0.0/reference/roblox/chat Initializes ChatSettings with raw data. Requires a dictionary containing chat settings. ```python def __init__(self, data: dict): """ Arguments: data: The raw input data. """ self.chat_enabled: bool = data["chatEnabled"] self.is_active_chat_user: bool = data["isActiveChatUser"] self.is_connect_tab_enabled: bool = data["isConnectTabEnabled"] ``` -------------------------------- ### GET /roblox-badges Source: https://ro.py.jmk.gg/v2.0.0/reference/roblox/bases/baseuser Gets the user's Roblox badges. ```APIDOC ## GET /roblox-badges ### Description Gets the user's Roblox badges. ### Method GET ### Endpoint /v1/users/{userId}/roblox-badges ### Response #### Success Response (200) - **Roblox badges** (array) - A list of Roblox badge objects. ``` -------------------------------- ### Initialize BadgeStatistics Source: https://ro.py.jmk.gg/v2.0.0/reference/roblox/badges Initializes BadgeStatistics from raw data. Expects keys like 'pastDayAwardedCount', 'awardedCount', and 'winRatePercentage' in the input dictionary. ```python def __init__(self, data: dict): """ Arguments: data: The raw input data. """ self.past_day_awarded_count: int = data["pastDayAwardedCount"] self.awarded_count: int = data["awardedCount"] self.win_rate_percentage: int = data["winRatePercentage"] ``` -------------------------------- ### GET /groups/primary/role Source: https://ro.py.jmk.gg/v2.0.0/reference/roblox/bases/baseuser Gets the role for the user's primary group. ```APIDOC ## GET /groups/primary/role ### Description Gets the role for the user's primary group. ### Method GET ### Endpoint /v1/users/{userId}/groups/primary/role ### Response #### Success Response (200) - **role** (object) - Role details. - **name** (string) - The name of the role. - **rank** (int) - The rank of the role. - **group** (object) - Group details. - **id** (int) - The ID of the group. - **name** (string) - The name of the group. #### Not Found Response (404) - Returns null if the user does not have a primary group. ``` -------------------------------- ### Initialize ro.py Client Source: https://ro.py.jmk.gg/v2.0.0/tutorials/get-started Import and initialize the Client to represent a user's session on Roblox. This is the first step in any ro.py application. ```python from roblox import Client client = Client() ``` -------------------------------- ### GET /groups/roles Source: https://ro.py.jmk.gg/v2.0.0/reference/roblox/bases/baseuser Gets a list of roles for all groups the user is a member of. ```APIDOC ## GET /groups/roles ### Description Gets a list of roles for all groups the user is a member of. ### Method GET ### Endpoint /v1/users/{userId}/groups/roles ### Response #### Success Response (200) - **roles** (array) - A list of role objects. - **role** (object) - Role details. - **name** (string) - The name of the role. - **rank** (int) - The rank of the role. - **group** (object) - Group details. - **id** (int) - The ID of the group. - **name** (string) - The name of the group. ``` -------------------------------- ### Initialize AssetResaleData Source: https://ro.py.jmk.gg/v2.0.0/reference/roblox/resale Initializes an AssetResaleData object with resale information. Requires a dictionary containing resale data. ```python def __init__(self, data: dict): self.asset_stock: int = data["assetStock"] self.sales: int = data["sales"] self.number_remaining: int = data["numberRemaining"] self.recent_average_price: int = data["recentAveragePrice"] self.original_price: int = data["originalPrice"] self.price_data_points: List[dict] = data["priceDataPoints"] ``` -------------------------------- ### Send GET Request Source: https://ro.py.jmk.gg/v2.0.0/reference/roblox/utilities/requests Sends a GET request using the utility. This method is asynchronous. ```python async def get(self, *args, **kwargs) -> Response: """ Sends a GET request. Returns: An HTTP response. """ return await self.request("GET", *args, **kwargs) ``` -------------------------------- ### Initialize ThumbnailProvider Source: https://ro.py.jmk.gg/v2.0.0/reference/roblox/thumbnails Initializes the ThumbnailProvider with a shared client object. This object is passed to all generated client objects. ```python class ThumbnailProvider: """ The ThumbnailProvider that provides multiple functions for generating user thumbnails. Attributes: _shared: The shared object, which is passed to all objects this client generates. """ def __init__(self, shared: ClientSharedObject): """ Arguments: shared: Shared object. """ self._shared: ClientSharedObject = shared ``` -------------------------------- ### Implement __init__ for CleanAsyncClient Source: https://ro.py.jmk.gg/v2.0.0/reference/roblox/utilities/requests The __init__ method initializes the CleanAsyncClient by calling the parent class's initializer. This sets up the underlying httpx.AsyncClient. ```python def __init__(self): super().__init__() ``` -------------------------------- ### Client Initialization Source: https://ro.py.jmk.gg/v2.0.0/reference/roblox/client Initializes the Roblox client with optional authentication token and base URL. ```APIDOC ## Client Initialization ### Description Initializes the Roblox client with optional authentication token and base URL. ### Method __init__ ### Parameters #### Path Parameters - **token** (str) - Optional - A .ROBLOSECURITY token to authenticate the client with. - **base_url** (str) - Optional - The base URL to use when sending requests. Defaults to 'roblox.com'. ### Request Example ```python from roblox import Client client = Client(token='YOUR_TOKEN') ``` ### Response #### Success Response (200) - **Client** - An initialized Roblox client object. ``` -------------------------------- ### Asset Initialization Source: https://ro.py.jmk.gg/v2.0.0/reference/roblox/assets Details the initialization of an Asset object, including required parameters and the properties it holds. ```APIDOC ## POST /websites/ro_py_jmk_gg_v2_0_0 ### Description Initializes an Asset object with shared client information and request data. ### Method POST ### Endpoint /websites/ro_py_jmk_gg_v2_0_0 ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **shared** (ClientSharedObject) - Required - The ClientSharedObject to be used when getting information on assets. - **data** (dict) - Required - The data from the request. ### Request Example ```json { "shared": "", "data": { "AssetId": 12345, "ProductType": "Asset", "ProductId": 67890, "Name": "Example Asset", "Description": "This is an example asset.", "AssetTypeId": 1, "Creator": { "CreatorType": 1, "Name": "Example User" }, "IconImageAssetId": 54321, "Created": "2023-01-01T12:00:00Z", "Updated": "2023-01-01T12:00:00Z", "PriceInRobux": 100, "Sales": 50, "IsNew": true, "IsForSale": true, "IsPublicDomain": false, "IsLimited": false, "IsLimitedUnique": false, "Remaining": null, "MinimumMembershipLevel": 0, "ContentRatingTypeId": 0, "SaleAvailabilityLocations": [] } } ``` ### Response #### Success Response (200) - **product_type** (Optional[str]) - The type of the product. - **id** (int) - The unique identifier of the asset. - **product_id** (int) - The product ID associated with the asset. - **name** (str) - The name of the asset. - **description** (str) - The description of the asset. - **type** (AssetType) - The type of the asset. - **creator_type** (CreatorType) - The type of the creator (User or Group). - **creator** (Union[PartialUser, AssetPartialGroup]) - Information about the creator. - **icon_image** (BaseAsset) - Information about the asset's icon. - **created** (datetime) - The creation date and time of the asset. - **updated** (datetime) - The last updated date and time of the asset. - **price** (Optional[int]) - The price of the asset in Robux, if applicable. - **sales** (int) - The number of sales the asset has. - **is_new** (bool) - Indicates if the asset is new. - **is_for_sale** (bool) - Indicates if the asset is currently for sale. - **is_public_domain** (bool) - Indicates if the asset is in the public domain. - **is_limited** (bool) - Indicates if the asset is a limited item. - **is_limited_unique** (bool) - Indicates if the asset is a unique limited item. - **remaining** (Optional[int]) - The number of remaining units for limited unique items. - **minimum_membership_level** (int) - The minimum membership level required to access the asset. - **content_rating_type_id** (int) - The content rating type ID for the asset. - **sale_availability_locations** (list) - Locations where the asset is available for sale. #### Response Example ```json { "product_type": "Asset", "id": 12345, "product_id": 67890, "name": "Example Asset", "description": "This is an example asset.", "type": {"type_id": 1}, "creator_type": {"type_id": 1}, "creator": { "name": "Example User" }, "icon_image": {"asset_id": 54321}, "created": "2023-01-01T12:00:00Z", "updated": "2023-01-01T12:00:00Z", "price": 100, "sales": 50, "is_new": true, "is_for_sale": true, "is_public_domain": false, "is_limited": false, "is_limited_unique": false, "remaining": null, "minimum_membership_level": 0, "content_rating_type_id": 0, "sale_availability_locations": [] } ``` ``` -------------------------------- ### GET /friends/{channel}/count Source: https://ro.py.jmk.gg/v2.0.0/reference/roblox/bases/baseuser Gets the count of items in a specific friend channel for the user. ```APIDOC ## GET /friends/{channel}/count ### Description Gets the count of items in a specific friend channel for the user. ### Method GET ### Endpoint /v1/users/{userId}/{channel}/count ### Parameters #### Path Parameters - **channel** (string) - Required - The name of the friend channel (e.g., 'friends', 'followers'). ### Response #### Success Response (200) - **count** (int) - The number of items in the specified channel. ``` -------------------------------- ### Initialize ChatProvider in Python Source: https://ro.py.jmk.gg/v2.0.0/reference/roblox/chat Initializes the ChatProvider with a ClientSharedObject. This is required for all chat-related operations. ```python def __init__(self, shared: ClientSharedObject): """ Arguments: shared: The ClientSharedObject for getting information about chat. """ self._shared: ClientSharedObject = shared ``` -------------------------------- ### Initialize ThreeDThumbnail Camera Properties Source: https://ro.py.jmk.gg/v2.0.0/reference/roblox/threedthumbnails Initializes a 3D thumbnail camera with field of view, position, and direction. Requires a dictionary containing 'fov', 'position', and 'direction'. ```python def __init__(self, data: dict): self.fov: float = data["fov"] self.position: ThreeDThumbnailVector3 = ThreeDThumbnailVector3(data["position"]) self.direction: ThreeDThumbnailVector3 = ThreeDThumbnailVector3(data["direction"]) ``` -------------------------------- ### Get Friend Channel Count Source: https://ro.py.jmk.gg/v2.0.0/reference/roblox/bases/baseuser Internal method to get the count of items in a specific friend channel (e.g., friends, followers). ```python async def _get_friend_channel_count(self, channel: str) -> int: count_response = await self._shared.requests.get( url=self._shared.url_generator.get_url("friends", f"v1/users/{self.id}/{channel}/count") ) return count_response.json()["count"] ``` -------------------------------- ### Get Universe Favorite Count Source: https://ro.py.jmk.gg/v2.0.0/reference/roblox/bases/baseuniverse Retrieves the total number of favorites for a given Roblox universe. This method makes an asynchronous GET request to the Roblox API. ```python async def get_favorite_count(self) -> int: """ Grabs the universe's favorite count. Returns: The universe's favorite count. """ favorite_count_response = await self._shared.requests.get( url=self._shared.url_generator.get_url("games", f"v1/games/{self.id}/favorites/count") ) favorite_count_data = favorite_count_response.json() return favorite_count_data["favoritesCount"] ``` -------------------------------- ### Implement __repr__ for VersionInfo Source: https://ro.py.jmk.gg/v2.0.0/reference/roblox/__init__ Defines the string representation for a VersionInfo instance. This method formats the output for clear display. ```python def __repr__(self): 'Return a nicely formatted representation string' return self.__class__.__name__ + repr_fmt % self ``` -------------------------------- ### User Initialization Method Source: https://ro.py.jmk.gg/v2.0.0/reference/roblox/users The constructor for the User class, initializing user attributes from provided shared object and data dictionary. Requires a ClientSharedObject and a dictionary containing user data. ```python def __init__(self, shared: ClientSharedObject, data: dict): """ Arguments: shared: Shared object. data: The data from the request. """ super().__init__(shared=shared, user_id=data["id"]) self._shared: ClientSharedObject = shared self._data: dict = data self.name: str = data["name"] self.display_name: str = data["displayName"] self.external_app_display_name: str = data["externalAppDisplayName"] self.id: int = data["id"] self.is_banned: bool = data["isBanned"] self.description: str = data["description"] self.created: datetime = parse(data["created"]) ``` -------------------------------- ### Get multiple Roblox universes by IDs Source: https://ro.py.jmk.gg/v2.0.0/reference/roblox/client Fetches a list of Roblox universes based on a provided list of universe IDs. This method makes a GET request to the 'games/v1/games' endpoint. ```python async def get_universes(self, universe_ids: List[int]) -> List[Universe]: """ Grabs a list of universes corresponding to each ID in the list. Arguments: universe_ids: A list of Roblox universe IDs. Returns: A list of Universes. """ universes_response = await self._requests.get( url=self._shared.url_generator.get_url("games", "v1/games"), params={"universeIds": universe_ids}, ) universes_data = universes_response.json()["data"] return [ Universe(shared=self._shared, data=universe_data) for universe_data in universes_data ] ``` -------------------------------- ### Initialize ThreeDThumbnailVector3 Components Source: https://ro.py.jmk.gg/v2.0.0/reference/roblox/threedthumbnails Initializes the x, y, and z components of a 3D thumbnail vector from a dictionary. Expects keys 'x', 'y', and 'z'. ```python def __init__(self, data: dict): self.x: float = data["x"] self.y: float = data["y"] self.z: float = data["z"] ``` -------------------------------- ### Get multiple Roblox plugins by IDs Source: https://ro.py.jmk.gg/v2.0.0/reference/roblox/client Fetches a list of Roblox plugins based on a provided list of plugin IDs. This method makes a GET request to the 'develop/v1/plugins' endpoint. ```python async def get_plugins(self, plugin_ids: List[int]) -> List[Plugin]: """ Grabs a list of plugins corresponding to each ID in the list. Arguments: plugin_ids: A list of Roblox plugin IDs. Returns: A list of Plugins. """ plugins_response = await self._requests.get( url=self._shared.url_generator.get_url( "develop", "v1/plugins" ), params={ "pluginIds": plugin_ids } ) plugins_data = plugins_response.json()["data"] return [Plugin(shared=self._shared, data=plugin_data) for plugin_data in plugins_data] ``` -------------------------------- ### Get BaseAsset Resale Data Source: https://ro.py.jmk.gg/v2.0.0/reference/roblox/bases/baseasset Retrieves the limited resale data for a Roblox asset. This method requires the asset to be a limited item. It makes a GET request to the economy API. ```python async def get_resale_data(self) -> AssetResaleData: """ Gets the asset's limited resale data. The asset must be a limited item for this information to be present. Returns: The asset's limited resale data. """ resale_response = await self._shared.requests.get( url=self._shared.url_generator.get_url("economy", f"v1/assets/{self.id}/resale-data") ) resale_data = resale_response.json() return AssetResaleData(data=resale_data) ``` -------------------------------- ### Initialize BasePlugin Source: https://ro.py.jmk.gg/v2.0.0/reference/roblox/bases/baseplugin Initializes a BasePlugin object with shared client objects and a plugin ID. This is a required setup step before interacting with plugin data. ```python def __init__(self, shared: ClientSharedObject, plugin_id: int): """ Arguments: shared: The ClientSharedObject. plugin_id: The plugin ID. """ super().__init__(shared, plugin_id) self._shared: ClientSharedObject = shared self.id: int = plugin_id ``` -------------------------------- ### Get User Username History (Inefficient) Source: https://ro.py.jmk.gg/v2.0.0/tutorials/bases This snippet demonstrates an inefficient way to get a user's username history by first fetching the entire user object, which sends an unnecessary request if only the username history is needed. ```python user = await client.get_user(1) # we don't need this! async for username in user.username_history(): print(username) ``` -------------------------------- ### BaseInstance Initialization Source: https://ro.py.jmk.gg/v2.0.0/reference/roblox/bases/baseinstance Initializes a BaseInstance object. ```APIDOC ## __init__(self, shared: ClientSharedObject, instance_id: int) ### Description Initializes a BaseInstance object. ### Parameters #### Path Parameters - **shared** (ClientSharedObject) - Required - The ClientSharedObject. - **instance_id** (int) - Required - The asset instance ID. ``` -------------------------------- ### Initialize BadgeInstance in Python Source: https://ro.py.jmk.gg/v2.0.0/reference/roblox/instances Initializes the BadgeInstance with shared client object and data. It sets up the shared object and calls the parent constructor, then creates a BaseBadge object. ```python def __init__(self, shared: ClientSharedObject, data: dict): self._shared: ClientSharedObject = shared super().__init__(shared=self._shared, data=data) self.badge: BaseBadge = BaseBadge(shared=self._shared, badge_id=data["id"]) ``` -------------------------------- ### Get Users by IDs in Python Source: https://ro.py.jmk.gg/v2.0.0/reference/roblox/client Fetches a list of users based on their IDs. Set `expand=True` to get full User objects (2 requests per user) or `False` for PartialUser objects (1 request per user). ```python async def get_users( self, user_ids: List[int], exclude_banned_users: bool = False, expand: bool = False, ) -> Union[List[PartialUser], List[User]]: """ Grabs a list of users corresponding to each user ID in the list. Arguments: user_ids: A list of Roblox user IDs. exclude_banned_users: Whether to exclude banned users from the data. expand: Whether to return a list of Users (2 requests) rather than PartialUsers (1 request) Returns: A List of Users or partial users. """ users_response = await self._requests.post( url=self._shared.url_generator.get_url("users", f"v1/users"), json={"userIds": user_ids, "excludeBannedUsers": exclude_banned_users}, ) users_data = users_response.json()["data"] if expand: return [await self.get_user(user_data["id"]) for user_data in users_data] else: return [ PartialUser(shared=self._shared, data=user_data) for user_data in users_data ] ``` -------------------------------- ### Initialize Game Instance Object Source: https://ro.py.jmk.gg/v2.0.0/reference/roblox/jobs Initializes a Game Instance object with shared client data and specific game instance details. This includes player counts, ping, FPS, and join script information. ```python def __init__(self, shared: ClientSharedObject, data: dict): self._shared: ClientSharedObject = shared self.id: str = data["Guid"] super().__init__(shared=self._shared, job_id=self.id) self.capacity: int = data["Capacity"] self.ping: int = data["Ping"] self.fps: float = data["Fps"] self.show_slow_game_message: bool = data["ShowSlowGameMessage"] self.place: BasePlace = BasePlace(shared=self._shared, place_id=data["PlaceId"]) self.current_players: List[GameInstancePlayer] = [ GameInstancePlayer( shared=self._shared, data=player_data ) for player_data in data["CurrentPlayers"] ] self.can_join: bool = data["UserCanJoin"] self.show_shutdown_button: bool = data["ShowShutdownButton"] self.friends_description: str = data["FriendsDescription"] self.friends_mouseover = data["FriendsMouseover"] self.capacity_message: str = data["PlayersCapacity"] # TODO: reconsider self.join_script: str = data["JoinScript"] self.app_join_script: str = data["RobloxAppJoinScript"] ``` -------------------------------- ### Get Group Settings Source: https://ro.py.jmk.gg/v2.0.0/reference/roblox/bases/basegroup Retrieves all settings for a specified group. ```APIDOC ## GET /groups/{groupId}/settings ### Description Gets all the settings of the selected group. ### Method GET ### Endpoint `/groups/{groupId}/settings` ### Parameters #### Path Parameters - **groupId** (int) - Required - The ID of the group. ### Response #### Success Response (200) - **GroupSettings** (object) - The group's settings. #### Response Example ```json { "privacy": "Public", "description": "Welcome to our group!", "icon": "http://example.com/icon.png" } ``` ``` -------------------------------- ### Initialize Thumbnails Client Source: https://ro.py.jmk.gg/v2.0.0/reference/roblox/thumbnails Initializes the Thumbnails client with a shared object. This is the constructor for the class. ```python def __init__(self, shared: ClientSharedObject): """ Arguments: shared: Shared object. """ self._shared: ClientSharedObject = shared ``` -------------------------------- ### Get Group Roles Source: https://ro.py.jmk.gg/v2.0.0/reference/roblox/bases/basegroup Retrieves all roles within a group. ```APIDOC ## GET /groups/{groupId}/roles ### Description Gets all roles of the group. ### Method GET ### Endpoint `/groups/{groupId}/roles` ### Parameters #### Path Parameters - **groupId** (int) - Required - The ID of the group. ### Response #### Success Response (200) - **List[Role]** (array) - A list of the group's roles. #### Response Example ```json { "roles": [ { "id": 1, "name": "Owner", "description": "Group Owner", "rank": 255 }, { "id": 2, "name": "Admin", "description": "Group Administrator", "rank": 254 } ] } ``` ``` -------------------------------- ### Basic API Request Structure Source: https://ro.py.jmk.gg/v2.0.0/tutorials/get-started Demonstrates how to make a basic API request using `client.get_OBJECT()`. Note that `await` must be used within an asynchronous function. ```python from roblox import Client client = Client() await client.get_user(1) ``` -------------------------------- ### Initialize AssetInstance in Python Source: https://ro.py.jmk.gg/v2.0.0/reference/roblox/instances Initializes the AssetInstance with shared client object and data. It sets up the shared object and calls the parent constructor, then creates a BaseAsset object. ```python def __init__(self, shared: ClientSharedObject, data: dict): self._shared: ClientSharedObject = shared super().__init__(shared=self._shared, data=data) self.asset: BaseAsset = BaseAsset(shared=self._shared, asset_id=data["id"]) ``` -------------------------------- ### GET /users/{user_id} Source: https://ro.py.jmk.gg/v2.0.0/reference/roblox/client Retrieves a specific user using their ID. ```APIDOC ## GET /users/{user_id} ### Description Gets a user with the specified user ID. ### Method GET ### Endpoint /users/{user_id} ### Parameters #### Path Parameters - **user_id** (int) - Required - A Roblox user ID. ### Response #### Success Response (200) - **User** (User) - A user object. #### Response Example { "example": "{\"id\": 1, \"name\": \"Roblox\"}" } ``` -------------------------------- ### GET /universes Source: https://ro.py.jmk.gg/v2.0.0/reference/roblox/client Retrieves a list of universes based on provided IDs. ```APIDOC ## GET /universes ### Description Grabs a list of universes corresponding to each ID in the list. ### Method GET ### Endpoint /universes ### Parameters #### Query Parameters - **universe_ids** (List[int]) - Required - A list of Roblox universe IDs. ### Response #### Success Response (200) - **List[Universe]** (List[Universe]) - A list of Universe objects. #### Response Example { "example": "[{\"id\": 11111, \"name\": \"Example Universe 1\"}, {\"id\": 22222, \"name\": \"Example Universe 2\"}]" } ``` -------------------------------- ### ClientSharedObject Initialization Source: https://ro.py.jmk.gg/v2.0.0/reference/roblox/utilities/shared Details on initializing the ClientSharedObject, which requires the main client, requests object, and URL generator. ```APIDOC ## ClientSharedObject Initialization ### Description Initializes the `ClientSharedObject` with essential components required for client-server interactions and data management. ### Method `__init__` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```json { "client": "", "requests": "", "url_generator": "" } ``` ### Response #### Success Response (200) None (Initialization) #### Response Example None ``` -------------------------------- ### Initialize ThumbnailCDNHash Source: https://ro.py.jmk.gg/v2.0.0/reference/roblox/delivery Constructor for the ThumbnailCDNHash class. Requires a ClientSharedObject and the CDN hash string. ```python def __init__(self, shared: ClientSharedObject, cdn_hash: str): super().__init__(shared=shared, cdn_hash=cdn_hash) ``` -------------------------------- ### GET /universes/{universe_id} Source: https://ro.py.jmk.gg/v2.0.0/reference/roblox/client Retrieves a specific universe using its ID. ```APIDOC ## GET /universes/{universe_id} ### Description Gets a universe with the passed ID. ### Method GET ### Endpoint /universes/{universe_id} ### Parameters #### Path Parameters - **universe_id** (int) - Required - A Roblox universe ID. ### Response #### Success Response (200) - **Universe** (Universe) - A Universe object. #### Response Example { "example": "{\"id\": 11111, \"name\": \"Example Universe\"}" } ``` -------------------------------- ### Initialize Game Instance Player Thumbnail Object Source: https://ro.py.jmk.gg/v2.0.0/reference/roblox/jobs Initializes a Game Instance Player Thumbnail object with shared client data and thumbnail details. This includes the thumbnail URL and its final status. Asset information is not implemented. ```python def __init__(self, shared: ClientSharedObject, data: dict): self._shared: ClientSharedObject = shared self.url: str = data["Url"] self.final: bool = data["IsFinal"] ``` -------------------------------- ### GET /plugins/{plugin_id} Source: https://ro.py.jmk.gg/v2.0.0/reference/roblox/client Retrieves a specific plugin using its ID. ```APIDOC ## GET /plugins/{plugin_id} ### Description Grabs a plugin with the passed ID. ### Method GET ### Endpoint /plugins/{plugin_id} ### Parameters #### Path Parameters - **plugin_id** (int) - Required - A Roblox plugin ID. ### Response #### Success Response (200) - **Plugin** (Plugin) - A Plugin object. #### Response Example { "example": "{\"id\": 12345, \"name\": \"Example Plugin\"}" } ``` -------------------------------- ### BasePlugin Constructor Source: https://ro.py.jmk.gg/v2.0.0/reference/roblox/bases/baseplugin Initializes a new BasePlugin object. ```APIDOC ## __init__ (BasePlugin Constructor) ### Description Initializes a new BasePlugin object. ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```json { "shared": "ClientSharedObject", "plugin_id": 12345 } ``` ### Response #### Success Response (200) None (Constructor) #### Response Example None (Constructor) ``` -------------------------------- ### GET /v1/groups/{group_id} Source: https://ro.py.jmk.gg/v2.0.0/reference/roblox/client Retrieves a specific group by its unique ID. ```APIDOC ## GET /v1/groups/{group_id} ### Description Retrieves a specific group by its unique ID. ### Method GET ### Endpoint /v1/groups/{group_id} ### Parameters #### Path Parameters - **group_id** (int) - Required - The ID of the Roblox group. ### Response #### Success Response (200) - **id** (int) - The group's ID. - **name** (str) - The group's name. - **description** (str) - The group's description. #### Response Example ```json { "id": 12345, "name": "Roblox Devs", "description": "Official Roblox Developer Group" } ``` ``` -------------------------------- ### Initialize ItemNotFound Exception Source: https://ro.py.jmk.gg/v2.0.0/reference/roblox/utilities/exceptions Constructor for ItemNotFound exception, accepting a message and an optional httpx.Response object. ```python def __init__(self, message: str, response: Optional[Response] = None): """ Arguments: response: The raw response object. """ self.response: Optional[Response] = response self.status: Optional[int] = response.status_code if response else None super().__init__(message) ``` -------------------------------- ### Initialize Roblox Client Source: https://ro.py.jmk.gg/v2.0.0/reference/roblox/client Initializes the Roblox client with an optional authentication token and base URL. Sets up internal request and URL generation utilities. ```python def __init__(self, token: str = None, base_url: str = "roblox.com"): """ Arguments: token: A .ROBLOSECURITY token to authenticate the client with. base_url: The base URL to use when sending requests. """ self._url_generator: URLGenerator = URLGenerator(base_url=base_url) self._requests: Requests = Requests( url_generator=self._url_generator ) self._shared: ClientSharedObject = ClientSharedObject( client=self, requests=self._requests, url_generator=self._url_generator ) self.presence: PresenceProvider = PresenceProvider(shared=self._shared) self.thumbnails: ThumbnailProvider = ThumbnailProvider(shared=self._shared) self.delivery: DeliveryProvider = DeliveryProvider(shared=self._shared) self.chat: ChatProvider = ChatProvider(shared=self._shared) self.account: AccountProvider = AccountProvider(shared=self._shared) # TODO: Improve this hack self._shared.presence_provider = self.presence self._shared.thumbnail_provider = self.thumbnails self._shared.delivery_provider = self.delivery self._shared.chat_provider = self.chat self._shared.account_provider = self.account self.requests: Requests = self._requests self.url_generator: URLGenerator = self._url_generator if token: self.set_token(token) ``` -------------------------------- ### Get User Presence Source: https://ro.py.jmk.gg/v2.0.0/reference/roblox/bases/baseuser Retrieves the current presence status of the user. ```APIDOC ## GET /users/{userId}/presence ### Description Grabs the user's presence. ### Method GET ### Endpoint /users/{userId}/presence ### Parameters #### Path Parameters - **userId** (int) - Required - The ID of the user. ### Response #### Success Response (200) - **presence** (Optional[Presence]) - The user's presence, if they have an active presence. #### Response Example ```json { "userPresence": [ { "userId": 123, "lastLocation": "Online", "gameInstance": "", "placeId": 0, "rootPlaceId": 0, "isOnline": true, "isAway": false, "lastOnline": "2023-10-27T10:00:00Z" } ] } ``` ``` -------------------------------- ### Initialize BaseCDNHash with Shared Object and CDN Hash Source: https://ro.py.jmk.gg/v2.0.0/reference/roblox/delivery Initializes the BaseCDNHash with a shared client object and the CDN hash string. This is a required setup step for all CDN hash objects. ```python def __init__(self, shared: ClientSharedObject, cdn_hash: str): """ Arguments: shared: The shared object. cdn_hash: The CDN hash as a string. """ self._shared: ClientSharedObject = shared self.cdn_hash: str = cdn_hash ``` -------------------------------- ### Get User Currency Source: https://ro.py.jmk.gg/v2.0.0/reference/roblox/bases/baseuser Retrieves the Robux balance for the authenticated user. ```APIDOC ## GET /users/{userId}/currency ### Description Grabs the user's current Robux amount. Only works on the authenticated user. ### Method GET ### Endpoint /users/{userId}/currency ### Parameters #### Path Parameters - **userId** (int) - Required - The ID of the user. This endpoint typically only works for the authenticated user. ### Response #### Success Response (200) - **robux** (int) - The user's Robux amount. #### Response Example ```json { "robux": 5000 } ``` ``` -------------------------------- ### Initialize GamePassInstance in Python Source: https://ro.py.jmk.gg/v2.0.0/reference/roblox/instances Initializes the GamePassInstance with shared client object and data. It sets up the shared object and calls the parent constructor, then creates a BaseGamePass object. ```python def __init__(self, shared: ClientSharedObject, data: dict): self._shared: ClientSharedObject = shared super().__init__(shared=self._shared, data=data) self.gamepass: BaseGamePass = BaseGamePass(shared=self._shared, gamepass_id=data["id"]) ``` -------------------------------- ### Get CDN Hash Source: https://ro.py.jmk.gg/v2.0.0/reference/roblox/delivery Retrieves a Roblox CDN hash object. ```APIDOC ## Get CDN Hash ### Description Gets a Roblox CDN cdn_hash. ### Method GET ### Endpoint /delivery/cdn_hash ### Parameters #### Path Parameters None #### Query Parameters - **cdn_hash** (string) - Required - The cdn_hash. ### Request Example ```json { "cdn_hash": "some_cdn_hash" } ``` ### Response #### Success Response (200) - **BaseCDNHash** (object) - A BaseCDNHash object representing the CDN hash. #### Response Example ```json { "cdn_hash": "some_cdn_hash", "url": "https://example.com/some_cdn_hash" } ``` ``` -------------------------------- ### GET /thumbnails/v1/users/avatar-3d Source: https://ro.py.jmk.gg/v2.0.0/reference/roblox/thumbnails Retrieves a 3D representation of a user's avatar thumbnail. ```APIDOC ## GET /thumbnails/v1/users/avatar-3d ### Description Retrieves a 3D representation of a user's avatar thumbnail. ### Method GET ### Endpoint /thumbnails/v1/users/avatar-3d ### Parameters #### Query Parameters - **userId** (int) - Required - The ID of the user for whom to retrieve the 3D avatar thumbnail. ### Response #### Success Response (200) - **Thumbnail** (Thumbnail) - A Thumbnail object containing the 3D representation of the user's avatar. ```