diff --git a/dev/search/search_index.json b/dev/search/search_index.json index fe26fc76..98448273 100644 --- a/dev/search/search_index.json +++ b/dev/search/search_index.json @@ -1 +1 @@ -{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"","title":"Overview","text":"
ro.py is an asynchronous, object-oriented wrapper for the Roblox web API.
"},{"location":"#features","title":"Features","text":"To install the latest stable version of ro.py, run the following command:
python3 -m pip install roblox\n
To install the latest unstable version of ro.py, install git-scm and run the following:
python3 -m pip install git+https://github.com/ro-py/ro.py.git\n
"},{"location":"#support","title":"Support","text":"The RoAPI Discord server provides support for ro.py in the #ro.py-support
channel.
Contains classes and functions related to the authenticated Roblox account. Not to be confused with users.py or the Account system.
"},{"location":"reference/account/#roblox.account.AccountProvider","title":"AccountProvider
","text":"Provides methods that control the authenticated user's account.
Source code inroblox/account.py
class AccountProvider:\n \"\"\"\n Provides methods that control the authenticated user's account.\n \"\"\"\n\n def __init__(self, client: Client):\n \"\"\"\n Arguments:\n client: The Client to be used when getting information on an account.\n \"\"\"\n self._client: Client = client\n\n async def get_birthday(self) -> date:\n \"\"\"\n Gets the authenticated user's birthday.\n\n Returns: \n The authenticated user's birthday.\n \"\"\"\n birthday_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"accountinformation\", \"v1/birthdate\")\n )\n birthday_data = birthday_response.json()\n return date(\n month=birthday_data[\"birthMonth\"],\n day=birthday_data[\"birthDay\"],\n year=birthday_data[\"birthYear\"]\n )\n\n async def set_birthday(\n self,\n birthday: date,\n password: str = None\n ):\n \"\"\"\n Changes the authenticated user's birthday.\n This endpoint *may* require your password, and requires an unlocked PIN.\n\n Arguments:\n birthday: A date object that represents the birthday to update the Client's account to.\n password: The password to the Client's account, this is required when changing the birthday.\n \"\"\"\n await self._client.requests.post(\n url=self._client.url_generator.get_url(\"accountinformation\", \"v1/birthdate\"),\n json={\n \"birthMonth\": birthday.month,\n \"birthDay\": birthday.day,\n \"birthYear\": birthday.year,\n \"password\": password\n }\n )\n\n async def get_description(self) -> string:\n \"\"\"\n Gets the authenticated user's description.\n\n Returns: \n The authenticated user's description.\n \"\"\"\n description_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"accountinformation\", \"v1/description\")\n )\n description_data = description_response.json()\n return description_data[\"description\"]\n\n async def set_description(\n self,\n description: string,\n ):\n \"\"\"\n Updates the authenticated user's description.\n This endpoint *may* require your token, and requires an unlocked PIN.\n\n Arguments:\n description: A string object that represents the description to update the Client's account to.\n \"\"\"\n await self._client.requests.post(\n url=self._client.url_generator.get_url(\"accountinformation\", \"v1/description\"),\n json={\n \"description\": description\n }\n )\n
"},{"location":"reference/account/#roblox.account.AccountProvider.__init__","title":"__init__(client)
","text":"Parameters:
Name Type Description Defaultclient
Client
The Client to be used when getting information on an account.
required Source code inroblox/account.py
def __init__(self, client: Client):\n \"\"\"\n Arguments:\n client: The Client to be used when getting information on an account.\n \"\"\"\n self._client: Client = client\n
"},{"location":"reference/account/#roblox.account.AccountProvider.get_birthday","title":"get_birthday()
async
","text":"Gets the authenticated user's birthday.
Returns:
Type Descriptiondate
The authenticated user's birthday.
Source code inroblox/account.py
async def get_birthday(self) -> date:\n \"\"\"\n Gets the authenticated user's birthday.\n\n Returns: \n The authenticated user's birthday.\n \"\"\"\n birthday_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"accountinformation\", \"v1/birthdate\")\n )\n birthday_data = birthday_response.json()\n return date(\n month=birthday_data[\"birthMonth\"],\n day=birthday_data[\"birthDay\"],\n year=birthday_data[\"birthYear\"]\n )\n
"},{"location":"reference/account/#roblox.account.AccountProvider.get_description","title":"get_description()
async
","text":"Gets the authenticated user's description.
Returns:
Type Descriptionstring
The authenticated user's description.
Source code inroblox/account.py
async def get_description(self) -> string:\n \"\"\"\n Gets the authenticated user's description.\n\n Returns: \n The authenticated user's description.\n \"\"\"\n description_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"accountinformation\", \"v1/description\")\n )\n description_data = description_response.json()\n return description_data[\"description\"]\n
"},{"location":"reference/account/#roblox.account.AccountProvider.set_birthday","title":"set_birthday(birthday, password=None)
async
","text":"Changes the authenticated user's birthday. This endpoint may require your password, and requires an unlocked PIN.
Parameters:
Name Type Description Defaultbirthday
date
A date object that represents the birthday to update the Client's account to.
requiredpassword
str
The password to the Client's account, this is required when changing the birthday.
None
Source code in roblox/account.py
async def set_birthday(\n self,\n birthday: date,\n password: str = None\n):\n \"\"\"\n Changes the authenticated user's birthday.\n This endpoint *may* require your password, and requires an unlocked PIN.\n\n Arguments:\n birthday: A date object that represents the birthday to update the Client's account to.\n password: The password to the Client's account, this is required when changing the birthday.\n \"\"\"\n await self._client.requests.post(\n url=self._client.url_generator.get_url(\"accountinformation\", \"v1/birthdate\"),\n json={\n \"birthMonth\": birthday.month,\n \"birthDay\": birthday.day,\n \"birthYear\": birthday.year,\n \"password\": password\n }\n )\n
"},{"location":"reference/account/#roblox.account.AccountProvider.set_description","title":"set_description(description)
async
","text":"Updates the authenticated user's description. This endpoint may require your token, and requires an unlocked PIN.
Parameters:
Name Type Description Defaultdescription
string
A string object that represents the description to update the Client's account to.
required Source code inroblox/account.py
async def set_description(\n self,\n description: string,\n):\n \"\"\"\n Updates the authenticated user's description.\n This endpoint *may* require your token, and requires an unlocked PIN.\n\n Arguments:\n description: A string object that represents the description to update the Client's account to.\n \"\"\"\n await self._client.requests.post(\n url=self._client.url_generator.get_url(\"accountinformation\", \"v1/description\"),\n json={\n \"description\": description\n }\n )\n
"},{"location":"reference/assets/","title":"assets","text":"This module contains classes intended to parse and deal with data from Roblox asset information endpoints.
"},{"location":"reference/assets/#roblox.assets.AssetType","title":"AssetType
","text":"Represents a Roblox asset type.
Attributes:
Name Type Descriptionid
int
Id of the Asset
name
Optional[str]
Name of the Asset
Source code inroblox/assets.py
class AssetType:\n \"\"\"\n Represents a Roblox asset type.\n\n Attributes:\n id: Id of the Asset\n name: Name of the Asset\n \"\"\"\n\n def __init__(self, type_id: int):\n \"\"\"\n Arguments:\n type_id: The AssetTypeID to instantiate this AssetType object with.\n This is used to determine the name of the AssetType.\n \"\"\"\n\n self.id: int = type_id\n self.name: Optional[str] = asset_type_names.get(type_id)\n\n def __repr__(self):\n return f\"<{self.__class__.__name__} id={self.id} name={self.name!r}>\"\n
"},{"location":"reference/assets/#roblox.assets.AssetType.__init__","title":"__init__(type_id)
","text":"Parameters:
Name Type Description Defaulttype_id
int
The AssetTypeID to instantiate this AssetType object with. This is used to determine the name of the AssetType.
required Source code inroblox/assets.py
def __init__(self, type_id: int):\n \"\"\"\n Arguments:\n type_id: The AssetTypeID to instantiate this AssetType object with.\n This is used to determine the name of the AssetType.\n \"\"\"\n\n self.id: int = type_id\n self.name: Optional[str] = asset_type_names.get(type_id)\n
"},{"location":"reference/assets/#roblox.assets.EconomyAsset","title":"EconomyAsset
","text":" Bases: BaseAsset
Represents a Roblox asset. It is intended to parse data from https://economy.roblox.com/v2/assets/ASSETID/details.
Attributes:
Name Type Descriptionid
int
Id of the Asset
product_id
int
Product id of the asset
name
str
Name of the Asset
description
str
Description of the Asset
type
AssetType
Type of the Asset
creator_type
CreatorType
Type of creator can be user or group see enum
creator
Union[PartialUser, AssetPartialGroup]
creator can be a user or group object
icon_image
BaseAsset
BaseAsset
created
datetime
When the asset was created
updated
datetime
When the asset was updated for the las time
price
Optional[int]
price of the asset
sales
int
amount of sales of the asset
is_new
bool
if the asset it new
is_for_sale
bool
if the asset is for sale
is_public_domain
bool
if the asset is public domain
is_limited
bool
if the asset is a limited item
is_limited_unique
bool
if the asset is a unique limited item
remaining
Optional[int]
How many items there are remaining if it is limited
minimum_membership_level
int
Minimum membership level required to buy item
content_rating_type_id
int
Unknown
sale_availability_locations
Unknown
Source code inroblox/assets.py
class EconomyAsset(BaseAsset):\n \"\"\"\n Represents a Roblox asset.\n It is intended to parse data from https://economy.roblox.com/v2/assets/ASSETID/details.\n\n Attributes:\n id: Id of the Asset\n product_id: Product id of the asset\n name: Name of the Asset\n description: Description of the Asset\n type: Type of the Asset\n creator_type: Type of creator can be user or group see enum\n creator: creator can be a user or group object\n icon_image: BaseAsset\n created: When the asset was created\n updated: When the asset was updated for the las time\n price: price of the asset\n sales: amount of sales of the asset\n is_new: if the asset it new\n is_for_sale: if the asset is for sale\n is_public_domain: if the asset is public domain\n is_limited: if the asset is a limited item\n is_limited_unique: if the asset is a unique limited item\n remaining: How many items there are remaining if it is limited\n minimum_membership_level: Minimum membership level required to buy item\n content_rating_type_id: Unknown\n sale_availability_locations: Unknown\n \"\"\"\n\n def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: The Client to be used when getting information on assets.\n data: The data from the request.\n \"\"\"\n super().__init__(client=client, asset_id=data[\"AssetId\"])\n\n self.product_type: Optional[str] = data[\"ProductType\"]\n self.id: int = data[\"AssetId\"]\n self.product_id: int = data[\"ProductId\"] # TODO: make this a BaseProduct\n self.name: str = data[\"Name\"]\n self.description: str = data[\"Description\"]\n self.type: AssetType = AssetType(type_id=data[\"AssetTypeId\"])\n\n self.creator_type: CreatorType = CreatorType(data[\"Creator\"][\"CreatorType\"])\n self.creator: Union[PartialUser, AssetPartialGroup]\n\n if self.creator_type == CreatorType.user:\n self.creator: PartialUser = PartialUser(client=client, data=data[\"Creator\"])\n elif self.creator_type == CreatorType.group:\n self.creator: AssetPartialGroup = AssetPartialGroup(client=client, data=data[\"Creator\"])\n\n self.icon_image: BaseAsset = BaseAsset(client=client, asset_id=data[\"IconImageAssetId\"])\n\n self.created: datetime = parse(data[\"Created\"])\n self.updated: datetime = parse(data[\"Updated\"])\n\n self.price: Optional[int] = data[\"PriceInRobux\"]\n self.sales: int = data[\"Sales\"]\n\n self.is_new: bool = data[\"IsNew\"]\n self.is_for_sale: bool = data[\"IsForSale\"]\n self.is_public_domain: bool = data[\"IsPublicDomain\"]\n self.is_limited: bool = data[\"IsLimited\"]\n self.is_limited_unique: bool = data[\"IsLimitedUnique\"]\n\n self.remaining: Optional[int] = data[\"Remaining\"]\n\n self.minimum_membership_level: int = data[\"MinimumMembershipLevel\"]\n self.content_rating_type_id: int = data[\"ContentRatingTypeId\"]\n self.sale_availability_locations = data[\"SaleAvailabilityLocations\"]\n
"},{"location":"reference/assets/#roblox.assets.EconomyAsset.__init__","title":"__init__(client, data)
","text":"Parameters:
Name Type Description Defaultclient
Client
The Client to be used when getting information on assets.
requireddata
dict
The data from the request.
required Source code inroblox/assets.py
def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: The Client to be used when getting information on assets.\n data: The data from the request.\n \"\"\"\n super().__init__(client=client, asset_id=data[\"AssetId\"])\n\n self.product_type: Optional[str] = data[\"ProductType\"]\n self.id: int = data[\"AssetId\"]\n self.product_id: int = data[\"ProductId\"] # TODO: make this a BaseProduct\n self.name: str = data[\"Name\"]\n self.description: str = data[\"Description\"]\n self.type: AssetType = AssetType(type_id=data[\"AssetTypeId\"])\n\n self.creator_type: CreatorType = CreatorType(data[\"Creator\"][\"CreatorType\"])\n self.creator: Union[PartialUser, AssetPartialGroup]\n\n if self.creator_type == CreatorType.user:\n self.creator: PartialUser = PartialUser(client=client, data=data[\"Creator\"])\n elif self.creator_type == CreatorType.group:\n self.creator: AssetPartialGroup = AssetPartialGroup(client=client, data=data[\"Creator\"])\n\n self.icon_image: BaseAsset = BaseAsset(client=client, asset_id=data[\"IconImageAssetId\"])\n\n self.created: datetime = parse(data[\"Created\"])\n self.updated: datetime = parse(data[\"Updated\"])\n\n self.price: Optional[int] = data[\"PriceInRobux\"]\n self.sales: int = data[\"Sales\"]\n\n self.is_new: bool = data[\"IsNew\"]\n self.is_for_sale: bool = data[\"IsForSale\"]\n self.is_public_domain: bool = data[\"IsPublicDomain\"]\n self.is_limited: bool = data[\"IsLimited\"]\n self.is_limited_unique: bool = data[\"IsLimitedUnique\"]\n\n self.remaining: Optional[int] = data[\"Remaining\"]\n\n self.minimum_membership_level: int = data[\"MinimumMembershipLevel\"]\n self.content_rating_type_id: int = data[\"ContentRatingTypeId\"]\n self.sale_availability_locations = data[\"SaleAvailabilityLocations\"]\n
"},{"location":"reference/badges/","title":"badges","text":"This module contains classes intended to parse and deal with data from Roblox badge information endpoints.
"},{"location":"reference/badges/#roblox.badges.Badge","title":"Badge
","text":" Bases: BaseBadge
Represents a badge from the API.
Attributes:
Name Type Descriptionid
int
The badge Id.
name
str
The name of the badge.
description
str
The badge description.
display_name
str
The localized name of the badge.
display_description
str
The localized badge description.
enabled
bool
Whether or not the badge is enabled.
icon
BaseAsset
The badge icon.
display_icon
BaseAsset
The localized badge icon.
created
datetime
When the badge was created.
updated
datetime
When the badge was updated.
statistics
BadgeStatistics
Badge award statistics.
awarding_universe
PartialUniverse
The universe the badge is being awarded from.
Source code inroblox/badges.py
class Badge(BaseBadge):\n \"\"\"\n Represents a badge from the API.\n\n Attributes:\n id: The badge Id.\n name: The name of the badge.\n description: The badge description.\n display_name: The localized name of the badge.\n display_description: The localized badge description.\n enabled: Whether or not the badge is enabled.\n icon: The badge icon.\n display_icon: The localized badge icon.\n created: When the badge was created.\n updated: When the badge was updated.\n statistics: Badge award statistics.\n awarding_universe: The universe the badge is being awarded from.\n \"\"\"\n\n def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: The Client to be used when getting information on badges.\n data: The data from the endpoint.\n \"\"\"\n self.id: int = data[\"id\"]\n\n super().__init__(client=client, badge_id=self.id)\n\n self.name: str = data[\"name\"]\n self.description: str = data[\"description\"]\n self.display_name: str = data[\"displayName\"]\n self.display_description: str = data[\"displayDescription\"]\n self.enabled: bool = data[\"enabled\"]\n self.icon: BaseAsset = BaseAsset(client=client, asset_id=data[\"iconImageId\"])\n self.display_icon: BaseAsset = BaseAsset(client=client, asset_id=data[\"displayIconImageId\"])\n self.created: datetime = parse(data[\"created\"])\n self.updated: datetime = parse(data[\"updated\"])\n\n self.statistics: BadgeStatistics = BadgeStatistics(data=data[\"statistics\"])\n self.awarding_universe: PartialUniverse = PartialUniverse(client=client, data=data[\"awardingUniverse\"])\n
"},{"location":"reference/badges/#roblox.badges.Badge.__init__","title":"__init__(client, data)
","text":"Parameters:
Name Type Description Defaultclient
Client
The Client to be used when getting information on badges.
requireddata
dict
The data from the endpoint.
required Source code inroblox/badges.py
def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: The Client to be used when getting information on badges.\n data: The data from the endpoint.\n \"\"\"\n self.id: int = data[\"id\"]\n\n super().__init__(client=client, badge_id=self.id)\n\n self.name: str = data[\"name\"]\n self.description: str = data[\"description\"]\n self.display_name: str = data[\"displayName\"]\n self.display_description: str = data[\"displayDescription\"]\n self.enabled: bool = data[\"enabled\"]\n self.icon: BaseAsset = BaseAsset(client=client, asset_id=data[\"iconImageId\"])\n self.display_icon: BaseAsset = BaseAsset(client=client, asset_id=data[\"displayIconImageId\"])\n self.created: datetime = parse(data[\"created\"])\n self.updated: datetime = parse(data[\"updated\"])\n\n self.statistics: BadgeStatistics = BadgeStatistics(data=data[\"statistics\"])\n self.awarding_universe: PartialUniverse = PartialUniverse(client=client, data=data[\"awardingUniverse\"])\n
"},{"location":"reference/badges/#roblox.badges.BadgeStatistics","title":"BadgeStatistics
","text":"Attributes:
Name Type Descriptionpast_day_awarded_count
int
How many instances of this badge were awarded in the last day.
awarded_count
int
How many instances of this badge have been awarded.
win_rate_percentage
int
Percentage of players who have joined the parent universe have been awarded this badge.
Source code inroblox/badges.py
class BadgeStatistics:\n \"\"\"\n Attributes:\n past_day_awarded_count: How many instances of this badge were awarded in the last day.\n awarded_count: How many instances of this badge have been awarded.\n win_rate_percentage: Percentage of players who have joined the parent universe have been awarded this badge.\n \"\"\"\n\n def __init__(self, data: dict):\n \"\"\"\n Arguments:\n data: The raw input data.\n \"\"\"\n self.past_day_awarded_count: int = data[\"pastDayAwardedCount\"]\n self.awarded_count: int = data[\"awardedCount\"]\n self.win_rate_percentage: int = data[\"winRatePercentage\"]\n\n def __repr__(self):\n return f\"<{self.__class__.__name__} past_day_awarded_count={self.past_day_awarded_count} awarded_count={self.awarded_count} win_rate_percentage={self.win_rate_percentage}>\"\n
"},{"location":"reference/badges/#roblox.badges.BadgeStatistics.__init__","title":"__init__(data)
","text":"Parameters:
Name Type Description Defaultdata
dict
The raw input data.
required Source code inroblox/badges.py
def __init__(self, data: dict):\n \"\"\"\n Arguments:\n data: The raw input data.\n \"\"\"\n self.past_day_awarded_count: int = data[\"pastDayAwardedCount\"]\n self.awarded_count: int = data[\"awardedCount\"]\n self.win_rate_percentage: int = data[\"winRatePercentage\"]\n
"},{"location":"reference/chat/","title":"chat","text":"Contains classes relating to the Roblox chat.
"},{"location":"reference/chat/#roblox.chat.ChatProvider","title":"ChatProvider
","text":"Provides information and data related to the Roblox chat system.
Source code inroblox/chat.py
class ChatProvider:\n \"\"\"\n Provides information and data related to the Roblox chat system.\n \"\"\"\n\n def __init__(self, client: Client):\n \"\"\"\n Arguments:\n client: The Client for getting information about chat.\n \"\"\"\n self._client: Client = client\n\n def __repr__(self):\n return f\"<{self.__class__.__name__}>\"\n\n async def get_unread_conversation_count(self) -> int:\n \"\"\"\n Gets the authenticated user's unread conversation count.\n\n Returns: \n The user's unread conversation count.\n \"\"\"\n unread_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"chat\", \"v2/get-unread-conversation-count\")\n )\n unread_data = unread_response.json()\n return unread_data[\"count\"]\n\n async def get_settings(self) -> ChatSettings:\n \"\"\"\n Gets the authenticated user's chat settings.\n\n Returns: \n The user's chat settings.\n \"\"\"\n settings_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"chat\", \"v2/chat-settings\")\n )\n settings_data = settings_response.json()\n return ChatSettings(data=settings_data)\n\n def get_user_conversations(self) -> PageNumberIterator:\n \"\"\"\n Gets the user's conversations.\n\n Returns: \n The user's conversations as a PageNumberIterator.\n \"\"\"\n return PageNumberIterator(\n client=self._client,\n url=self._client.url_generator.get_url(\"chat\", \"v2/get-user-conversations\"),\n handler=lambda client, data: Conversation(client=client, data=data)\n )\n
"},{"location":"reference/chat/#roblox.chat.ChatProvider.__init__","title":"__init__(client)
","text":"Parameters:
Name Type Description Defaultclient
Client
The Client for getting information about chat.
required Source code inroblox/chat.py
def __init__(self, client: Client):\n \"\"\"\n Arguments:\n client: The Client for getting information about chat.\n \"\"\"\n self._client: Client = client\n
"},{"location":"reference/chat/#roblox.chat.ChatProvider.get_settings","title":"get_settings()
async
","text":"Gets the authenticated user's chat settings.
Returns:
Type DescriptionChatSettings
The user's chat settings.
Source code inroblox/chat.py
async def get_settings(self) -> ChatSettings:\n \"\"\"\n Gets the authenticated user's chat settings.\n\n Returns: \n The user's chat settings.\n \"\"\"\n settings_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"chat\", \"v2/chat-settings\")\n )\n settings_data = settings_response.json()\n return ChatSettings(data=settings_data)\n
"},{"location":"reference/chat/#roblox.chat.ChatProvider.get_unread_conversation_count","title":"get_unread_conversation_count()
async
","text":"Gets the authenticated user's unread conversation count.
Returns:
Type Descriptionint
The user's unread conversation count.
Source code inroblox/chat.py
async def get_unread_conversation_count(self) -> int:\n \"\"\"\n Gets the authenticated user's unread conversation count.\n\n Returns: \n The user's unread conversation count.\n \"\"\"\n unread_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"chat\", \"v2/get-unread-conversation-count\")\n )\n unread_data = unread_response.json()\n return unread_data[\"count\"]\n
"},{"location":"reference/chat/#roblox.chat.ChatProvider.get_user_conversations","title":"get_user_conversations()
","text":"Gets the user's conversations.
Returns:
Type DescriptionPageNumberIterator
The user's conversations as a PageNumberIterator.
Source code inroblox/chat.py
def get_user_conversations(self) -> PageNumberIterator:\n \"\"\"\n Gets the user's conversations.\n\n Returns: \n The user's conversations as a PageNumberIterator.\n \"\"\"\n return PageNumberIterator(\n client=self._client,\n url=self._client.url_generator.get_url(\"chat\", \"v2/get-user-conversations\"),\n handler=lambda client, data: Conversation(client=client, data=data)\n )\n
"},{"location":"reference/chat/#roblox.chat.ChatSettings","title":"ChatSettings
","text":"Represents the authenticated user's Roblox chat settings.
Attributes:
Name Type Descriptionchat_enabled
bool
Whether chat is enabled for the user.
is_active_chat_user
bool
Whether the user is an active chat user. New accounts are active by default and become inactive if they do not send any messages over a period of time.
is_connect_tab_enabled
bool
Whether the Connect tab is enabled for this user.
Source code inroblox/chat.py
class ChatSettings:\n \"\"\"\n Represents the authenticated user's Roblox chat settings.\n\n Attributes:\n chat_enabled: Whether chat is enabled for the user.\n is_active_chat_user: Whether the user is an active chat user. New accounts are active by default and become\n inactive if they do not send any messages over a period of time.\n is_connect_tab_enabled: Whether the Connect tab is enabled for this user.\n \"\"\"\n\n def __init__(self, data: dict):\n \"\"\"\n Arguments:\n data: The raw input data.\n \"\"\"\n self.chat_enabled: bool = data[\"chatEnabled\"]\n self.is_active_chat_user: bool = data[\"isActiveChatUser\"]\n self.is_connect_tab_enabled: bool = data[\"isConnectTabEnabled\"]\n\n def __repr__(self):\n return f\"<{self.__class__.__name__} chat_enabled={self.chat_enabled} is_active_chat_user={self.is_active_chat_user} is_connect_tab_enabled={self.is_connect_tab_enabled}>\"\n
"},{"location":"reference/chat/#roblox.chat.ChatSettings.__init__","title":"__init__(data)
","text":"Parameters:
Name Type Description Defaultdata
dict
The raw input data.
required Source code inroblox/chat.py
def __init__(self, data: dict):\n \"\"\"\n Arguments:\n data: The raw input data.\n \"\"\"\n self.chat_enabled: bool = data[\"chatEnabled\"]\n self.is_active_chat_user: bool = data[\"isActiveChatUser\"]\n self.is_connect_tab_enabled: bool = data[\"isConnectTabEnabled\"]\n
"},{"location":"reference/client/","title":"client","text":"Contains the Client, which is the core object at the center of all ro.py applications.
"},{"location":"reference/client/#roblox.client.Client","title":"Client
","text":"Represents a Roblox client.
Attributes:
Name Type Descriptionrequests
Requests
The requests object, which is used to send requests to Roblox endpoints.
url_generator
URLGenerator
The URL generator object, which is used to generate URLs to send requests to endpoints.
presence
PresenceProvider
The presence provider object.
thumbnails
ThumbnailProvider
The thumbnail provider object.
delivery
DeliveryProvider
The delivery provider object.
chat
ChatProvider
The chat provider object.
account
AccountProvider
The account provider object.
Source code inroblox/client.py
class Client:\n \"\"\"\n Represents a Roblox client.\n\n Attributes:\n requests: The requests object, which is used to send requests to Roblox endpoints.\n url_generator: The URL generator object, which is used to generate URLs to send requests to endpoints.\n presence: The presence provider object.\n thumbnails: The thumbnail provider object.\n delivery: The delivery provider object.\n chat: The chat provider object.\n account: The account provider object.\n \"\"\"\n\n def __init__(self, token: str = None, base_url: str = \"roblox.com\"):\n \"\"\"\n Arguments:\n token: A .ROBLOSECURITY token to authenticate the client with.\n base_url: The base URL to use when sending requests.\n \"\"\"\n self._url_generator: URLGenerator = URLGenerator(base_url=base_url)\n self._requests: Requests = Requests()\n\n self.url_generator: URLGenerator = self._url_generator\n self.requests: Requests = self._requests\n\n self.presence: PresenceProvider = PresenceProvider(client=self)\n self.thumbnails: ThumbnailProvider = ThumbnailProvider(client=self)\n self.delivery: DeliveryProvider = DeliveryProvider(client=self)\n self.chat: ChatProvider = ChatProvider(client=self)\n self.account: AccountProvider = AccountProvider(client=self)\n\n if token:\n self.set_token(token)\n\n def __repr__(self):\n return f\"<{self.__class__.__name__}>\"\n\n # Authentication\n def set_token(self, token: Optional[str] = None) -> None:\n \"\"\"\n Authenticates the client with the passed .ROBLOSECURITY token.\n This method does not send any requests and will not throw if the token is invalid.\n\n Arguments:\n token: A .ROBLOSECURITY token to authenticate the client with.\n\n \"\"\"\n self._requests.session.cookies[\".ROBLOSECURITY\"] = token\n\n # Users\n async def get_user(self, user_id: int) -> User:\n \"\"\"\n Gets a user with the specified user ID.\n\n Arguments:\n user_id: A Roblox user ID.\n\n Returns:\n A user object.\n \"\"\"\n try:\n user_response = await self._requests.get(\n url=self.url_generator.get_url(\"users\", f\"v1/users/{user_id}\")\n )\n except NotFound as exception:\n raise UserNotFound(\n message=\"Invalid user.\",\n response=exception.response\n ) from None\n user_data = user_response.json()\n return User(client=self, data=user_data)\n\n async def get_authenticated_user(\n self, expand: bool = True\n ) -> Union[User, PartialUser]:\n \"\"\"\n Grabs the authenticated user.\n\n Arguments:\n expand: Whether to return a User (2 requests) rather than a PartialUser (1 request)\n\n Returns:\n The authenticated user.\n \"\"\"\n authenticated_user_response = await self._requests.get(\n url=self._url_generator.get_url(\"users\", f\"v1/users/authenticated\")\n )\n authenticated_user_data = authenticated_user_response.json()\n\n if expand:\n return await self.get_user(authenticated_user_data[\"id\"])\n else:\n return PartialUser(client=self, data=authenticated_user_data)\n\n async def get_users(\n self,\n user_ids: List[int],\n exclude_banned_users: bool = False,\n expand: bool = False,\n ) -> Union[List[PartialUser], List[User]]:\n \"\"\"\n Grabs a list of users corresponding to each user ID in the list.\n\n Arguments:\n user_ids: A list of Roblox user IDs.\n exclude_banned_users: Whether to exclude banned users from the data.\n expand: Whether to return a list of Users (2 requests) rather than PartialUsers (1 request)\n\n Returns:\n A List of Users or partial users.\n \"\"\"\n users_response = await self._requests.post(\n url=self._url_generator.get_url(\"users\", f\"v1/users\"),\n json={\"userIds\": user_ids, \"excludeBannedUsers\": exclude_banned_users},\n )\n users_data = users_response.json()[\"data\"]\n\n if expand:\n return [await self.get_user(user_data[\"id\"]) for user_data in users_data]\n else:\n return [\n PartialUser(client=self, data=user_data)\n for user_data in users_data\n ]\n\n async def get_users_by_usernames(\n self,\n usernames: List[str],\n exclude_banned_users: bool = False,\n expand: bool = False,\n ) -> Union[List[RequestedUsernamePartialUser], List[User]]:\n \"\"\"\n Grabs a list of users corresponding to each username in the list.\n\n Arguments:\n usernames: A list of Roblox usernames.\n exclude_banned_users: Whether to exclude banned users from the data.\n expand: Whether to return a list of Users (2 requests) rather than RequestedUsernamePartialUsers (1 request)\n\n Returns:\n A list of User or RequestedUsernamePartialUser, depending on the expand argument.\n \"\"\"\n users_response = await self._requests.post(\n url=self._url_generator.get_url(\"users\", f\"v1/usernames/users\"),\n json={\"usernames\": usernames, \"excludeBannedUsers\": exclude_banned_users},\n )\n users_data = users_response.json()[\"data\"]\n\n if expand:\n return [await self.get_user(user_data[\"id\"]) for user_data in users_data]\n else:\n return [\n RequestedUsernamePartialUser(client=self, data=user_data)\n for user_data in users_data\n ]\n\n async def get_user_by_username(\n self, username: str, exclude_banned_users: bool = False, expand: bool = True\n ) -> Union[RequestedUsernamePartialUser, User]:\n \"\"\"\n Grabs a user corresponding to the passed username.\n\n Arguments:\n username: A Roblox username.\n exclude_banned_users: Whether to exclude banned users from the data.\n expand: Whether to return a User (2 requests) rather than a RequestedUsernamePartialUser (1 request)\n\n Returns:\n A User or RequestedUsernamePartialUser depending on the expand argument.\n \"\"\"\n users = await self.get_users_by_usernames(\n usernames=[username],\n exclude_banned_users=exclude_banned_users,\n expand=expand,\n )\n try:\n return users[0]\n except IndexError:\n raise UserNotFound(\"Invalid username.\") from None\n\n def get_base_user(self, user_id: int) -> BaseUser:\n \"\"\"\n Gets a base user.\n\n !!! note\n This method does not send any requests - it just generates an object.\n For more information on bases, please see [Bases](../tutorials/bases.md).\n\n Arguments:\n user_id: A Roblox user ID.\n\n Returns:\n A BaseUser.\n \"\"\"\n return BaseUser(client=self, user_id=user_id)\n\n def user_search(self, keyword: str, page_size: int = 10,\n max_items: int = None) -> PageIterator:\n \"\"\"\n Search for users with a keyword.\n\n Arguments:\n keyword: A keyword to search for.\n page_size: How many members should be returned for each page.\n max_items: The maximum items to return when looping through this object.\n\n Returns:\n A PageIterator containing RequestedUsernamePartialUser.\n \"\"\"\n return PageIterator(\n client=self,\n url=self._url_generator.get_url(\"users\", f\"v1/users/search\"),\n page_size=page_size,\n max_items=max_items,\n extra_parameters={\"keyword\": keyword},\n handler=lambda client, data: PreviousUsernamesPartialUser(client=client, data=data),\n )\n\n # Groups\n async def get_group(self, group_id: int) -> Group:\n \"\"\"\n Gets a group by its ID.\n\n Arguments:\n group_id: A Roblox group ID.\n\n Returns:\n A Group.\n \"\"\"\n try:\n group_response = await self._requests.get(\n url=self._url_generator.get_url(\"groups\", f\"v1/groups/{group_id}\")\n )\n except BadRequest as exception:\n raise GroupNotFound(\n message=\"Invalid group.\",\n response=exception.response\n ) from None\n group_data = group_response.json()\n return Group(client=self, data=group_data)\n\n def get_base_group(self, group_id: int) -> BaseGroup:\n \"\"\"\n Gets a base group.\n\n !!! note\n This method does not send any requests - it just generates an object.\n For more information on bases, please see [Bases](../tutorials/bases.md).\n\n Arguments:\n group_id: A Roblox group ID.\n\n Returns:\n A BaseGroup.\n \"\"\"\n return BaseGroup(client=self, group_id=group_id)\n\n # Universes\n async def get_universes(self, universe_ids: List[int]) -> List[Universe]:\n \"\"\"\n Grabs a list of universes corresponding to each ID in the list.\n\n Arguments:\n universe_ids: A list of Roblox universe IDs.\n\n Returns:\n A list of Universes.\n \"\"\"\n universes_response = await self._requests.get(\n url=self._url_generator.get_url(\"games\", \"v1/games\"),\n params={\"universeIds\": universe_ids},\n )\n universes_data = universes_response.json()[\"data\"]\n return [\n Universe(client=self, data=universe_data)\n for universe_data in universes_data\n ]\n\n async def get_universe(self, universe_id: int) -> Universe:\n \"\"\"\n Gets a universe with the passed ID.\n\n Arguments:\n universe_id: A Roblox universe ID.\n\n Returns:\n A Universe.\n \"\"\"\n universes = await self.get_universes(universe_ids=[universe_id])\n try:\n return universes[0]\n except IndexError:\n raise UniverseNotFound(\"Invalid universe.\") from None\n\n def get_base_universe(self, universe_id: int) -> BaseUniverse:\n \"\"\"\n Gets a base universe.\n\n !!! note\n This method does not send any requests - it just generates an object.\n For more information on bases, please see [Bases](../tutorials/bases.md).\n\n Arguments:\n universe_id: A Roblox universe ID.\n\n Returns:\n A BaseUniverse.\n \"\"\"\n return BaseUniverse(client=self, universe_id=universe_id)\n\n # Places\n async def get_places(self, place_ids: List[int]) -> List[Place]:\n \"\"\"\n Grabs a list of places corresponding to each ID in the list.\n\n Arguments:\n place_ids: A list of Roblox place IDs.\n\n Returns:\n A list of Places.\n \"\"\"\n places_response = await self._requests.get(\n url=self._url_generator.get_url(\n \"games\", f\"v1/games/multiget-place-details\"\n ),\n params={\"placeIds\": place_ids},\n )\n places_data = places_response.json()\n return [\n Place(client=self, data=place_data) for place_data in places_data\n ]\n\n async def get_place(self, place_id: int) -> Place:\n \"\"\"\n Gets a place with the passed ID.\n\n Arguments:\n place_id: A Roblox place ID.\n\n Returns:\n A Place.\n \"\"\"\n places = await self.get_places(place_ids=[place_id])\n try:\n return places[0]\n except IndexError:\n raise PlaceNotFound(\"Invalid place.\") from None\n\n def get_base_place(self, place_id: int) -> BasePlace:\n \"\"\"\n Gets a base place.\n\n !!! note\n This method does not send any requests - it just generates an object.\n For more information on bases, please see [Bases](../tutorials/bases.md).\n\n Arguments:\n place_id: A Roblox place ID.\n\n Returns:\n A BasePlace.\n \"\"\"\n return BasePlace(client=self, place_id=place_id)\n\n # Assets\n async def get_asset(self, asset_id: int) -> EconomyAsset:\n \"\"\"\n Gets an asset with the passed ID.\n\n Arguments:\n asset_id: A Roblox asset ID.\n\n Returns:\n An Asset.\n \"\"\"\n try:\n asset_response = await self._requests.get(\n url=self._url_generator.get_url(\n \"economy\", f\"v2/assets/{asset_id}/details\"\n )\n )\n except BadRequest as exception:\n raise AssetNotFound(\n message=\"Invalid asset.\",\n response=exception.response\n ) from None\n asset_data = asset_response.json()\n return EconomyAsset(client=self, data=asset_data)\n\n def get_base_asset(self, asset_id: int) -> BaseAsset:\n \"\"\"\n Gets a base asset.\n\n !!! note\n This method does not send any requests - it just generates an object.\n For more information on bases, please see [Bases](../tutorials/bases.md).\n\n Arguments:\n asset_id: A Roblox asset ID.\n\n Returns:\n A BaseAsset.\n \"\"\"\n return BaseAsset(client=self, asset_id=asset_id)\n\n # Plugins\n async def get_plugins(self, plugin_ids: List[int]) -> List[Plugin]:\n \"\"\"\n Grabs a list of plugins corresponding to each ID in the list.\n\n Arguments:\n plugin_ids: A list of Roblox plugin IDs.\n\n Returns:\n A list of Plugins.\n \"\"\"\n plugins_response = await self._requests.get(\n url=self._url_generator.get_url(\n \"develop\", \"v1/plugins\"\n ),\n params={\n \"pluginIds\": plugin_ids\n }\n )\n plugins_data = plugins_response.json()[\"data\"]\n return [Plugin(client=self, data=plugin_data) for plugin_data in plugins_data]\n\n async def get_plugin(self, plugin_id: int) -> Plugin:\n \"\"\"\n Grabs a plugin with the passed ID.\n\n Arguments:\n plugin_id: A Roblox plugin ID.\n\n Returns:\n A Plugin.\n \"\"\"\n plugins = await self.get_plugins([plugin_id])\n try:\n return plugins[0]\n except IndexError:\n raise PluginNotFound(\"Invalid plugin.\") from None\n\n def get_base_plugin(self, plugin_id: int) -> BasePlugin:\n \"\"\"\n Gets a base plugin.\n\n !!! note\n This method does not send any requests - it just generates an object.\n For more information on bases, please see [Bases](../tutorials/bases.md).\n\n Arguments:\n plugin_id: A Roblox plugin ID.\n\n Returns:\n A BasePlugin.\n \"\"\"\n return BasePlugin(client=self, plugin_id=plugin_id)\n\n # Badges\n async def get_badge(self, badge_id: int) -> Badge:\n \"\"\"\n Gets a badge with the passed ID.\n\n Arguments:\n badge_id: A Roblox badge ID.\n\n Returns:\n A Badge.\n \"\"\"\n try:\n badge_response = await self._requests.get(\n url=self._url_generator.get_url(\n \"badges\", f\"v1/badges/{badge_id}\"\n )\n )\n except NotFound as exception:\n raise BadgeNotFound(\n message=\"Invalid badge.\",\n response=exception.response\n ) from None\n badge_data = badge_response.json()\n return Badge(client=self, data=badge_data)\n\n def get_base_badge(self, badge_id: int) -> BaseBadge:\n \"\"\"\n Gets a base badge.\n\n !!! note\n This method does not send any requests - it just generates an object.\n For more information on bases, please see [Bases](../tutorials/bases.md).\n\n Arguments:\n badge_id: A Roblox badge ID.\n\n Returns:\n A BaseBadge.\n \"\"\"\n return BaseBadge(client=self, badge_id=badge_id)\n\n # Gamepasses\n def get_base_gamepass(self, gamepass_id: int) -> BaseGamePass:\n \"\"\"\n Gets a base gamepass.\n\n !!! note\n This method does not send any requests - it just generates an object.\n For more information on bases, please see [Bases](../tutorials/bases.md).\n\n Arguments:\n gamepass_id: A Roblox gamepass ID.\n\n Returns: A BaseGamePass.\n \"\"\"\n return BaseGamePass(client=self, gamepass_id=gamepass_id)\n
"},{"location":"reference/client/#roblox.client.Client.__init__","title":"__init__(token=None, base_url='roblox.com')
","text":"Parameters:
Name Type Description Defaulttoken
str
A .ROBLOSECURITY token to authenticate the client with.
None
base_url
str
The base URL to use when sending requests.
'roblox.com'
Source code in roblox/client.py
def __init__(self, token: str = None, base_url: str = \"roblox.com\"):\n \"\"\"\n Arguments:\n token: A .ROBLOSECURITY token to authenticate the client with.\n base_url: The base URL to use when sending requests.\n \"\"\"\n self._url_generator: URLGenerator = URLGenerator(base_url=base_url)\n self._requests: Requests = Requests()\n\n self.url_generator: URLGenerator = self._url_generator\n self.requests: Requests = self._requests\n\n self.presence: PresenceProvider = PresenceProvider(client=self)\n self.thumbnails: ThumbnailProvider = ThumbnailProvider(client=self)\n self.delivery: DeliveryProvider = DeliveryProvider(client=self)\n self.chat: ChatProvider = ChatProvider(client=self)\n self.account: AccountProvider = AccountProvider(client=self)\n\n if token:\n self.set_token(token)\n
"},{"location":"reference/client/#roblox.client.Client.get_asset","title":"get_asset(asset_id)
async
","text":"Gets an asset with the passed ID.
Parameters:
Name Type Description Defaultasset_id
int
A Roblox asset ID.
requiredReturns:
Type DescriptionEconomyAsset
An Asset.
Source code inroblox/client.py
async def get_asset(self, asset_id: int) -> EconomyAsset:\n \"\"\"\n Gets an asset with the passed ID.\n\n Arguments:\n asset_id: A Roblox asset ID.\n\n Returns:\n An Asset.\n \"\"\"\n try:\n asset_response = await self._requests.get(\n url=self._url_generator.get_url(\n \"economy\", f\"v2/assets/{asset_id}/details\"\n )\n )\n except BadRequest as exception:\n raise AssetNotFound(\n message=\"Invalid asset.\",\n response=exception.response\n ) from None\n asset_data = asset_response.json()\n return EconomyAsset(client=self, data=asset_data)\n
"},{"location":"reference/client/#roblox.client.Client.get_authenticated_user","title":"get_authenticated_user(expand=True)
async
","text":"Grabs the authenticated user.
Parameters:
Name Type Description Defaultexpand
bool
Whether to return a User (2 requests) rather than a PartialUser (1 request)
True
Returns:
Type DescriptionUnion[User, PartialUser]
The authenticated user.
Source code inroblox/client.py
async def get_authenticated_user(\n self, expand: bool = True\n) -> Union[User, PartialUser]:\n \"\"\"\n Grabs the authenticated user.\n\n Arguments:\n expand: Whether to return a User (2 requests) rather than a PartialUser (1 request)\n\n Returns:\n The authenticated user.\n \"\"\"\n authenticated_user_response = await self._requests.get(\n url=self._url_generator.get_url(\"users\", f\"v1/users/authenticated\")\n )\n authenticated_user_data = authenticated_user_response.json()\n\n if expand:\n return await self.get_user(authenticated_user_data[\"id\"])\n else:\n return PartialUser(client=self, data=authenticated_user_data)\n
"},{"location":"reference/client/#roblox.client.Client.get_badge","title":"get_badge(badge_id)
async
","text":"Gets a badge with the passed ID.
Parameters:
Name Type Description Defaultbadge_id
int
A Roblox badge ID.
requiredReturns:
Type DescriptionBadge
A Badge.
Source code inroblox/client.py
async def get_badge(self, badge_id: int) -> Badge:\n \"\"\"\n Gets a badge with the passed ID.\n\n Arguments:\n badge_id: A Roblox badge ID.\n\n Returns:\n A Badge.\n \"\"\"\n try:\n badge_response = await self._requests.get(\n url=self._url_generator.get_url(\n \"badges\", f\"v1/badges/{badge_id}\"\n )\n )\n except NotFound as exception:\n raise BadgeNotFound(\n message=\"Invalid badge.\",\n response=exception.response\n ) from None\n badge_data = badge_response.json()\n return Badge(client=self, data=badge_data)\n
"},{"location":"reference/client/#roblox.client.Client.get_base_asset","title":"get_base_asset(asset_id)
","text":"Gets a base asset.
Note
This method does not send any requests - it just generates an object. For more information on bases, please see Bases.
Parameters:
Name Type Description Defaultasset_id
int
A Roblox asset ID.
requiredReturns:
Type DescriptionBaseAsset
A BaseAsset.
Source code inroblox/client.py
def get_base_asset(self, asset_id: int) -> BaseAsset:\n \"\"\"\n Gets a base asset.\n\n !!! note\n This method does not send any requests - it just generates an object.\n For more information on bases, please see [Bases](../tutorials/bases.md).\n\n Arguments:\n asset_id: A Roblox asset ID.\n\n Returns:\n A BaseAsset.\n \"\"\"\n return BaseAsset(client=self, asset_id=asset_id)\n
"},{"location":"reference/client/#roblox.client.Client.get_base_badge","title":"get_base_badge(badge_id)
","text":"Gets a base badge.
Note
This method does not send any requests - it just generates an object. For more information on bases, please see Bases.
Parameters:
Name Type Description Defaultbadge_id
int
A Roblox badge ID.
requiredReturns:
Type DescriptionBaseBadge
A BaseBadge.
Source code inroblox/client.py
def get_base_badge(self, badge_id: int) -> BaseBadge:\n \"\"\"\n Gets a base badge.\n\n !!! note\n This method does not send any requests - it just generates an object.\n For more information on bases, please see [Bases](../tutorials/bases.md).\n\n Arguments:\n badge_id: A Roblox badge ID.\n\n Returns:\n A BaseBadge.\n \"\"\"\n return BaseBadge(client=self, badge_id=badge_id)\n
"},{"location":"reference/client/#roblox.client.Client.get_base_gamepass","title":"get_base_gamepass(gamepass_id)
","text":"Gets a base gamepass.
Note
This method does not send any requests - it just generates an object. For more information on bases, please see Bases.
Parameters:
Name Type Description Defaultgamepass_id
int
A Roblox gamepass ID.
required Source code inroblox/client.py
def get_base_gamepass(self, gamepass_id: int) -> BaseGamePass:\n \"\"\"\n Gets a base gamepass.\n\n !!! note\n This method does not send any requests - it just generates an object.\n For more information on bases, please see [Bases](../tutorials/bases.md).\n\n Arguments:\n gamepass_id: A Roblox gamepass ID.\n\n Returns: A BaseGamePass.\n \"\"\"\n return BaseGamePass(client=self, gamepass_id=gamepass_id)\n
"},{"location":"reference/client/#roblox.client.Client.get_base_group","title":"get_base_group(group_id)
","text":"Gets a base group.
Note
This method does not send any requests - it just generates an object. For more information on bases, please see Bases.
Parameters:
Name Type Description Defaultgroup_id
int
A Roblox group ID.
requiredReturns:
Type DescriptionBaseGroup
A BaseGroup.
Source code inroblox/client.py
def get_base_group(self, group_id: int) -> BaseGroup:\n \"\"\"\n Gets a base group.\n\n !!! note\n This method does not send any requests - it just generates an object.\n For more information on bases, please see [Bases](../tutorials/bases.md).\n\n Arguments:\n group_id: A Roblox group ID.\n\n Returns:\n A BaseGroup.\n \"\"\"\n return BaseGroup(client=self, group_id=group_id)\n
"},{"location":"reference/client/#roblox.client.Client.get_base_place","title":"get_base_place(place_id)
","text":"Gets a base place.
Note
This method does not send any requests - it just generates an object. For more information on bases, please see Bases.
Parameters:
Name Type Description Defaultplace_id
int
A Roblox place ID.
requiredReturns:
Type DescriptionBasePlace
A BasePlace.
Source code inroblox/client.py
def get_base_place(self, place_id: int) -> BasePlace:\n \"\"\"\n Gets a base place.\n\n !!! note\n This method does not send any requests - it just generates an object.\n For more information on bases, please see [Bases](../tutorials/bases.md).\n\n Arguments:\n place_id: A Roblox place ID.\n\n Returns:\n A BasePlace.\n \"\"\"\n return BasePlace(client=self, place_id=place_id)\n
"},{"location":"reference/client/#roblox.client.Client.get_base_plugin","title":"get_base_plugin(plugin_id)
","text":"Gets a base plugin.
Note
This method does not send any requests - it just generates an object. For more information on bases, please see Bases.
Parameters:
Name Type Description Defaultplugin_id
int
A Roblox plugin ID.
requiredReturns:
Type DescriptionBasePlugin
A BasePlugin.
Source code inroblox/client.py
def get_base_plugin(self, plugin_id: int) -> BasePlugin:\n \"\"\"\n Gets a base plugin.\n\n !!! note\n This method does not send any requests - it just generates an object.\n For more information on bases, please see [Bases](../tutorials/bases.md).\n\n Arguments:\n plugin_id: A Roblox plugin ID.\n\n Returns:\n A BasePlugin.\n \"\"\"\n return BasePlugin(client=self, plugin_id=plugin_id)\n
"},{"location":"reference/client/#roblox.client.Client.get_base_universe","title":"get_base_universe(universe_id)
","text":"Gets a base universe.
Note
This method does not send any requests - it just generates an object. For more information on bases, please see Bases.
Parameters:
Name Type Description Defaultuniverse_id
int
A Roblox universe ID.
requiredReturns:
Type DescriptionBaseUniverse
A BaseUniverse.
Source code inroblox/client.py
def get_base_universe(self, universe_id: int) -> BaseUniverse:\n \"\"\"\n Gets a base universe.\n\n !!! note\n This method does not send any requests - it just generates an object.\n For more information on bases, please see [Bases](../tutorials/bases.md).\n\n Arguments:\n universe_id: A Roblox universe ID.\n\n Returns:\n A BaseUniverse.\n \"\"\"\n return BaseUniverse(client=self, universe_id=universe_id)\n
"},{"location":"reference/client/#roblox.client.Client.get_base_user","title":"get_base_user(user_id)
","text":"Gets a base user.
Note
This method does not send any requests - it just generates an object. For more information on bases, please see Bases.
Parameters:
Name Type Description Defaultuser_id
int
A Roblox user ID.
requiredReturns:
Type DescriptionBaseUser
A BaseUser.
Source code inroblox/client.py
def get_base_user(self, user_id: int) -> BaseUser:\n \"\"\"\n Gets a base user.\n\n !!! note\n This method does not send any requests - it just generates an object.\n For more information on bases, please see [Bases](../tutorials/bases.md).\n\n Arguments:\n user_id: A Roblox user ID.\n\n Returns:\n A BaseUser.\n \"\"\"\n return BaseUser(client=self, user_id=user_id)\n
"},{"location":"reference/client/#roblox.client.Client.get_group","title":"get_group(group_id)
async
","text":"Gets a group by its ID.
Parameters:
Name Type Description Defaultgroup_id
int
A Roblox group ID.
requiredReturns:
Type DescriptionGroup
A Group.
Source code inroblox/client.py
async def get_group(self, group_id: int) -> Group:\n \"\"\"\n Gets a group by its ID.\n\n Arguments:\n group_id: A Roblox group ID.\n\n Returns:\n A Group.\n \"\"\"\n try:\n group_response = await self._requests.get(\n url=self._url_generator.get_url(\"groups\", f\"v1/groups/{group_id}\")\n )\n except BadRequest as exception:\n raise GroupNotFound(\n message=\"Invalid group.\",\n response=exception.response\n ) from None\n group_data = group_response.json()\n return Group(client=self, data=group_data)\n
"},{"location":"reference/client/#roblox.client.Client.get_place","title":"get_place(place_id)
async
","text":"Gets a place with the passed ID.
Parameters:
Name Type Description Defaultplace_id
int
A Roblox place ID.
requiredReturns:
Type DescriptionPlace
A Place.
Source code inroblox/client.py
async def get_place(self, place_id: int) -> Place:\n \"\"\"\n Gets a place with the passed ID.\n\n Arguments:\n place_id: A Roblox place ID.\n\n Returns:\n A Place.\n \"\"\"\n places = await self.get_places(place_ids=[place_id])\n try:\n return places[0]\n except IndexError:\n raise PlaceNotFound(\"Invalid place.\") from None\n
"},{"location":"reference/client/#roblox.client.Client.get_places","title":"get_places(place_ids)
async
","text":"Grabs a list of places corresponding to each ID in the list.
Parameters:
Name Type Description Defaultplace_ids
List[int]
A list of Roblox place IDs.
requiredReturns:
Type DescriptionList[Place]
A list of Places.
Source code inroblox/client.py
async def get_places(self, place_ids: List[int]) -> List[Place]:\n \"\"\"\n Grabs a list of places corresponding to each ID in the list.\n\n Arguments:\n place_ids: A list of Roblox place IDs.\n\n Returns:\n A list of Places.\n \"\"\"\n places_response = await self._requests.get(\n url=self._url_generator.get_url(\n \"games\", f\"v1/games/multiget-place-details\"\n ),\n params={\"placeIds\": place_ids},\n )\n places_data = places_response.json()\n return [\n Place(client=self, data=place_data) for place_data in places_data\n ]\n
"},{"location":"reference/client/#roblox.client.Client.get_plugin","title":"get_plugin(plugin_id)
async
","text":"Grabs a plugin with the passed ID.
Parameters:
Name Type Description Defaultplugin_id
int
A Roblox plugin ID.
requiredReturns:
Type DescriptionPlugin
A Plugin.
Source code inroblox/client.py
async def get_plugin(self, plugin_id: int) -> Plugin:\n \"\"\"\n Grabs a plugin with the passed ID.\n\n Arguments:\n plugin_id: A Roblox plugin ID.\n\n Returns:\n A Plugin.\n \"\"\"\n plugins = await self.get_plugins([plugin_id])\n try:\n return plugins[0]\n except IndexError:\n raise PluginNotFound(\"Invalid plugin.\") from None\n
"},{"location":"reference/client/#roblox.client.Client.get_plugins","title":"get_plugins(plugin_ids)
async
","text":"Grabs a list of plugins corresponding to each ID in the list.
Parameters:
Name Type Description Defaultplugin_ids
List[int]
A list of Roblox plugin IDs.
requiredReturns:
Type DescriptionList[Plugin]
A list of Plugins.
Source code inroblox/client.py
async def get_plugins(self, plugin_ids: List[int]) -> List[Plugin]:\n \"\"\"\n Grabs a list of plugins corresponding to each ID in the list.\n\n Arguments:\n plugin_ids: A list of Roblox plugin IDs.\n\n Returns:\n A list of Plugins.\n \"\"\"\n plugins_response = await self._requests.get(\n url=self._url_generator.get_url(\n \"develop\", \"v1/plugins\"\n ),\n params={\n \"pluginIds\": plugin_ids\n }\n )\n plugins_data = plugins_response.json()[\"data\"]\n return [Plugin(client=self, data=plugin_data) for plugin_data in plugins_data]\n
"},{"location":"reference/client/#roblox.client.Client.get_universe","title":"get_universe(universe_id)
async
","text":"Gets a universe with the passed ID.
Parameters:
Name Type Description Defaultuniverse_id
int
A Roblox universe ID.
requiredReturns:
Type DescriptionUniverse
A Universe.
Source code inroblox/client.py
async def get_universe(self, universe_id: int) -> Universe:\n \"\"\"\n Gets a universe with the passed ID.\n\n Arguments:\n universe_id: A Roblox universe ID.\n\n Returns:\n A Universe.\n \"\"\"\n universes = await self.get_universes(universe_ids=[universe_id])\n try:\n return universes[0]\n except IndexError:\n raise UniverseNotFound(\"Invalid universe.\") from None\n
"},{"location":"reference/client/#roblox.client.Client.get_universes","title":"get_universes(universe_ids)
async
","text":"Grabs a list of universes corresponding to each ID in the list.
Parameters:
Name Type Description Defaultuniverse_ids
List[int]
A list of Roblox universe IDs.
requiredReturns:
Type DescriptionList[Universe]
A list of Universes.
Source code inroblox/client.py
async def get_universes(self, universe_ids: List[int]) -> List[Universe]:\n \"\"\"\n Grabs a list of universes corresponding to each ID in the list.\n\n Arguments:\n universe_ids: A list of Roblox universe IDs.\n\n Returns:\n A list of Universes.\n \"\"\"\n universes_response = await self._requests.get(\n url=self._url_generator.get_url(\"games\", \"v1/games\"),\n params={\"universeIds\": universe_ids},\n )\n universes_data = universes_response.json()[\"data\"]\n return [\n Universe(client=self, data=universe_data)\n for universe_data in universes_data\n ]\n
"},{"location":"reference/client/#roblox.client.Client.get_user","title":"get_user(user_id)
async
","text":"Gets a user with the specified user ID.
Parameters:
Name Type Description Defaultuser_id
int
A Roblox user ID.
requiredReturns:
Type DescriptionUser
A user object.
Source code inroblox/client.py
async def get_user(self, user_id: int) -> User:\n \"\"\"\n Gets a user with the specified user ID.\n\n Arguments:\n user_id: A Roblox user ID.\n\n Returns:\n A user object.\n \"\"\"\n try:\n user_response = await self._requests.get(\n url=self.url_generator.get_url(\"users\", f\"v1/users/{user_id}\")\n )\n except NotFound as exception:\n raise UserNotFound(\n message=\"Invalid user.\",\n response=exception.response\n ) from None\n user_data = user_response.json()\n return User(client=self, data=user_data)\n
"},{"location":"reference/client/#roblox.client.Client.get_user_by_username","title":"get_user_by_username(username, exclude_banned_users=False, expand=True)
async
","text":"Grabs a user corresponding to the passed username.
Parameters:
Name Type Description Defaultusername
str
A Roblox username.
requiredexclude_banned_users
bool
Whether to exclude banned users from the data.
False
expand
bool
Whether to return a User (2 requests) rather than a RequestedUsernamePartialUser (1 request)
True
Returns:
Type DescriptionUnion[RequestedUsernamePartialUser, User]
A User or RequestedUsernamePartialUser depending on the expand argument.
Source code inroblox/client.py
async def get_user_by_username(\n self, username: str, exclude_banned_users: bool = False, expand: bool = True\n) -> Union[RequestedUsernamePartialUser, User]:\n \"\"\"\n Grabs a user corresponding to the passed username.\n\n Arguments:\n username: A Roblox username.\n exclude_banned_users: Whether to exclude banned users from the data.\n expand: Whether to return a User (2 requests) rather than a RequestedUsernamePartialUser (1 request)\n\n Returns:\n A User or RequestedUsernamePartialUser depending on the expand argument.\n \"\"\"\n users = await self.get_users_by_usernames(\n usernames=[username],\n exclude_banned_users=exclude_banned_users,\n expand=expand,\n )\n try:\n return users[0]\n except IndexError:\n raise UserNotFound(\"Invalid username.\") from None\n
"},{"location":"reference/client/#roblox.client.Client.get_users","title":"get_users(user_ids, exclude_banned_users=False, expand=False)
async
","text":"Grabs a list of users corresponding to each user ID in the list.
Parameters:
Name Type Description Defaultuser_ids
List[int]
A list of Roblox user IDs.
requiredexclude_banned_users
bool
Whether to exclude banned users from the data.
False
expand
bool
Whether to return a list of Users (2 requests) rather than PartialUsers (1 request)
False
Returns:
Type DescriptionUnion[List[PartialUser], List[User]]
A List of Users or partial users.
Source code inroblox/client.py
async def get_users(\n self,\n user_ids: List[int],\n exclude_banned_users: bool = False,\n expand: bool = False,\n) -> Union[List[PartialUser], List[User]]:\n \"\"\"\n Grabs a list of users corresponding to each user ID in the list.\n\n Arguments:\n user_ids: A list of Roblox user IDs.\n exclude_banned_users: Whether to exclude banned users from the data.\n expand: Whether to return a list of Users (2 requests) rather than PartialUsers (1 request)\n\n Returns:\n A List of Users or partial users.\n \"\"\"\n users_response = await self._requests.post(\n url=self._url_generator.get_url(\"users\", f\"v1/users\"),\n json={\"userIds\": user_ids, \"excludeBannedUsers\": exclude_banned_users},\n )\n users_data = users_response.json()[\"data\"]\n\n if expand:\n return [await self.get_user(user_data[\"id\"]) for user_data in users_data]\n else:\n return [\n PartialUser(client=self, data=user_data)\n for user_data in users_data\n ]\n
"},{"location":"reference/client/#roblox.client.Client.get_users_by_usernames","title":"get_users_by_usernames(usernames, exclude_banned_users=False, expand=False)
async
","text":"Grabs a list of users corresponding to each username in the list.
Parameters:
Name Type Description Defaultusernames
List[str]
A list of Roblox usernames.
requiredexclude_banned_users
bool
Whether to exclude banned users from the data.
False
expand
bool
Whether to return a list of Users (2 requests) rather than RequestedUsernamePartialUsers (1 request)
False
Returns:
Type DescriptionUnion[List[RequestedUsernamePartialUser], List[User]]
A list of User or RequestedUsernamePartialUser, depending on the expand argument.
Source code inroblox/client.py
async def get_users_by_usernames(\n self,\n usernames: List[str],\n exclude_banned_users: bool = False,\n expand: bool = False,\n) -> Union[List[RequestedUsernamePartialUser], List[User]]:\n \"\"\"\n Grabs a list of users corresponding to each username in the list.\n\n Arguments:\n usernames: A list of Roblox usernames.\n exclude_banned_users: Whether to exclude banned users from the data.\n expand: Whether to return a list of Users (2 requests) rather than RequestedUsernamePartialUsers (1 request)\n\n Returns:\n A list of User or RequestedUsernamePartialUser, depending on the expand argument.\n \"\"\"\n users_response = await self._requests.post(\n url=self._url_generator.get_url(\"users\", f\"v1/usernames/users\"),\n json={\"usernames\": usernames, \"excludeBannedUsers\": exclude_banned_users},\n )\n users_data = users_response.json()[\"data\"]\n\n if expand:\n return [await self.get_user(user_data[\"id\"]) for user_data in users_data]\n else:\n return [\n RequestedUsernamePartialUser(client=self, data=user_data)\n for user_data in users_data\n ]\n
"},{"location":"reference/client/#roblox.client.Client.set_token","title":"set_token(token=None)
","text":"Authenticates the client with the passed .ROBLOSECURITY token. This method does not send any requests and will not throw if the token is invalid.
Parameters:
Name Type Description Defaulttoken
Optional[str]
A .ROBLOSECURITY token to authenticate the client with.
None
Source code in roblox/client.py
def set_token(self, token: Optional[str] = None) -> None:\n \"\"\"\n Authenticates the client with the passed .ROBLOSECURITY token.\n This method does not send any requests and will not throw if the token is invalid.\n\n Arguments:\n token: A .ROBLOSECURITY token to authenticate the client with.\n\n \"\"\"\n self._requests.session.cookies[\".ROBLOSECURITY\"] = token\n
"},{"location":"reference/client/#roblox.client.Client.user_search","title":"user_search(keyword, page_size=10, max_items=None)
","text":"Search for users with a keyword.
Parameters:
Name Type Description Defaultkeyword
str
A keyword to search for.
requiredpage_size
int
How many members should be returned for each page.
10
max_items
int
The maximum items to return when looping through this object.
None
Returns:
Type DescriptionPageIterator
A PageIterator containing RequestedUsernamePartialUser.
Source code inroblox/client.py
def user_search(self, keyword: str, page_size: int = 10,\n max_items: int = None) -> PageIterator:\n \"\"\"\n Search for users with a keyword.\n\n Arguments:\n keyword: A keyword to search for.\n page_size: How many members should be returned for each page.\n max_items: The maximum items to return when looping through this object.\n\n Returns:\n A PageIterator containing RequestedUsernamePartialUser.\n \"\"\"\n return PageIterator(\n client=self,\n url=self._url_generator.get_url(\"users\", f\"v1/users/search\"),\n page_size=page_size,\n max_items=max_items,\n extra_parameters={\"keyword\": keyword},\n handler=lambda client, data: PreviousUsernamesPartialUser(client=client, data=data),\n )\n
"},{"location":"reference/conversations/","title":"conversations","text":"Contains objects related to Roblox chat conversations.
"},{"location":"reference/conversations/#roblox.conversations.Conversation","title":"Conversation
","text":" Bases: BaseConversation
Represents a Roblox chat conversation.
Attributes:
Name Type Descriptionid
int
Chat conversation ID.
title
str
Chat conversation title.
initiator
PartialUser
Conversation initiator entity.
has_unread_messages
bool
Whether the conversation have any unread messages.
participants
List[PartialUser]
Participants involved in the conversation.
conversation_type
ConversationType
Type of the conversation.
conversation_title
ConversationTitle
Specifies if the conversation title is generated by default.
last_updated
datetime
Specifies the datetime when the conversation was last updated.
conversation_universe
Optional[ChatPartialUniverse]
Specifies the universe associated with the conversation.
Source code inroblox/conversations.py
class Conversation(BaseConversation):\n \"\"\"\n Represents a Roblox chat conversation.\n\n Attributes:\n id: Chat conversation ID.\n title: Chat conversation title.\n initiator: Conversation initiator entity.\n has_unread_messages: Whether the conversation have any unread messages.\n participants: Participants involved in the conversation.\n conversation_type: Type of the conversation.\n conversation_title: Specifies if the conversation title is generated by default.\n last_updated: Specifies the datetime when the conversation was last updated.\n conversation_universe: Specifies the universe associated with the conversation.\n \"\"\"\n\n def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: The Client object.\n data: The conversation data.\n \"\"\"\n super().__init__(client=client, conversation_id=self.id)\n self.id: int = data[\"id\"]\n self.title: str = data[\"title\"]\n\n # Technically the initiator could be a group, but in practice that doesn't happen\n # so this is a partialuser\n # Nikita Petko: Well uhhh, the initiator is of the ChatParticipant model,\n # where it can either be from User or System.\n self.initiator: PartialUser = PartialUser(client, data[\"initiator\"])\n\n self.has_unread_messages: bool = data[\"hasUnreadMessages\"]\n self.participants: List[PartialUser] = [PartialUser(\n client=client,\n data=participant_data\n ) for participant_data in data[\"participants\"]]\n\n self.conversation_type: ConversationType = ConversationType(data[\"conversationType\"])\n self.conversation_title: ConversationTitle = ConversationTitle(\n data=data[\"conversationTitle\"]\n )\n self.last_updated: datetime = parse(data[\"lastUpdated\"])\n self.conversation_universe: Optional[ChatPartialUniverse] = data[\n \"conversationUniverse\"] and ChatPartialUniverse(\n client=client,\n data=data[\"conversationUniverse\"]\n )\n
"},{"location":"reference/conversations/#roblox.conversations.Conversation.__init__","title":"__init__(client, data)
","text":"Parameters:
Name Type Description Defaultclient
Client
The Client object.
requireddata
dict
The conversation data.
required Source code inroblox/conversations.py
def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: The Client object.\n data: The conversation data.\n \"\"\"\n super().__init__(client=client, conversation_id=self.id)\n self.id: int = data[\"id\"]\n self.title: str = data[\"title\"]\n\n # Technically the initiator could be a group, but in practice that doesn't happen\n # so this is a partialuser\n # Nikita Petko: Well uhhh, the initiator is of the ChatParticipant model,\n # where it can either be from User or System.\n self.initiator: PartialUser = PartialUser(client, data[\"initiator\"])\n\n self.has_unread_messages: bool = data[\"hasUnreadMessages\"]\n self.participants: List[PartialUser] = [PartialUser(\n client=client,\n data=participant_data\n ) for participant_data in data[\"participants\"]]\n\n self.conversation_type: ConversationType = ConversationType(data[\"conversationType\"])\n self.conversation_title: ConversationTitle = ConversationTitle(\n data=data[\"conversationTitle\"]\n )\n self.last_updated: datetime = parse(data[\"lastUpdated\"])\n self.conversation_universe: Optional[ChatPartialUniverse] = data[\n \"conversationUniverse\"] and ChatPartialUniverse(\n client=client,\n data=data[\"conversationUniverse\"]\n )\n
"},{"location":"reference/conversations/#roblox.conversations.ConversationTitle","title":"ConversationTitle
","text":"A chat conversation's title.
Attributes:
Name Type Descriptiontitle_for_viewer
str
Specifies the title for the conversation specific to the viewer.
is_default_title
bool
Specifies if the title displayed for the user is generated as a default title or was edited by the user.
Source code inroblox/conversations.py
class ConversationTitle:\n \"\"\"\n A chat conversation's title.\n\n Attributes:\n title_for_viewer: Specifies the title for the conversation specific to the viewer.\n is_default_title: Specifies if the title displayed for the user is generated as a default title or was edited by\n the user.\n \"\"\"\n\n def __init__(self, data: dict):\n \"\"\"\n Arguments:\n data: The raw input data.\n \"\"\"\n self.title_for_viewer: str = data[\"titleForViewer\"]\n self.is_default_title: bool = data[\"isDefaultTitle\"]\n\n def __repr__(self):\n return f\"<{self.__class__.__name__} title_for_viewer={self.title_for_viewer!r} is_default_title={self.is_default_title}>\"\n
"},{"location":"reference/conversations/#roblox.conversations.ConversationTitle.__init__","title":"__init__(data)
","text":"Parameters:
Name Type Description Defaultdata
dict
The raw input data.
required Source code inroblox/conversations.py
def __init__(self, data: dict):\n \"\"\"\n Arguments:\n data: The raw input data.\n \"\"\"\n self.title_for_viewer: str = data[\"titleForViewer\"]\n self.is_default_title: bool = data[\"isDefaultTitle\"]\n
"},{"location":"reference/conversations/#roblox.conversations.ConversationType","title":"ConversationType
","text":" Bases: Enum
A chat conversation's type.
Source code inroblox/conversations.py
class ConversationType(Enum):\n \"\"\"\n A chat conversation's type.\n \"\"\"\n\n multi_user_conversation = \"MultiUserConversation\"\n \"\"\"Represents a chat with multiples users on the website.\"\"\"\n one_to_one_conversation = \"OneToOneConversation\"\n \"\"\"Represents a one-to-one conversation with person A and B.\"\"\"\n cloud_edit_conversation = \"CloudEditConversation\"\n \"\"\"Represents a chat in a team-create session.\"\"\"\n
"},{"location":"reference/conversations/#roblox.conversations.ConversationType.cloud_edit_conversation","title":"cloud_edit_conversation = 'CloudEditConversation'
class-attribute
instance-attribute
","text":"Represents a chat in a team-create session.
"},{"location":"reference/conversations/#roblox.conversations.ConversationType.multi_user_conversation","title":"multi_user_conversation = 'MultiUserConversation'
class-attribute
instance-attribute
","text":"Represents a chat with multiples users on the website.
"},{"location":"reference/conversations/#roblox.conversations.ConversationType.one_to_one_conversation","title":"one_to_one_conversation = 'OneToOneConversation'
class-attribute
instance-attribute
","text":"Represents a one-to-one conversation with person A and B.
"},{"location":"reference/creatortype/","title":"creatortype","text":"Contains client enums. fixme: this should be deprecated!
"},{"location":"reference/creatortype/#roblox.creatortype.CreatorType","title":"CreatorType
","text":" Bases: Enum
Represents the type of creator for objects that can be owned by either a group or a user, like Assets.
Source code inroblox/creatortype.py
class CreatorType(Enum):\n \"\"\"\n Represents the type of creator for objects that can be owned by either a group or a user, like Assets.\n \"\"\"\n\n group = \"Group\"\n \"\"\"The creator is a group.\"\"\"\n user = \"User\"\n \"\"\"The creator is a user.\"\"\"\n
"},{"location":"reference/creatortype/#roblox.creatortype.CreatorType.group","title":"group = 'Group'
class-attribute
instance-attribute
","text":"The creator is a group.
"},{"location":"reference/creatortype/#roblox.creatortype.CreatorType.user","title":"user = 'User'
class-attribute
instance-attribute
","text":"The creator is a user.
"},{"location":"reference/delivery/","title":"delivery","text":"Contains classes and functions related to Roblox asset delivery.
"},{"location":"reference/delivery/#roblox.delivery.BaseCDNHash","title":"BaseCDNHash
","text":"Represents a cdn_hash on a Roblox content delivery network.
Attributes:
Name Type Descriptioncdn_hash
str
The CDN hash as a string.
Source code inroblox/delivery.py
class BaseCDNHash:\n \"\"\"\n Represents a cdn_hash on a Roblox content delivery network.\n\n Attributes:\n cdn_hash: The CDN hash as a string.\n \"\"\"\n\n def __init__(self, client: Client, cdn_hash: str):\n \"\"\"\n Arguments:\n client: The Client object.\n cdn_hash: The CDN hash as a string.\n \"\"\"\n\n self._client: Client = client\n self.cdn_hash: str = cdn_hash\n\n def __repr__(self):\n return f\"<{self.__class__.__name__} cdn_hash={self.cdn_hash}>\"\n\n def get_cdn_number(self) -> int:\n \"\"\"\n Returns the CDN number of this CDN hash.\n\n Returns:\n The computed number of the given cdn_hash\n \"\"\"\n\n return get_cdn_number(self.cdn_hash)\n\n def _get_url(self, prefix: str, site: str = cdn_site) -> str:\n cdn_number: int = self.get_cdn_number()\n return self._client.url_generator.get_url(f\"{prefix}{cdn_number}\", self.cdn_hash, site)\n\n def get_url(self, site: str = cdn_site) -> str:\n \"\"\"\n Gets the cdn_hash's URL. This should be implemented by subclasses.\n\n Arguments:\n site: Represents the URL for what site it should target, be it rbxcdn.com, or roblox.com etc.\n\n Returns:\n The computed URL from the given cdn_hash attribute.\n \"\"\"\n\n raise NotImplementedError\n
"},{"location":"reference/delivery/#roblox.delivery.BaseCDNHash.__init__","title":"__init__(client, cdn_hash)
","text":"Parameters:
Name Type Description Defaultclient
Client
The Client object.
requiredcdn_hash
str
The CDN hash as a string.
required Source code inroblox/delivery.py
def __init__(self, client: Client, cdn_hash: str):\n \"\"\"\n Arguments:\n client: The Client object.\n cdn_hash: The CDN hash as a string.\n \"\"\"\n\n self._client: Client = client\n self.cdn_hash: str = cdn_hash\n
"},{"location":"reference/delivery/#roblox.delivery.BaseCDNHash.get_cdn_number","title":"get_cdn_number()
","text":"Returns the CDN number of this CDN hash.
Returns:
Type Descriptionint
The computed number of the given cdn_hash
Source code inroblox/delivery.py
def get_cdn_number(self) -> int:\n \"\"\"\n Returns the CDN number of this CDN hash.\n\n Returns:\n The computed number of the given cdn_hash\n \"\"\"\n\n return get_cdn_number(self.cdn_hash)\n
"},{"location":"reference/delivery/#roblox.delivery.BaseCDNHash.get_url","title":"get_url(site=cdn_site)
","text":"Gets the cdn_hash's URL. This should be implemented by subclasses.
Parameters:
Name Type Description Defaultsite
str
Represents the URL for what site it should target, be it rbxcdn.com, or roblox.com etc.
cdn_site
Returns:
Type Descriptionstr
The computed URL from the given cdn_hash attribute.
Source code inroblox/delivery.py
def get_url(self, site: str = cdn_site) -> str:\n \"\"\"\n Gets the cdn_hash's URL. This should be implemented by subclasses.\n\n Arguments:\n site: Represents the URL for what site it should target, be it rbxcdn.com, or roblox.com etc.\n\n Returns:\n The computed URL from the given cdn_hash attribute.\n \"\"\"\n\n raise NotImplementedError\n
"},{"location":"reference/delivery/#roblox.delivery.ContentCDNHash","title":"ContentCDNHash
","text":" Bases: BaseCDNHash
Represents a CDN hash on cX.rbxcdn.com.
Source code inroblox/delivery.py
class ContentCDNHash(BaseCDNHash):\n \"\"\"\n Represents a CDN hash on cX.rbxcdn.com.\n \"\"\"\n\n def __init__(self, client: Client, cdn_hash: str):\n super().__init__(client=client, cdn_hash=cdn_hash)\n\n def get_url(self, site: str = cdn_site) -> str:\n \"\"\"\n Returns:\n This hash's URL.\n \"\"\"\n\n return self._get_url(\"c\", cdn_site)\n
"},{"location":"reference/delivery/#roblox.delivery.ContentCDNHash.get_url","title":"get_url(site=cdn_site)
","text":"Returns:
Type Descriptionstr
This hash's URL.
Source code inroblox/delivery.py
def get_url(self, site: str = cdn_site) -> str:\n \"\"\"\n Returns:\n This hash's URL.\n \"\"\"\n\n return self._get_url(\"c\", cdn_site)\n
"},{"location":"reference/delivery/#roblox.delivery.DeliveryProvider","title":"DeliveryProvider
","text":"Provides CDN hashes and other delivery-related objects.
Source code inroblox/delivery.py
class DeliveryProvider:\n \"\"\"\n Provides CDN hashes and other delivery-related objects.\n \"\"\"\n\n def __init__(self, client: Client):\n \"\"\"\n Arguments:\n client: The client object, which is passed to all objects this client generates.\n \"\"\"\n self._client: Client = client\n\n def get_cdn_hash(self, cdn_hash: str) -> BaseCDNHash:\n \"\"\"\n Gets a Roblox CDN cdn_hash.\n\n Arguments:\n cdn_hash: The cdn_hash.\n\n Returns:\n A BaseCDNHash.\n \"\"\"\n\n return BaseCDNHash(\n client=self._client,\n cdn_hash=cdn_hash\n )\n\n def get_cdn_hash_from_url(self, url: str, site: str = cdn_site) -> BaseCDNHash:\n \"\"\"\n todo: turn this into something that actually splits into path.\n\n Arguments:\n url: A CDN url.\n site: The site this cdn_hash is located at.\n\n Returns:\n The CDN cdn_hash for the supplied CDN URL.\n \"\"\"\n\n return self.get_cdn_hash(\n cdn_hash=url.split(f\".{site}/\")[1]\n )\n\n def get_thumbnail_cdn_hash(self, cdn_hash: str) -> ThumbnailCDNHash:\n \"\"\"\n Gets a Roblox CDN cdn_hash.\n\n Arguments:\n cdn_hash: The cdn_hash.\n\n Returns:\n A ThumbnailCDNHash.\n \"\"\"\n\n return ThumbnailCDNHash(\n client=self._client,\n cdn_hash=cdn_hash\n )\n\n def get_content_cdn_hash(self, cdn_hash: str) -> ContentCDNHash:\n \"\"\"\n Gets a Roblox CDN cdn_hash.\n\n Arguments:\n cdn_hash: The cdn_hash.\n\n Returns:\n A ContentCDNHash.\n \"\"\"\n\n return ContentCDNHash(\n client=self._client,\n cdn_hash=cdn_hash\n )\n
"},{"location":"reference/delivery/#roblox.delivery.DeliveryProvider.__init__","title":"__init__(client)
","text":"Parameters:
Name Type Description Defaultclient
Client
The client object, which is passed to all objects this client generates.
required Source code inroblox/delivery.py
def __init__(self, client: Client):\n \"\"\"\n Arguments:\n client: The client object, which is passed to all objects this client generates.\n \"\"\"\n self._client: Client = client\n
"},{"location":"reference/delivery/#roblox.delivery.DeliveryProvider.get_cdn_hash","title":"get_cdn_hash(cdn_hash)
","text":"Gets a Roblox CDN cdn_hash.
Parameters:
Name Type Description Defaultcdn_hash
str
The cdn_hash.
requiredReturns:
Type DescriptionBaseCDNHash
A BaseCDNHash.
Source code inroblox/delivery.py
def get_cdn_hash(self, cdn_hash: str) -> BaseCDNHash:\n \"\"\"\n Gets a Roblox CDN cdn_hash.\n\n Arguments:\n cdn_hash: The cdn_hash.\n\n Returns:\n A BaseCDNHash.\n \"\"\"\n\n return BaseCDNHash(\n client=self._client,\n cdn_hash=cdn_hash\n )\n
"},{"location":"reference/delivery/#roblox.delivery.DeliveryProvider.get_cdn_hash_from_url","title":"get_cdn_hash_from_url(url, site=cdn_site)
","text":"Parameters:
Name Type Description Defaulturl
str
A CDN url.
requiredsite
str
The site this cdn_hash is located at.
cdn_site
Returns:
Type DescriptionBaseCDNHash
The CDN cdn_hash for the supplied CDN URL.
Source code inroblox/delivery.py
def get_cdn_hash_from_url(self, url: str, site: str = cdn_site) -> BaseCDNHash:\n \"\"\"\n todo: turn this into something that actually splits into path.\n\n Arguments:\n url: A CDN url.\n site: The site this cdn_hash is located at.\n\n Returns:\n The CDN cdn_hash for the supplied CDN URL.\n \"\"\"\n\n return self.get_cdn_hash(\n cdn_hash=url.split(f\".{site}/\")[1]\n )\n
"},{"location":"reference/delivery/#roblox.delivery.DeliveryProvider.get_content_cdn_hash","title":"get_content_cdn_hash(cdn_hash)
","text":"Gets a Roblox CDN cdn_hash.
Parameters:
Name Type Description Defaultcdn_hash
str
The cdn_hash.
requiredReturns:
Type DescriptionContentCDNHash
A ContentCDNHash.
Source code inroblox/delivery.py
def get_content_cdn_hash(self, cdn_hash: str) -> ContentCDNHash:\n \"\"\"\n Gets a Roblox CDN cdn_hash.\n\n Arguments:\n cdn_hash: The cdn_hash.\n\n Returns:\n A ContentCDNHash.\n \"\"\"\n\n return ContentCDNHash(\n client=self._client,\n cdn_hash=cdn_hash\n )\n
"},{"location":"reference/delivery/#roblox.delivery.DeliveryProvider.get_thumbnail_cdn_hash","title":"get_thumbnail_cdn_hash(cdn_hash)
","text":"Gets a Roblox CDN cdn_hash.
Parameters:
Name Type Description Defaultcdn_hash
str
The cdn_hash.
requiredReturns:
Type DescriptionThumbnailCDNHash
A ThumbnailCDNHash.
Source code inroblox/delivery.py
def get_thumbnail_cdn_hash(self, cdn_hash: str) -> ThumbnailCDNHash:\n \"\"\"\n Gets a Roblox CDN cdn_hash.\n\n Arguments:\n cdn_hash: The cdn_hash.\n\n Returns:\n A ThumbnailCDNHash.\n \"\"\"\n\n return ThumbnailCDNHash(\n client=self._client,\n cdn_hash=cdn_hash\n )\n
"},{"location":"reference/delivery/#roblox.delivery.ThumbnailCDNHash","title":"ThumbnailCDNHash
","text":" Bases: BaseCDNHash
Represents a CDN hash on tX.rbxcdn.com.
Source code inroblox/delivery.py
class ThumbnailCDNHash(BaseCDNHash):\n \"\"\"\n Represents a CDN hash on tX.rbxcdn.com.\n \"\"\"\n\n def __init__(self, client: Client, cdn_hash: str):\n super().__init__(client=client, cdn_hash=cdn_hash)\n\n def get_url(self, site: str = cdn_site) -> str:\n \"\"\"\n Returns this CDN hash's URL.\n \"\"\"\n\n return self._get_url(\"t\", cdn_site)\n
"},{"location":"reference/delivery/#roblox.delivery.ThumbnailCDNHash.get_url","title":"get_url(site=cdn_site)
","text":"Returns this CDN hash's URL.
Source code inroblox/delivery.py
def get_url(self, site: str = cdn_site) -> str:\n \"\"\"\n Returns this CDN hash's URL.\n \"\"\"\n\n return self._get_url(\"t\", cdn_site)\n
"},{"location":"reference/delivery/#roblox.delivery.get_cdn_number","title":"get_cdn_number(cdn_hash)
","text":"Gets the number in the CDN where number represents X in tX.rbxcdn.com
Parameters:
Name Type Description Defaultcdn_hash
str
The CDN cdn_hash to generate a CDN number for.
requiredReturns:
Type Descriptionint
The CDN number for the supplied cdn_hash.
Source code inroblox/delivery.py
def get_cdn_number(cdn_hash: str) -> int:\n \"\"\"\n Gets the number in the CDN where number represents X in tX.rbxcdn.com\n\n Arguments:\n cdn_hash: The CDN cdn_hash to generate a CDN number for.\n\n Returns: \n The CDN number for the supplied cdn_hash.\n \"\"\"\n i = 31\n for char in cdn_hash[:32]:\n i ^= ord(char) # i ^= int(char, 16) also works\n return i % 8\n
"},{"location":"reference/friends/","title":"friends","text":"Contains classes related to Roblox friend data and parsing.
"},{"location":"reference/friends/#roblox.friends.Friend","title":"Friend
","text":" Bases: User
Represents a friend.
Attributes:
Name Type Descriptionis_online
Optional[bool]
Whether the user is currently online.
presence_type
Optional[int]
Their presence type. Don't use this.
is_deleted
bool
Whether the account is deleted.
friend_frequent_rank
int
Unknown
Source code inroblox/friends.py
class Friend(User):\n \"\"\"\n Represents a friend.\n\n Attributes:\n is_online: Whether the user is currently online.\n presence_type: Their presence type. Don't use this.\n is_deleted: Whether the account is deleted.\n friend_frequent_rank: Unknown\n \"\"\"\n\n def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n data: The data we get back from the endpoint.\n client: The Client object, which is passed to all objects this Client generates.\n \"\"\"\n super().__init__(client=client, data=data)\n\n self.is_online: Optional[bool] = data.get(\"isOnline\")\n self.presence_type: Optional[int] = data.get(\"presenceType\")\n self.is_deleted: bool = data[\"isDeleted\"]\n self.friend_frequent_rank: int = data[\"friendFrequentRank\"]\n
"},{"location":"reference/friends/#roblox.friends.Friend.__init__","title":"__init__(client, data)
","text":"Parameters:
Name Type Description Defaultdata
dict
The data we get back from the endpoint.
requiredclient
Client
The Client object, which is passed to all objects this Client generates.
required Source code inroblox/friends.py
def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n data: The data we get back from the endpoint.\n client: The Client object, which is passed to all objects this Client generates.\n \"\"\"\n super().__init__(client=client, data=data)\n\n self.is_online: Optional[bool] = data.get(\"isOnline\")\n self.presence_type: Optional[int] = data.get(\"presenceType\")\n self.is_deleted: bool = data[\"isDeleted\"]\n self.friend_frequent_rank: int = data[\"friendFrequentRank\"]\n
"},{"location":"reference/gamepasses/","title":"gamepasses","text":"Contains classes related to Roblox gamepass data and parsing.
"},{"location":"reference/gamepasses/#roblox.gamepasses.GamePass","title":"GamePass
","text":" Bases: BaseGamePass
Represents a Roblox gamepass.
Attributes:
Name Type Descriptionid
int
The gamepass ID.
name
str
The gamepass name.
display_name
str
The gamepass display name.
price
Optional[int]
The gamepass price.
Source code inroblox/gamepasses.py
class GamePass(BaseGamePass):\n \"\"\"\n Represents a Roblox gamepass.\n\n Attributes:\n id: The gamepass ID.\n name: The gamepass name.\n display_name: The gamepass display name.\n price: The gamepass price.\n \"\"\"\n\n def __init__(self, client: Client, data: dict):\n self._client: Client = client\n self.id: int = data[\"id\"]\n super().__init__(client=self._client, gamepass_id=self.id)\n self.name: str = data[\"name\"]\n self.display_name: str = data[\"displayName\"]\n # TODO: add product here\n self.price: Optional[int] = data[\"price\"]\n
"},{"location":"reference/groups/","title":"groups","text":"Contains classes related to Roblox group data and parsing.
"},{"location":"reference/groups/#roblox.groups.Group","title":"Group
","text":" Bases: BaseGroup
Represents a group.
Attributes:
Name Type Descriptionid
int
the id of the group.
name
str
name of the group.
description
str
description of the group.
owner
Optional[PartialUser]
player who owns the group.
shout
Optional[Shout]
the current group shout.
member_count
int
amount of members in the group.
is_builders_club_only
bool
can only people with builder club join.
public_entry_allowed
bool
can you join without your join request having to be accepted.
is_locked
bool
Is the group locked?
has_verified_badge
bool
If the group has a verified badge.
Source code inroblox/groups.py
class Group(BaseGroup):\n \"\"\"\n Represents a group.\n\n Attributes:\n id: the id of the group.\n name: name of the group.\n description: description of the group.\n owner: player who owns the group.\n shout: the current group shout.\n member_count: amount of members in the group.\n is_builders_club_only: can only people with builder club join.\n public_entry_allowed: can you join without your join request having to be accepted.\n is_locked: Is the group locked?\n has_verified_badge: If the group has a verified badge.\n \"\"\"\n\n def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n data: The data we get back from the endpoint.\n client: The Client object, which is passed to all objects this Client generates.\n \"\"\"\n super().__init__(client, data[\"id\"])\n\n self._client: Client = client\n\n self.id: int = data[\"id\"]\n self.name: str = data[\"name\"]\n self.description: str = data[\"description\"]\n self.owner: Optional[PartialUser] = PartialUser(client=client, data=data[\"owner\"]) if data.get(\"owner\") else \\\n None\n self.shout: Optional[Shout] = Shout(\n client=self._client,\n data=data[\"shout\"]\n ) if data.get(\"shout\") else None\n\n self.member_count: int = data[\"memberCount\"]\n self.is_builders_club_only: bool = data[\"isBuildersClubOnly\"]\n self.public_entry_allowed: bool = data[\"publicEntryAllowed\"]\n self.is_locked: bool = data.get(\"isLocked\") or False\n self.has_verified_badge: bool = data[\"hasVerifiedBadge\"]\n\n async def update_shout(self, message: str, update_self: bool = True) -> Tuple[Optional[Shout], Optional[Shout]]:\n \"\"\"\n Updates the shout.\n\n Arguments:\n message: The new shout message.\n update_self: Whether to update self.shout automatically.\n Returns: \n The old and new shout.\n \"\"\"\n shout_response = await self._client.requests.patch(\n url=self._client.url_generator.get_url(\"groups\", f\"v1/groups/{self.id}/status\"),\n json={\n \"message\": message\n }\n )\n\n shout_data = shout_response.json()\n\n old_shout: Optional[Shout] = self.shout\n new_shout: Optional[Shout] = shout_data and Shout(\n client=self._client,\n data=shout_data\n ) or None\n\n if update_self:\n self.shout = new_shout\n\n return old_shout, new_shout\n
"},{"location":"reference/groups/#roblox.groups.Group.__init__","title":"__init__(client, data)
","text":"Parameters:
Name Type Description Defaultdata
dict
The data we get back from the endpoint.
requiredclient
Client
The Client object, which is passed to all objects this Client generates.
required Source code inroblox/groups.py
def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n data: The data we get back from the endpoint.\n client: The Client object, which is passed to all objects this Client generates.\n \"\"\"\n super().__init__(client, data[\"id\"])\n\n self._client: Client = client\n\n self.id: int = data[\"id\"]\n self.name: str = data[\"name\"]\n self.description: str = data[\"description\"]\n self.owner: Optional[PartialUser] = PartialUser(client=client, data=data[\"owner\"]) if data.get(\"owner\") else \\\n None\n self.shout: Optional[Shout] = Shout(\n client=self._client,\n data=data[\"shout\"]\n ) if data.get(\"shout\") else None\n\n self.member_count: int = data[\"memberCount\"]\n self.is_builders_club_only: bool = data[\"isBuildersClubOnly\"]\n self.public_entry_allowed: bool = data[\"publicEntryAllowed\"]\n self.is_locked: bool = data.get(\"isLocked\") or False\n self.has_verified_badge: bool = data[\"hasVerifiedBadge\"]\n
"},{"location":"reference/groups/#roblox.groups.Group.update_shout","title":"update_shout(message, update_self=True)
async
","text":"Updates the shout.
Parameters:
Name Type Description Defaultmessage
str
The new shout message.
requiredupdate_self
bool
Whether to update self.shout automatically.
True
Source code in roblox/groups.py
async def update_shout(self, message: str, update_self: bool = True) -> Tuple[Optional[Shout], Optional[Shout]]:\n \"\"\"\n Updates the shout.\n\n Arguments:\n message: The new shout message.\n update_self: Whether to update self.shout automatically.\n Returns: \n The old and new shout.\n \"\"\"\n shout_response = await self._client.requests.patch(\n url=self._client.url_generator.get_url(\"groups\", f\"v1/groups/{self.id}/status\"),\n json={\n \"message\": message\n }\n )\n\n shout_data = shout_response.json()\n\n old_shout: Optional[Shout] = self.shout\n new_shout: Optional[Shout] = shout_data and Shout(\n client=self._client,\n data=shout_data\n ) or None\n\n if update_self:\n self.shout = new_shout\n\n return old_shout, new_shout\n
"},{"location":"reference/instances/","title":"instances","text":"This module contains classes intended to parse and deal with data from Roblox item instance information endpoints.
"},{"location":"reference/instances/#roblox.instances.AssetInstance","title":"AssetInstance
","text":" Bases: ItemInstance
Represents an instance of a Roblox asset.
Source code inroblox/instances.py
class AssetInstance(ItemInstance):\n \"\"\"\n Represents an instance of a Roblox asset.\n \"\"\"\n\n def __init__(self, client: Client, data: dict):\n self._client: Client = client\n super().__init__(client=self._client, data=data)\n\n self.asset: BaseAsset = BaseAsset(client=self._client, asset_id=data[\"id\"])\n
"},{"location":"reference/instances/#roblox.instances.BadgeInstance","title":"BadgeInstance
","text":" Bases: ItemInstance
Represents an instance of a Roblox badge.
Source code inroblox/instances.py
class BadgeInstance(ItemInstance):\n \"\"\"\n Represents an instance of a Roblox badge.\n \"\"\"\n\n def __init__(self, client: Client, data: dict):\n self._client: Client = client\n super().__init__(client=self._client, data=data)\n\n self.badge: BaseBadge = BaseBadge(client=self._client, badge_id=data[\"id\"])\n
"},{"location":"reference/instances/#roblox.instances.GamePassInstance","title":"GamePassInstance
","text":" Bases: ItemInstance
Represents an instance of a Roblox gamepass.
Source code inroblox/instances.py
class GamePassInstance(ItemInstance):\n \"\"\"\n Represents an instance of a Roblox gamepass.\n \"\"\"\n\n def __init__(self, client: Client, data: dict):\n self._client: Client = client\n super().__init__(client=self._client, data=data)\n\n self.gamepass: BaseGamePass = BaseGamePass(client=self._client, gamepass_id=data[\"id\"])\n
"},{"location":"reference/instances/#roblox.instances.InstanceType","title":"InstanceType
","text":" Bases: Enum
Represents an asset instance type.
Source code inroblox/instances.py
class InstanceType(Enum):\n \"\"\"\n Represents an asset instance type.\n \"\"\"\n asset = \"Asset\"\n gamepass = \"GamePass\"\n badge = \"Badge\"\n
"},{"location":"reference/instances/#roblox.instances.ItemInstance","title":"ItemInstance
","text":" Bases: BaseInstance
Represents an instance of a Roblox item of some kind.
Attributes:
Name Type Description_client
Client
The Client object, which is passed to all objects this Client generates.
Source code inroblox/instances.py
class ItemInstance(BaseInstance):\n \"\"\"\n Represents an instance of a Roblox item of some kind.\n\n Attributes:\n _client: The Client object, which is passed to all objects this Client generates.\n \"\"\"\n\n def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: The Client.\n data: The data from the endpoint.\n \"\"\"\n self._client: Client = client\n\n self.name: str = data[\"name\"]\n self.type: str = data[\"type\"] # fixme\n\n super().__init__(client=self._client, instance_id=data[\"instanceId\"])\n
"},{"location":"reference/instances/#roblox.instances.ItemInstance.__init__","title":"__init__(client, data)
","text":"Parameters:
Name Type Description Defaultclient
Client
The Client.
requireddata
dict
The data from the endpoint.
required Source code inroblox/instances.py
def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: The Client.\n data: The data from the endpoint.\n \"\"\"\n self._client: Client = client\n\n self.name: str = data[\"name\"]\n self.type: str = data[\"type\"] # fixme\n\n super().__init__(client=self._client, instance_id=data[\"instanceId\"])\n
"},{"location":"reference/jobs/","title":"jobs","text":"This module contains classes intended to parse and deal with data from Roblox server instance (or \"job\") endpoints.
"},{"location":"reference/jobs/#roblox.jobs.GameInstance","title":"GameInstance
","text":" Bases: BaseJob
Represents a game (or place) instance, or \"job\".
Attributes:
Name Type Descriptionid
str
The instance's job ID.
capacity
int
The server's capacity.
ping
int
The server's ping.
fps
float
The server's FPS.
show_slow_game_message
bool
Whether to show the \"slow game\" message.
place
BasePlace
The server's place.
current_players
List[GameInstancePlayer]
A list of the players in this server.
can_join
bool
Whether the authenticated user can join this server.
show_shutdown_button
bool
Whether to show the shutdown button on this server.
friends_description
str
What text should be shown if this server is a \"friends are in\" server.
friends_mouseover
What text should be shown on mouseover if this server is a \"friends are in\" server.
capacity_message
str
The server's capacity as a parsed message.
join_script
str
JavaScript code that, when evaluated on a /games page on the Roblox website, launches this game.
app_join_script
str
JavaScript code that, when evaluated on a /games page on the Roblox website, launches this game through the Roblox mobile app.
Source code inroblox/jobs.py
class GameInstance(BaseJob):\n \"\"\"\n Represents a game (or place) instance, or \"job\".\n\n Attributes:\n id: The instance's job ID.\n capacity: The server's capacity.\n ping: The server's ping.\n fps: The server's FPS.\n show_slow_game_message: Whether to show the \"slow game\" message.\n place: The server's place.\n current_players: A list of the players in this server.\n can_join: Whether the authenticated user can join this server.\n show_shutdown_button: Whether to show the shutdown button on this server.\n friends_description: What text should be shown if this server is a \"friends are in\" server.\n friends_mouseover: What text should be shown on mouseover if this server is a \"friends are in\" server.\n capacity_message: The server's capacity as a parsed message.\n join_script: JavaScript code that, when evaluated on a /games page on the Roblox website, launches this game.\n app_join_script: JavaScript code that, when evaluated on a /games page on the Roblox website, launches this game\n through the Roblox mobile app.\n \"\"\"\n\n def __init__(self, client: Client, data: dict):\n self._client: Client = client\n self.id: str = data[\"Guid\"]\n\n super().__init__(client=self._client, job_id=self.id)\n\n self.capacity: int = data[\"Capacity\"]\n self.ping: int = data[\"Ping\"]\n self.fps: float = data[\"Fps\"]\n self.show_slow_game_message: bool = data[\"ShowSlowGameMessage\"]\n self.place: BasePlace = BasePlace(client=self._client, place_id=data[\"PlaceId\"])\n\n self.current_players: List[GameInstancePlayer] = [\n GameInstancePlayer(\n client=self._client,\n data=player_data\n ) for player_data in data[\"CurrentPlayers\"]\n ]\n\n self.can_join: bool = data[\"UserCanJoin\"]\n self.show_shutdown_button: bool = data[\"ShowShutdownButton\"]\n self.friends_description: str = data[\"FriendsDescription\"]\n self.friends_mouseover = data[\"FriendsMouseover\"]\n self.capacity_message: str = data[\"PlayersCapacity\"] # TODO: reconsider\n\n self.join_script: str = data[\"JoinScript\"]\n self.app_join_script: str = data[\"RobloxAppJoinScript\"]\n
"},{"location":"reference/jobs/#roblox.jobs.GameInstancePlayer","title":"GameInstancePlayer
","text":" Bases: BaseUser
Represents a single player in a game instance. Data, like user ID and username, may be filled with placeholder data. Do not rely on this object containing proper data. If the id attribute is 0, this object should not be used.
Attributes:
Name Type Descriptionid
int
The player's user ID.
name
str
The player's username.
thumbnail
GameInstancePlayerThumbnail
The player's thumbnail.
Source code inroblox/jobs.py
class GameInstancePlayer(BaseUser):\n \"\"\"\n Represents a single player in a game instance.\n Data, like user ID and username, may be filled with placeholder data.\n Do not rely on this object containing proper data. If the id attribute is 0, this object should not be used.\n\n Attributes:\n id: The player's user ID.\n name: The player's username.\n thumbnail: The player's thumbnail.\n \"\"\"\n\n def __init__(self, client: Client, data: dict):\n self._client: Client = client\n self.id: int = data[\"Id\"]\n super().__init__(client=self._client, user_id=self.id)\n\n self.name: str = data[\"Username\"]\n self.thumbnail: GameInstancePlayerThumbnail = GameInstancePlayerThumbnail(\n client=self._client,\n data=data[\"Thumbnail\"]\n )\n
"},{"location":"reference/jobs/#roblox.jobs.GameInstancePlayerThumbnail","title":"GameInstancePlayerThumbnail
","text":"Represent a player in a game instance's thumbnail. As the asset part of these thumbnails is no longer in use, this endpoint does not attempt to implement asset information.
Attributes:
Name Type Descriptionurl
str
The thumbnail's URL.
final
bool
Whether the thumbnail is finalized or not.
Source code inroblox/jobs.py
class GameInstancePlayerThumbnail:\n \"\"\"\n Represent a player in a game instance's thumbnail.\n As the asset part of these thumbnails is no longer in use, this endpoint does not attempt to implement asset\n information.\n\n Attributes:\n url: The thumbnail's URL.\n final: Whether the thumbnail is finalized or not.\n \"\"\"\n\n def __init__(self, client: Client, data: dict):\n self._client: Client = client\n\n self.url: str = data[\"Url\"]\n self.final: bool = data[\"IsFinal\"]\n\n def __repr__(self):\n return f\"<{self.__class__.__name__} url={self.url!r} final={self.final}\"\n
"},{"location":"reference/jobs/#roblox.jobs.GameInstances","title":"GameInstances
","text":"Represents a game/place's active server instances.
Attributes:
Name Type Descriptionplace
BasePlace
The place.
show_shutdown_all_button
bool
Whether to show the \"Shutdown All\" button on the server list.
is_game_instance_list_unavailable
bool
Whether the list is unavailable.
collection
List[GameInstance]
A list of the game instances.
total_collection_size
int
How many active servers there are.
Source code inroblox/jobs.py
class GameInstances:\n \"\"\"\n Represents a game/place's active server instances.\n\n Attributes:\n place: The place.\n show_shutdown_all_button: Whether to show the \"Shutdown All\" button on the server list.\n is_game_instance_list_unavailable: Whether the list is unavailable.\n collection: A list of the game instances.\n total_collection_size: How many active servers there are.\n \"\"\"\n\n def __init__(self, client: Client, data: dict):\n self._client: Client = client\n\n self.place: BasePlace = BasePlace(client=self._client, place_id=data[\"PlaceId\"])\n self.show_shutdown_all_button: bool = data[\"ShowShutdownAllButton\"]\n self.is_game_instance_list_unavailable: bool = data[\"IsGameInstanceListUnavailable\"]\n self.collection: List[GameInstance] = [\n GameInstance(\n client=self._client,\n data=instance_data\n ) for instance_data in data[\"Collection\"]\n ]\n self.total_collection_size: int = data[\"TotalCollectionSize\"]\n
"},{"location":"reference/jobs/#roblox.jobs.PrivateServer","title":"PrivateServer
","text":" Bases: Server
Represents a private server.
Attributes:
Name Type Descriptionid
The private server's job id.
vip_server_id
int
The private server's vipServerId.
max_players
int
The maximum number of players that can be in the server at once.
playing
int
The amount of players in the server.
player_tokens
int
A list of thumbnail tokens for all the players in the server.
players
int
A list of ServerPlayer objects representing the players in the server. Only friends of the authenticated user will show up here.
fps
int
The server's fps.
ping
int
The server's ping.
name
str
The private server's name.
access_code
str
The private server's access code.
owner
PartialUser
A PartialUser object representing the owner of the private server.
Source code inroblox/jobs.py
class PrivateServer(Server):\n \"\"\"\n Represents a private server.\n\n Attributes:\n id: The private server's job id.\n vip_server_id: The private server's vipServerId.\n max_players: The maximum number of players that can be in the server at once.\n playing: The amount of players in the server.\n player_tokens: A list of thumbnail tokens for all the players in the server.\n players: A list of ServerPlayer objects representing the players in the server. Only friends of the authenticated user will show up here.\n fps: The server's fps.\n ping: The server's ping.\n name: The private server's name.\n access_code: The private server's access code.\n owner: A PartialUser object representing the owner of the private server.\n \"\"\"\n\n def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: The Client this object belongs to.\n data: A PrivateServerResponse object.\n \"\"\"\n\n super().__init__(client=client, data=data)\n\n self.name: str = data[\"name\"]\n self.vip_server_id: int = data[\"vipServerId\"]\n self.access_code: str = data[\"accessCode\"]\n self.owner: PartialUser = PartialUser(client=self._client, data=data[\"owner\"])\n
"},{"location":"reference/jobs/#roblox.jobs.PrivateServer.__init__","title":"__init__(client, data)
","text":"Parameters:
Name Type Description Defaultclient
Client
The Client this object belongs to.
requireddata
dict
A PrivateServerResponse object.
required Source code inroblox/jobs.py
def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: The Client this object belongs to.\n data: A PrivateServerResponse object.\n \"\"\"\n\n super().__init__(client=client, data=data)\n\n self.name: str = data[\"name\"]\n self.vip_server_id: int = data[\"vipServerId\"]\n self.access_code: str = data[\"accessCode\"]\n self.owner: PartialUser = PartialUser(client=self._client, data=data[\"owner\"])\n
"},{"location":"reference/jobs/#roblox.jobs.Server","title":"Server
","text":" Bases: BaseItem
Represents a public server.
Attributes:
Name Type Descriptionid
Optional[str]
The server's job id.
max_players
int
The maximum number of players that can be in the server at once.
playing
int
The amount of players in the server.
player_tokens
List[str]
A list of thumbnail tokens for all the players in the server.
players
List[ServerPlayer]
A list of ServerPlayer objects representing the players in the server. Only friends of the authenticated user will show up here.
fps
float
The server's fps.
ping
Optional[int]
The server's ping.
Source code inroblox/jobs.py
class Server(BaseItem):\n \"\"\"\n Represents a public server.\n\n Attributes:\n id: The server's job id.\n max_players: The maximum number of players that can be in the server at once.\n playing: The amount of players in the server.\n player_tokens: A list of thumbnail tokens for all the players in the server.\n players: A list of ServerPlayer objects representing the players in the server. Only friends of the authenticated user will show up here.\n fps: The server's fps.\n ping: The server's ping.\n \"\"\"\n\n def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: The Client this object belongs to.\n data: A GameServerResponse object.\n \"\"\"\n\n self._client: Client = client\n\n self.id: Optional[str] = data.get(\"id\")\n self.max_players: int = data[\"maxPlayers\"]\n self.playing: int = data.get(\"playing\", 0)\n self.player_tokens: List[str] = data[\"playerTokens\"]\n self.players: List[ServerPlayer] = [\n ServerPlayer(client=self._client, data=player_data) \n for player_data in data[\"players\"]\n ]\n\n self.fps: float = data.get(\"fps\")\n self.ping: Optional[int] = data.get(\"ping\")\n
"},{"location":"reference/jobs/#roblox.jobs.Server.__init__","title":"__init__(client, data)
","text":"Parameters:
Name Type Description Defaultclient
Client
The Client this object belongs to.
requireddata
dict
A GameServerResponse object.
required Source code inroblox/jobs.py
def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: The Client this object belongs to.\n data: A GameServerResponse object.\n \"\"\"\n\n self._client: Client = client\n\n self.id: Optional[str] = data.get(\"id\")\n self.max_players: int = data[\"maxPlayers\"]\n self.playing: int = data.get(\"playing\", 0)\n self.player_tokens: List[str] = data[\"playerTokens\"]\n self.players: List[ServerPlayer] = [\n ServerPlayer(client=self._client, data=player_data) \n for player_data in data[\"players\"]\n ]\n\n self.fps: float = data.get(\"fps\")\n self.ping: Optional[int] = data.get(\"ping\")\n
"},{"location":"reference/jobs/#roblox.jobs.ServerPlayer","title":"ServerPlayer
","text":" Bases: BaseUser
Represents a player in a server.
Attributes:
Name Type Descriptionid
The player's user id.
name
str
The player's username.
display_name
str
The player's display name.
player_token
str
The player's token.
Source code inroblox/jobs.py
class ServerPlayer(BaseUser):\n \"\"\"\n Represents a player in a server.\n\n Attributes:\n id: The player's user id.\n name: The player's username.\n display_name: The player's display name.\n player_token: The player's token.\n \"\"\"\n\n def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: The Client this object belongs to.\n data: A GameServerPlayerResponse object.\n \"\"\"\n\n super().__init__(client=client, user_id=data[\"id\"])\n\n self.player_token: str = data[\"playerToken\"]\n self.name: str = data[\"name\"]\n self.display_name: str = data[\"displayName\"]\n
"},{"location":"reference/jobs/#roblox.jobs.ServerPlayer.__init__","title":"__init__(client, data)
","text":"Parameters:
Name Type Description Defaultclient
Client
The Client this object belongs to.
requireddata
dict
A GameServerPlayerResponse object.
required Source code inroblox/jobs.py
def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: The Client this object belongs to.\n data: A GameServerPlayerResponse object.\n \"\"\"\n\n super().__init__(client=client, user_id=data[\"id\"])\n\n self.player_token: str = data[\"playerToken\"]\n self.name: str = data[\"name\"]\n self.display_name: str = data[\"displayName\"]\n
"},{"location":"reference/jobs/#roblox.jobs.ServerType","title":"ServerType
","text":" Bases: Enum
Represents the type of server.
Source code inroblox/jobs.py
class ServerType(Enum):\n \"\"\"\n Represents the type of server.\n \"\"\"\n\n public = \"Public\"\n friend = \"Friend\"\n
"},{"location":"reference/members/","title":"members","text":"This module contains classes intended to parse and deal with data from Roblox group member endpoints.
"},{"location":"reference/members/#roblox.members.Member","title":"Member
","text":" Bases: MemberRelationship
Represents a group member.
Attributes:
Name Type Descriptionid
int
The member's ID.
name
str
The member's name.
display_name
str
The member's display name.
role
PartialRole
The member's role.
group
BaseGroup
The member's group.
has_verified_badge
bool
If the member has a verified badge.
Source code inroblox/members.py
class Member(MemberRelationship):\n \"\"\"\n Represents a group member.\n\n Attributes:\n id: The member's ID.\n name: The member's name.\n display_name: The member's display name.\n role: The member's role.\n group: The member's group.\n has_verified_badge: If the member has a verified badge.\n \"\"\"\n\n def __init__(self, client: Client, data: dict, group: BaseGroup):\n self._client: Client = client\n\n self.id: int = data[\"user\"][\"userId\"]\n self.name: str = data[\"user\"][\"username\"]\n self.display_name: str = data[\"user\"][\"displayName\"]\n self.has_verified_badge: bool = data[\"user\"][\"hasVerifiedBadge\"]\n\n super().__init__(client=self._client, user=self.id, group=group)\n\n self.role: PartialRole = PartialRole(client=self._client, data=data[\"role\"])\n self.group: BaseGroup = group\n
"},{"location":"reference/members/#roblox.members.MemberRelationship","title":"MemberRelationship
","text":" Bases: BaseUser
Represents a relationship between a user and a group.
Attributes:
Name Type Descriptiongroup
BaseGroup
The corresponding group.
Source code inroblox/members.py
class MemberRelationship(BaseUser):\n \"\"\"\n Represents a relationship between a user and a group.\n\n Attributes:\n group: The corresponding group.\n \"\"\"\n\n def __init__(self, client: Client, user: Union[BaseUser, int], group: Union[BaseGroup, int]):\n self._client: Client = client\n super().__init__(client=self._client, user_id=int(user))\n\n self.group: BaseGroup\n\n if isinstance(group, int):\n self.group = BaseGroup(client=self._client, group_id=group)\n else:\n self.group = group\n\n async def set_role(self, role: RoleOrRoleId):\n \"\"\"\n Sets this member's role.\n\n Arguments:\n role: The new role this member should be assigned.\n \"\"\"\n await self.group.set_role(self, role)\n\n async def set_rank(self, rank: int):\n \"\"\"\n Sets this member's rank.\n\n Arguments:\n rank: The new rank this member should be assigned. Should be in the range of 0-255.\n \"\"\"\n await self.group.set_rank(self, rank)\n\n async def kick(self):\n \"\"\"\n Kicks this member from the group.\n \"\"\"\n await self.group.kick_user(self)\n\n async def delete_all_messages(self):\n \"\"\"\n Deletes all wall posts created by this member in the group.\n \"\"\"\n await self.group.delete_all_messages(self)\n
"},{"location":"reference/members/#roblox.members.MemberRelationship.delete_all_messages","title":"delete_all_messages()
async
","text":"Deletes all wall posts created by this member in the group.
Source code inroblox/members.py
async def delete_all_messages(self):\n \"\"\"\n Deletes all wall posts created by this member in the group.\n \"\"\"\n await self.group.delete_all_messages(self)\n
"},{"location":"reference/members/#roblox.members.MemberRelationship.kick","title":"kick()
async
","text":"Kicks this member from the group.
Source code inroblox/members.py
async def kick(self):\n \"\"\"\n Kicks this member from the group.\n \"\"\"\n await self.group.kick_user(self)\n
"},{"location":"reference/members/#roblox.members.MemberRelationship.set_rank","title":"set_rank(rank)
async
","text":"Sets this member's rank.
Parameters:
Name Type Description Defaultrank
int
The new rank this member should be assigned. Should be in the range of 0-255.
required Source code inroblox/members.py
async def set_rank(self, rank: int):\n \"\"\"\n Sets this member's rank.\n\n Arguments:\n rank: The new rank this member should be assigned. Should be in the range of 0-255.\n \"\"\"\n await self.group.set_rank(self, rank)\n
"},{"location":"reference/members/#roblox.members.MemberRelationship.set_role","title":"set_role(role)
async
","text":"Sets this member's role.
Parameters:
Name Type Description Defaultrole
RoleOrRoleId
The new role this member should be assigned.
required Source code inroblox/members.py
async def set_role(self, role: RoleOrRoleId):\n \"\"\"\n Sets this member's role.\n\n Arguments:\n role: The new role this member should be assigned.\n \"\"\"\n await self.group.set_role(self, role)\n
"},{"location":"reference/places/","title":"places","text":"This module contains classes intended to parse and deal with data from Roblox place information endpoints.
"},{"location":"reference/places/#roblox.places.Place","title":"Place
","text":" Bases: BasePlace
Represents a Roblox place.
Attributes:
Name Type Descriptionid
int
id of the place.
name
str
Name of the place.
description
str
Description of the place.
url
str
URL for the place.
builder
str
The name of the user or group who owns the place.
builder_id
int
The ID of the player or group who owns the place.
is_playable
bool
Whether the authenticated user can play this game.
reason_prohibited
str
If the place is not playable, contains the reason why the user cannot play the game.
universe
BaseUniverse
The BaseUniverse that contains this place.
universe_root_place
BasePlace
The root place that the universe contains.
price
int
How much it costs to play the game.
image_token
str
Can be used to generate thumbnails for this place.
has_verified_badge
bool
If the place has a verified badge.
Source code inroblox/places.py
class Place(BasePlace):\n \"\"\"\n Represents a Roblox place.\n\n Attributes:\n id: id of the place.\n name: Name of the place.\n description: Description of the place.\n url: URL for the place.\n builder: The name of the user or group who owns the place.\n builder_id: The ID of the player or group who owns the place.\n is_playable: Whether the authenticated user can play this game.\n reason_prohibited: If the place is not playable, contains the reason why the user cannot play the game.\n universe: The BaseUniverse that contains this place.\n universe_root_place: The root place that the universe contains.\n price: How much it costs to play the game.\n image_token: Can be used to generate thumbnails for this place.\n has_verified_badge: If the place has a verified badge.\n \"\"\"\n\n def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: The Client object, which is passed to all objects this Client generates.\n data: data to make the magic happen.\n \"\"\"\n super().__init__(client=client, place_id=data[\"placeId\"])\n\n self._client: Client = client\n\n self.id: int = data[\"placeId\"]\n self.name: str = data[\"name\"]\n self.description: str = data[\"description\"]\n self.url: str = data[\"url\"]\n\n self.builder: str = data[\"builder\"]\n self.builder_id: int = data[\"builderId\"]\n\n self.is_playable: bool = data[\"isPlayable\"]\n self.reason_prohibited: str = data[\"reasonProhibited\"]\n self.universe: BaseUniverse = BaseUniverse(client=self._client, universe_id=data[\"universeId\"])\n self.universe_root_place: BasePlace = BasePlace(client=self._client, place_id=data[\"universeRootPlaceId\"])\n\n self.price: int = data[\"price\"]\n self.image_token: str = data[\"imageToken\"]\n self.has_verified_badge: bool = data[\"hasVerifiedBadge\"]\n
"},{"location":"reference/places/#roblox.places.Place.__init__","title":"__init__(client, data)
","text":"Parameters:
Name Type Description Defaultclient
Client
The Client object, which is passed to all objects this Client generates.
requireddata
dict
data to make the magic happen.
required Source code inroblox/places.py
def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: The Client object, which is passed to all objects this Client generates.\n data: data to make the magic happen.\n \"\"\"\n super().__init__(client=client, place_id=data[\"placeId\"])\n\n self._client: Client = client\n\n self.id: int = data[\"placeId\"]\n self.name: str = data[\"name\"]\n self.description: str = data[\"description\"]\n self.url: str = data[\"url\"]\n\n self.builder: str = data[\"builder\"]\n self.builder_id: int = data[\"builderId\"]\n\n self.is_playable: bool = data[\"isPlayable\"]\n self.reason_prohibited: str = data[\"reasonProhibited\"]\n self.universe: BaseUniverse = BaseUniverse(client=self._client, universe_id=data[\"universeId\"])\n self.universe_root_place: BasePlace = BasePlace(client=self._client, place_id=data[\"universeRootPlaceId\"])\n\n self.price: int = data[\"price\"]\n self.image_token: str = data[\"imageToken\"]\n self.has_verified_badge: bool = data[\"hasVerifiedBadge\"]\n
"},{"location":"reference/plugins/","title":"plugins","text":"This module contains classes intended to parse and deal with data from Roblox plugin information endpoints.
"},{"location":"reference/plugins/#roblox.plugins.Plugin","title":"Plugin
","text":" Bases: BasePlugin
Represents a Roblox plugin. It is intended to parse data from https://develop.roblox.com/v1/plugins.
Attributes:
Name Type Descriptionid
int
The ID of the plugin.
name
str
The name of the plugin.
description
str
The plugin's description.
comments_enabled
bool
Whether comments are enabled or disabled.
version_id
int
The plugin's current version ID.
created
datetime
When the plugin was created.
updated
datetime
When the plugin was updated.
Source code inroblox/plugins.py
class Plugin(BasePlugin):\n \"\"\"\n Represents a Roblox plugin.\n It is intended to parse data from https://develop.roblox.com/v1/plugins.\n\n Attributes:\n id: The ID of the plugin.\n name: The name of the plugin.\n description: The plugin's description.\n comments_enabled: Whether comments are enabled or disabled.\n version_id: The plugin's current version ID.\n created: When the plugin was created.\n updated: When the plugin was updated.\n \"\"\"\n\n def __init__(self, client: Client, data: dict):\n \"\"\"\n Attributes:\n client: The Client object, which is passed to all objects this Client generates.\n data: data to make the magic happen.\n \"\"\"\n super().__init__(client=client, plugin_id=data[\"id\"])\n\n self.id: int = data[\"id\"]\n self.name: str = data[\"name\"]\n self.description: str = data[\"description\"]\n self.comments_enabled: bool = data[\"commentsEnabled\"]\n self.version_id: int = data[\"versionId\"]\n self.created: datetime = parse(data[\"created\"])\n self.updated: datetime = parse(data[\"updated\"])\n
"},{"location":"reference/plugins/#roblox.plugins.Plugin.__init__","title":"__init__(client, data)
","text":"Attributes:
Name Type Descriptionclient
The Client object, which is passed to all objects this Client generates.
data
data to make the magic happen.
Source code inroblox/plugins.py
def __init__(self, client: Client, data: dict):\n \"\"\"\n Attributes:\n client: The Client object, which is passed to all objects this Client generates.\n data: data to make the magic happen.\n \"\"\"\n super().__init__(client=client, plugin_id=data[\"id\"])\n\n self.id: int = data[\"id\"]\n self.name: str = data[\"name\"]\n self.description: str = data[\"description\"]\n self.comments_enabled: bool = data[\"commentsEnabled\"]\n self.version_id: int = data[\"versionId\"]\n self.created: datetime = parse(data[\"created\"])\n self.updated: datetime = parse(data[\"updated\"])\n
"},{"location":"reference/presence/","title":"presence","text":"This module contains classes intended to parse and deal with data from Roblox presence endpoints.
"},{"location":"reference/presence/#roblox.presence.Presence","title":"Presence
","text":"Represents a user's presence.
Attributes:
Name Type Descriptionuser_presence_type
PresenceType
The type of the presence.
last_location
str
A string representing the user's last location.
place
Optional[BasePlace]
The place the user is playing or editing.
root_place
Optional[BasePlace]
The root place of the parent universe of the last place the user is playing or editing.
job
Optional[BaseJob]
The job of the root place that the user is playing or editing.
universe
Optional[BaseUniverse]
The universe the user is playing or editing.
last_online
datetime
When the user was last online.
user
BaseUser
The user this presence belongs to.
Source code inroblox/presence.py
class Presence:\n \"\"\"\n Represents a user's presence.\n\n Attributes:\n user_presence_type: The type of the presence.\n last_location: A string representing the user's last location.\n place: The place the user is playing or editing.\n root_place: The root place of the parent universe of the last place the user is playing or editing.\n job: The job of the root place that the user is playing or editing.\n universe: The universe the user is playing or editing.\n last_online: When the user was last online.\n user: The user this presence belongs to.\n \"\"\"\n\n def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: Client object.\n data: The data from the request.\n \"\"\"\n self._client: Client = client\n\n self.user_presence_type: PresenceType = PresenceType(data[\"userPresenceType\"])\n self.last_location: str = data[\"lastLocation\"]\n\n self.place: Optional[BasePlace] = BasePlace(\n client=client,\n place_id=data[\"placeId\"]\n ) if data.get(\"placeId\") else None\n\n self.root_place: Optional[BasePlace] = BasePlace(\n client=client,\n place_id=data[\"rootPlaceId\"]\n ) if data.get(\"rootPlaceId\") else None\n\n self.job: Optional[BaseJob] = BaseJob(self._client, data[\"gameId\"]) if data.get(\"gameId\") else None\n\n self.universe: Optional[BaseUniverse] = BaseUniverse(\n client=client,\n universe_id=data[\"universeId\"]\n ) if data.get(\"universeId\") else None\n\n self.user: BaseUser = client.get_base_user(data[\"userId\"])\n self.last_online: datetime = parse(data[\"lastOnline\"])\n\n def __repr__(self):\n return f\"<{self.__class__.__name__} user_presence_type={self.user_presence_type}>\"\n
"},{"location":"reference/presence/#roblox.presence.Presence.__init__","title":"__init__(client, data)
","text":"Parameters:
Name Type Description Defaultclient
Client
Client object.
requireddata
dict
The data from the request.
required Source code inroblox/presence.py
def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: Client object.\n data: The data from the request.\n \"\"\"\n self._client: Client = client\n\n self.user_presence_type: PresenceType = PresenceType(data[\"userPresenceType\"])\n self.last_location: str = data[\"lastLocation\"]\n\n self.place: Optional[BasePlace] = BasePlace(\n client=client,\n place_id=data[\"placeId\"]\n ) if data.get(\"placeId\") else None\n\n self.root_place: Optional[BasePlace] = BasePlace(\n client=client,\n place_id=data[\"rootPlaceId\"]\n ) if data.get(\"rootPlaceId\") else None\n\n self.job: Optional[BaseJob] = BaseJob(self._client, data[\"gameId\"]) if data.get(\"gameId\") else None\n\n self.universe: Optional[BaseUniverse] = BaseUniverse(\n client=client,\n universe_id=data[\"universeId\"]\n ) if data.get(\"universeId\") else None\n\n self.user: BaseUser = client.get_base_user(data[\"userId\"])\n self.last_online: datetime = parse(data[\"lastOnline\"])\n
"},{"location":"reference/presence/#roblox.presence.PresenceProvider","title":"PresenceProvider
","text":"The PresenceProvider is an object that represents https://presence.roblox.com/ and provides multiple functions for fetching user presence information.
Source code inroblox/presence.py
class PresenceProvider:\n \"\"\"\n The PresenceProvider is an object that represents https://presence.roblox.com/ and provides multiple functions\n for fetching user presence information.\n \"\"\"\n\n def __init__(self, client: Client):\n self._client: Client = client\n\n async def get_user_presences(self, users: List[UserOrUserId]) -> List[Presence]:\n \"\"\"\n Grabs a list of Presence objects corresponding to each user in the list.\n\n Arguments:\n users: The list of users you want to get Presences from.\n\n Returns:\n A list of Presences.\n \"\"\"\n\n presences_response = await self._client.requests.post(\n url=self._client.url_generator.get_url(\"presence\", \"v1/presence/users\"),\n json={\n \"userIds\": list(map(int, users))\n }\n )\n presences_data = presences_response.json()[\"userPresences\"]\n return [Presence(client=self._client, data=presence_data) for presence_data in presences_data]\n
"},{"location":"reference/presence/#roblox.presence.PresenceProvider.get_user_presences","title":"get_user_presences(users)
async
","text":"Grabs a list of Presence objects corresponding to each user in the list.
Parameters:
Name Type Description Defaultusers
List[UserOrUserId]
The list of users you want to get Presences from.
requiredReturns:
Type DescriptionList[Presence]
A list of Presences.
Source code inroblox/presence.py
async def get_user_presences(self, users: List[UserOrUserId]) -> List[Presence]:\n \"\"\"\n Grabs a list of Presence objects corresponding to each user in the list.\n\n Arguments:\n users: The list of users you want to get Presences from.\n\n Returns:\n A list of Presences.\n \"\"\"\n\n presences_response = await self._client.requests.post(\n url=self._client.url_generator.get_url(\"presence\", \"v1/presence/users\"),\n json={\n \"userIds\": list(map(int, users))\n }\n )\n presences_data = presences_response.json()[\"userPresences\"]\n return [Presence(client=self._client, data=presence_data) for presence_data in presences_data]\n
"},{"location":"reference/presence/#roblox.presence.PresenceType","title":"PresenceType
","text":" Bases: IntEnum
Represents a user's presence type.
Source code inroblox/presence.py
class PresenceType(IntEnum):\n \"\"\"\n Represents a user's presence type.\n \"\"\"\n offline = 0\n online = 1\n in_game = 2\n in_studio = 3\n
"},{"location":"reference/promotionchannels/","title":"promotionchannels","text":"This module contains classes intended to parse and deal with data from Roblox promotion channel endpoints.
"},{"location":"reference/promotionchannels/#roblox.promotionchannels.UserPromotionChannels","title":"UserPromotionChannels
","text":"Represents a user's promotion channels.
Attributes:
Name Type Descriptionfacebook
Optional[str]
A link to the user's Facebook profile.
twitter
Optional[str]
A Twitter handle.
youtube
Optional[str]
A link to the user's YouTube channel.
twitch
Optional[str]
A link to the user's Twitch channel.
Source code inroblox/promotionchannels.py
class UserPromotionChannels:\n \"\"\"\n Represents a user's promotion channels.\n\n Attributes:\n facebook: A link to the user's Facebook profile.\n twitter: A Twitter handle.\n youtube: A link to the user's YouTube channel.\n twitch: A link to the user's Twitch channel.\n \"\"\"\n\n def __init__(self, data: dict):\n self.facebook: Optional[str] = data[\"facebook\"]\n self.twitter: Optional[str] = data[\"twitter\"]\n self.youtube: Optional[str] = data[\"youtube\"]\n self.twitch: Optional[str] = data[\"twitch\"]\n self.guilded: Optional[str] = data[\"guilded\"]\n\n def __repr__(self):\n return f\"<{self.__class__.__name__}>\"\n
"},{"location":"reference/resale/","title":"resale","text":"Contains classes related to Roblox resale.
"},{"location":"reference/resale/#roblox.resale.AssetResaleData","title":"AssetResaleData
","text":"Represents an asset's resale data.
Attributes:
Name Type Descriptionasset_stock
int
The asset's stock.
sales
int
The asset's sales.
number_remaining
int
On a Limited U item that hasn't ran out, this is the amount remaining.
recent_average_price
int
The item's recent average price.
original_price
int
What price this item was originally sold at.
price_data_points
List[dict]
A list of tuples containing a limited item's price points over time.
Source code inroblox/resale.py
class AssetResaleData:\n \"\"\"\n Represents an asset's resale data.\n\n Attributes:\n asset_stock: The asset's stock.\n sales: The asset's sales.\n number_remaining: On a Limited U item that hasn't ran out, this is the amount remaining.\n recent_average_price: The item's recent average price.\n original_price: What price this item was originally sold at.\n price_data_points: A list of tuples containing a limited item's price points over time.\n \"\"\"\n\n def __init__(self, data: dict):\n self.asset_stock: int = data[\"assetStock\"]\n self.sales: int = data[\"sales\"]\n self.number_remaining: int = data[\"numberRemaining\"]\n self.recent_average_price: int = data[\"recentAveragePrice\"]\n self.original_price: int = data[\"originalPrice\"]\n self.price_data_points: List[dict] = data[\"priceDataPoints\"]\n
"},{"location":"reference/robloxbadges/","title":"robloxbadges","text":"This module contains classes intended to parse and deal with data from Roblox badge endpoints.
"},{"location":"reference/robloxbadges/#roblox.robloxbadges.RobloxBadge","title":"RobloxBadge
","text":" Bases: BaseRobloxBadge
Represents a Roblox roblox badge.
Attributes:
Name Type Descriptionid
int
The badge's ID.
name
str
The badge's name.
description
str
The badge's description.
image_url
str
A link to the badge's image.
Source code inroblox/robloxbadges.py
class RobloxBadge(BaseRobloxBadge):\n \"\"\"\n Represents a Roblox roblox badge.\n\n Attributes:\n id: The badge's ID.\n name: The badge's name.\n description: The badge's description.\n image_url: A link to the badge's image.\n \"\"\"\n\n def __init__(self, client: Client, data: dict):\n self._client: Client = client\n self.id: int = data[\"id\"]\n super().__init__(client=self._client, roblox_badge_id=self.id)\n\n self.name: str = data[\"name\"]\n self.description: str = data[\"description\"]\n self.image_url: str = data[\"imageUrl\"]\n
"},{"location":"reference/roles/","title":"roles","text":"This module contains classes intended to parse and deal with data from Roblox group role endpoints.
"},{"location":"reference/roles/#roblox.roles.Role","title":"Role
","text":" Bases: BaseRole
Represents a Roblox group's role.
Attributes:
Name Type Descriptionid
int
The role's ID.
group
Optional[BaseGroup]
The group that this role is a part of.
name
str
The role's name.
description
Optional[str]
The role's description.
rank
int
The rank, from 0-255, of this role.
member_count
Optional[int]
How many members exist with this role.
Source code inroblox/roles.py
class Role(BaseRole):\n \"\"\"\n Represents a Roblox group's role.\n\n Attributes:\n id: The role's ID.\n group: The group that this role is a part of.\n name: The role's name.\n description: The role's description.\n rank: The rank, from 0-255, of this role.\n member_count: How many members exist with this role.\n \"\"\"\n\n def __init__(self, client: Client, data: dict, group: BaseGroup = None):\n \"\"\"\n Arguments:\n client: The Client object.\n data: The raw role data.\n group: The parent group.\n \"\"\"\n self._client: Client = client\n\n self.id: int = data[\"id\"]\n super().__init__(client=self._client, role_id=self.id)\n\n self.group: Optional[BaseGroup] = group\n self.name: str = data[\"name\"]\n self.description: Optional[str] = data.get(\"description\")\n self.rank: int = data[\"rank\"]\n self.member_count: Optional[int] = data.get(\"memberCount\")\n\n def get_members(self, page_size: int = 10, sort_order: SortOrder = SortOrder.Ascending,\n max_items: int = None) -> PageIterator:\n \"\"\"\n Gets all members with this role.\n\n Arguments:\n page_size: How many users should be returned for each page.\n sort_order: Order in which data should be grabbed.\n max_items: The maximum items to return when looping through this object.\n\n Returns:\n A PageIterator containing all members with this role.\n \"\"\"\n return PageIterator(\n client=self._client,\n url=self._client.url_generator.get_url(\"groups\", f\"v1/groups/{self.group.id}/roles/{self.id}/users\"),\n page_size=page_size,\n sort_order=sort_order,\n max_items=max_items,\n handler=lambda client, data: PartialUser(client=client, data=data)\n )\n
"},{"location":"reference/roles/#roblox.roles.Role.__init__","title":"__init__(client, data, group=None)
","text":"Parameters:
Name Type Description Defaultclient
Client
The Client object.
requireddata
dict
The raw role data.
requiredgroup
BaseGroup
The parent group.
None
Source code in roblox/roles.py
def __init__(self, client: Client, data: dict, group: BaseGroup = None):\n \"\"\"\n Arguments:\n client: The Client object.\n data: The raw role data.\n group: The parent group.\n \"\"\"\n self._client: Client = client\n\n self.id: int = data[\"id\"]\n super().__init__(client=self._client, role_id=self.id)\n\n self.group: Optional[BaseGroup] = group\n self.name: str = data[\"name\"]\n self.description: Optional[str] = data.get(\"description\")\n self.rank: int = data[\"rank\"]\n self.member_count: Optional[int] = data.get(\"memberCount\")\n
"},{"location":"reference/roles/#roblox.roles.Role.get_members","title":"get_members(page_size=10, sort_order=SortOrder.Ascending, max_items=None)
","text":"Gets all members with this role.
Parameters:
Name Type Description Defaultpage_size
int
How many users should be returned for each page.
10
sort_order
SortOrder
Order in which data should be grabbed.
Ascending
max_items
int
The maximum items to return when looping through this object.
None
Returns:
Type DescriptionPageIterator
A PageIterator containing all members with this role.
Source code inroblox/roles.py
def get_members(self, page_size: int = 10, sort_order: SortOrder = SortOrder.Ascending,\n max_items: int = None) -> PageIterator:\n \"\"\"\n Gets all members with this role.\n\n Arguments:\n page_size: How many users should be returned for each page.\n sort_order: Order in which data should be grabbed.\n max_items: The maximum items to return when looping through this object.\n\n Returns:\n A PageIterator containing all members with this role.\n \"\"\"\n return PageIterator(\n client=self._client,\n url=self._client.url_generator.get_url(\"groups\", f\"v1/groups/{self.group.id}/roles/{self.id}/users\"),\n page_size=page_size,\n sort_order=sort_order,\n max_items=max_items,\n handler=lambda client, data: PartialUser(client=client, data=data)\n )\n
"},{"location":"reference/shout/","title":"shout","text":"Contains the Shout object, which represents a group's shout.
"},{"location":"reference/shout/#roblox.shout.Shout","title":"Shout
","text":"Represents a Group Shout.
Attributes:
Name Type Descriptionbody
str
The text of the shout.
created
datetime
When the shout was created.
updated
datetime
When the shout was updated.
poster
PartialUser
Who posted the shout.
Source code inroblox/shout.py
class Shout:\n \"\"\"\n Represents a Group Shout.\n\n Attributes:\n body: The text of the shout.\n created: When the shout was created.\n updated: When the shout was updated.\n poster: Who posted the shout.\n \"\"\"\n\n def __init__(\n self,\n client: Client,\n data: dict\n ):\n \"\"\"\n Arguments:\n client: Client object.\n data: The data from the request.\n \"\"\"\n self._client: Client = client\n\n self.body: str = data[\"body\"]\n self.created: datetime = parse(data[\"created\"])\n self.updated: datetime = parse(data[\"updated\"])\n self.poster: PartialUser = PartialUser(\n client=self._client,\n data=data[\"poster\"]\n )\n\n def __repr__(self):\n return f\"<{self.__class__.__name__} created={self.created} updated={self.updated} body={self.body!r} \" \\\n f\"poster={self.poster!r}>\"\n
"},{"location":"reference/shout/#roblox.shout.Shout.__init__","title":"__init__(client, data)
","text":"Parameters:
Name Type Description Defaultclient
Client
Client object.
requireddata
dict
The data from the request.
required Source code inroblox/shout.py
def __init__(\n self,\n client: Client,\n data: dict\n):\n \"\"\"\n Arguments:\n client: Client object.\n data: The data from the request.\n \"\"\"\n self._client: Client = client\n\n self.body: str = data[\"body\"]\n self.created: datetime = parse(data[\"created\"])\n self.updated: datetime = parse(data[\"updated\"])\n self.poster: PartialUser = PartialUser(\n client=self._client,\n data=data[\"poster\"]\n )\n
"},{"location":"reference/sociallinks/","title":"sociallinks","text":"Contains objects related to Roblox social links.
"},{"location":"reference/sociallinks/#roblox.sociallinks.SocialLink","title":"SocialLink
","text":" Bases: BaseUniverseSocialLink
Represents a universe or group's social links.
Attributes:
Name Type Descriptionid
int
The social link's ID.
title
str
The social link's title.
url
str
The social link's URL.
type
SocialLinkType
The social link's type.
Source code inroblox/sociallinks.py
class SocialLink(BaseUniverseSocialLink):\n \"\"\"\n Represents a universe or group's social links.\n\n Attributes:\n id: The social link's ID.\n title: The social link's title.\n url: The social link's URL.\n type: The social link's type.\n \"\"\"\n\n def __init__(self, client: Client, data: dict):\n self._client: Client = client\n self.id: int = data[\"id\"]\n super().__init__(client=self._client, social_link_id=self.id)\n self.title: str = data[\"title\"]\n self.url: str = data[\"url\"]\n self.type: SocialLinkType = SocialLinkType(data[\"type\"])\n
"},{"location":"reference/sociallinks/#roblox.sociallinks.SocialLinkType","title":"SocialLinkType
","text":" Bases: Enum
Represents a type of social link.
Source code inroblox/sociallinks.py
class SocialLinkType(Enum):\n \"\"\"\n Represents a type of social link.\n \"\"\"\n\n facebook = \"Facebook\"\n twitter = \"Twitter\"\n youtube = \"YouTube\"\n twitch = \"Twitch\"\n discord = \"Discord\"\n roblox_group = \"RobloxGroup\"\n
"},{"location":"reference/threedthumbnails/","title":"threedthumbnails","text":"Contains classes related to 3D thumbnails.
"},{"location":"reference/threedthumbnails/#roblox.threedthumbnails.ThreeDThumbnail","title":"ThreeDThumbnail
","text":"Represents a user's 3D Thumbnail data. For more info, see https://robloxapi.wiki/wiki/3D_Thumbnails.
Attributes:
Name Type Descriptionmtl
ThumbnailCDNHash
A CDN hash pointing to the MTL data.
obj
ThumbnailCDNHash
A CDN hash pointing to the OBJ data.
textures
List[ThumbnailCDNHash]
A list of CDN hashes pointing to PNG texture data.
camera
ThreeDThumbnailCamera
The camera object.
aabb
ThreeDThumbnailAABB
The AABB object.
Source code inroblox/threedthumbnails.py
class ThreeDThumbnail:\n \"\"\"\n Represents a user's 3D Thumbnail data.\n For more info, see https://robloxapi.wiki/wiki/3D_Thumbnails.\n\n Attributes:\n mtl: A CDN hash pointing to the MTL data.\n obj: A CDN hash pointing to the OBJ data.\n textures: A list of CDN hashes pointing to PNG texture data.\n camera: The camera object.\n aabb: The AABB object.\n \"\"\"\n\n def __init__(self, client: Client, data: dict):\n self._client: Client = client\n\n self.mtl: ThumbnailCDNHash = self._client.delivery.get_thumbnail_cdn_hash(data[\"mtl\"])\n self.obj: ThumbnailCDNHash = self._client.delivery.get_thumbnail_cdn_hash(data[\"obj\"])\n self.textures: List[ThumbnailCDNHash] = [\n self._client.delivery.get_thumbnail_cdn_hash(cdn_hash) for cdn_hash in data[\"textures\"]\n ]\n self.camera: ThreeDThumbnailCamera = ThreeDThumbnailCamera(data[\"camera\"])\n self.aabb: ThreeDThumbnailAABB = ThreeDThumbnailAABB(data[\"aabb\"])\n
"},{"location":"reference/threedthumbnails/#roblox.threedthumbnails.ThreeDThumbnailAABB","title":"ThreeDThumbnailAABB
","text":"Represents AABB data in a 3D thumbnail. Roblox uses this data to calculate the maximum render distance used when rendering 3D thumbnails.
THREE.Vector3(json.aabb.max.x, json.aabb.max.y, json.aabb.max.z).length() * 4;\n
Attributes:
Name Type Descriptionmin
ThreeDThumbnailVector3
The minimum render position.
max
ThreeDThumbnailVector3
The maximum render position.
Source code inroblox/threedthumbnails.py
class ThreeDThumbnailAABB:\n \"\"\"\n Represents AABB data in a 3D thumbnail.\n Roblox uses this data to calculate the maximum render distance used when rendering 3D thumbnails.\n ```js\n THREE.Vector3(json.aabb.max.x, json.aabb.max.y, json.aabb.max.z).length() * 4;\n ```\n\n Attributes:\n min: The minimum render position.\n max: The maximum render position.\n \"\"\"\n\n def __init__(self, data: dict):\n self.min: ThreeDThumbnailVector3 = ThreeDThumbnailVector3(data[\"min\"])\n self.max: ThreeDThumbnailVector3 = ThreeDThumbnailVector3(data[\"max\"])\n
"},{"location":"reference/threedthumbnails/#roblox.threedthumbnails.ThreeDThumbnailCamera","title":"ThreeDThumbnailCamera
","text":"Represents a camera in a 3D thumbnail.
Attributes:
Name Type Descriptionfov
float
The camera's field of view.
position
ThreeDThumbnailVector3
The camera's position.
direction
ThreeDThumbnailVector3
The camera's direction.
Source code inroblox/threedthumbnails.py
class ThreeDThumbnailCamera:\n \"\"\"\n Represents a camera in a 3D thumbnail.\n\n Attributes:\n fov: The camera's field of view.\n position: The camera's position.\n direction: The camera's direction.\n \"\"\"\n\n def __init__(self, data: dict):\n self.fov: float = data[\"fov\"]\n self.position: ThreeDThumbnailVector3 = ThreeDThumbnailVector3(data[\"position\"])\n self.direction: ThreeDThumbnailVector3 = ThreeDThumbnailVector3(data[\"direction\"])\n
"},{"location":"reference/threedthumbnails/#roblox.threedthumbnails.ThreeDThumbnailVector3","title":"ThreeDThumbnailVector3
","text":"Represents a Vector3 used in a 3D thumbnail.
Attributes:
Name Type Descriptionx
float
The X component of the vector.
y
float
The Y component of the vector.
z
float
The Z component of the vector.
Source code inroblox/threedthumbnails.py
class ThreeDThumbnailVector3:\n \"\"\"\n Represents a Vector3 used in a 3D thumbnail.\n\n Attributes:\n x: The X component of the vector.\n y: The Y component of the vector.\n z: The Z component of the vector.\n \"\"\"\n\n def __init__(self, data: dict):\n self.x: float = data[\"x\"]\n self.y: float = data[\"y\"]\n self.z: float = data[\"z\"]\n
"},{"location":"reference/thumbnails/","title":"thumbnails","text":"Contains objects related to Roblox thumbnails.
"},{"location":"reference/thumbnails/#roblox.thumbnails.AvatarThumbnailType","title":"AvatarThumbnailType
","text":" Bases: Enum
Type of avatar thumbnail.
Source code inroblox/thumbnails.py
class AvatarThumbnailType(Enum):\n \"\"\"\n Type of avatar thumbnail.\n \"\"\"\n\n full_body = \"full_body\"\n headshot = \"headshot\"\n bust = \"bust\"\n
"},{"location":"reference/thumbnails/#roblox.thumbnails.Thumbnail","title":"Thumbnail
","text":"Represents a Roblox thumbnail as returned by almost all endpoints on https://thumbnails.roblox.com/.
Attributes:
Name Type Descriptiontarget_id
int
The id of the target of the image.
state
ThumbnailState
The current state of the image.
image_url
Optional[str]
Url of the image.
Source code inroblox/thumbnails.py
class Thumbnail:\n \"\"\"\n Represents a Roblox thumbnail as returned by almost all endpoints on https://thumbnails.roblox.com/.\n\n Attributes:\n target_id: The id of the target of the image.\n state: The current state of the image.\n image_url: Url of the image.\n \"\"\"\n\n def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: Client object.\n data: The data from the request.\n \"\"\"\n self._client: Client = client\n\n self.target_id: int = data[\"targetId\"]\n self.state: ThumbnailState = ThumbnailState(data[\"state\"])\n self.image_url: Optional[str] = data[\"imageUrl\"]\n\n def __repr__(self):\n return f\"<{self.__class__.__name__} target_id={self.target_id} name={self.state!r} \" \\\n f\"image_url={self.image_url!r}>\"\n\n async def get_3d_data(self) -> ThreeDThumbnail:\n \"\"\"\n Generates 3D thumbnail data for this endpoint.\n\n Returns:\n A ThreeDThumbnail.\n \"\"\"\n threed_response = await self._client.requests.get(\n url=self.image_url\n )\n threed_data = threed_response.json()\n return ThreeDThumbnail(\n client=self._client,\n data=threed_data\n )\n
"},{"location":"reference/thumbnails/#roblox.thumbnails.Thumbnail.__init__","title":"__init__(client, data)
","text":"Parameters:
Name Type Description Defaultclient
Client
Client object.
requireddata
dict
The data from the request.
required Source code inroblox/thumbnails.py
def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: Client object.\n data: The data from the request.\n \"\"\"\n self._client: Client = client\n\n self.target_id: int = data[\"targetId\"]\n self.state: ThumbnailState = ThumbnailState(data[\"state\"])\n self.image_url: Optional[str] = data[\"imageUrl\"]\n
"},{"location":"reference/thumbnails/#roblox.thumbnails.Thumbnail.get_3d_data","title":"get_3d_data()
async
","text":"Generates 3D thumbnail data for this endpoint.
Returns:
Type DescriptionThreeDThumbnail
A ThreeDThumbnail.
Source code inroblox/thumbnails.py
async def get_3d_data(self) -> ThreeDThumbnail:\n \"\"\"\n Generates 3D thumbnail data for this endpoint.\n\n Returns:\n A ThreeDThumbnail.\n \"\"\"\n threed_response = await self._client.requests.get(\n url=self.image_url\n )\n threed_data = threed_response.json()\n return ThreeDThumbnail(\n client=self._client,\n data=threed_data\n )\n
"},{"location":"reference/thumbnails/#roblox.thumbnails.ThumbnailFormat","title":"ThumbnailFormat
","text":" Bases: Enum
Format returned by the endpoint.
Source code inroblox/thumbnails.py
class ThumbnailFormat(Enum):\n \"\"\"\n Format returned by the endpoint.\n \"\"\"\n\n png = \"Png\"\n jpeg = \"Jpeg\"\n
"},{"location":"reference/thumbnails/#roblox.thumbnails.ThumbnailProvider","title":"ThumbnailProvider
","text":"The ThumbnailProvider that provides multiple functions for generating user thumbnails.
Source code inroblox/thumbnails.py
class ThumbnailProvider:\n \"\"\"\n The ThumbnailProvider that provides multiple functions for generating user thumbnails.\n \"\"\"\n\n def __init__(self, client: Client):\n \"\"\"\n Arguments:\n client: Client object.\n \"\"\"\n self._client: Client = client\n\n async def get_asset_thumbnails(\n self,\n assets: List[AssetOrAssetId],\n return_policy: ThumbnailReturnPolicy = ThumbnailReturnPolicy.place_holder,\n size: SizeTupleOrString = (30, 30),\n image_format: ThumbnailFormat = ThumbnailFormat.png,\n is_circular: bool = False,\n ) -> List[Thumbnail]:\n \"\"\"\n Returns asset thumbnails for the asset ID passed.\n Supported sizes: \n - 30x30 \n - 42x42 \n - 50x50 \n - 60x62 \n - 75x75 \n - 110x110 \n - 140x140 \n - 150x150 \n - 160x100 \n - 160x600 \n - 250x250 \n - 256x144 \n - 300x250 \n - 304x166 \n - 384x216 \n - 396x216 \n - 420x420 \n - 480x270 \n - 512x512 \n - 576x324 \n - 700x700 \n - 728x90 \n - 768x432 \n\n Arguments:\n assets: Assets you want the thumbnails of.\n return_policy: How you want it returns look at enum.\n size: size of the image.\n image_format: Format of the image.\n is_circular: if the image is a circle yes or no.\n\n Returns:\n A list of Thumbnails.\n \"\"\"\n thumbnails_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"thumbnails\", \"v1/assets\"),\n params={\n \"assetIds\": list(map(int, assets)),\n \"returnPolicy\": return_policy.value,\n \"size\": _to_size_string(size),\n \"format\": image_format.value,\n \"isCircular\": is_circular,\n },\n )\n thumbnails_data = thumbnails_response.json()[\"data\"]\n return [\n Thumbnail(client=self._client, data=thumbnail_data)\n for thumbnail_data in thumbnails_data\n ]\n\n async def get_asset_thumbnail_3d(self, asset: AssetOrAssetId) -> Thumbnail:\n \"\"\"\n Returns a 3D asset thumbnail for the user ID passed.\n\n Arguments:\n asset: Asset you want the thumbnails of.\n\n Returns:\n A Thumbnail.\n \"\"\"\n thumbnail_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\n \"thumbnails\", \"v1/assets-thumbnail-3d\"\n ),\n params={\"assetId\": int(asset)},\n )\n thumbnail_data = thumbnail_response.json()\n return Thumbnail(client=self._client, data=thumbnail_data)\n\n async def get_badge_icons(\n self,\n badges: List[BadgeOrBadgeId],\n size: SizeTupleOrString = (150, 150),\n image_format: ThumbnailFormat = ThumbnailFormat.png,\n is_circular: bool = False,\n ) -> List[Thumbnail]:\n \"\"\"\n Returns badge icons for each badge ID passed.\n Supported sizes: \n - 150x150 \n\n Arguments:\n badges: Badges you want the thumbnails of.\n size: size of the image.\n image_format: Format of the image.\n is_circular: if the image is a circle yes or no.\n\n Returns:\n A list of Thumbnails.\n \"\"\"\n thumbnails_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"thumbnails\", \"v1/badges/icons\"),\n params={\n \"badgeIds\": list(map(int, badges)),\n \"size\": _to_size_string(size),\n \"format\": image_format.value,\n \"isCircular\": is_circular,\n },\n )\n thumbnails_data = thumbnails_response.json()[\"data\"]\n return [\n Thumbnail(client=self._client, data=thumbnail_data)\n for thumbnail_data in thumbnails_data\n ]\n\n async def get_gamepass_icons(\n self,\n gamepasses: List[GamePassOrGamePassId],\n # TODO Make size enum\n size: SizeTupleOrString = (150, 150),\n image_format: ThumbnailFormat = ThumbnailFormat.png,\n is_circular: bool = False,\n ) -> List[Thumbnail]:\n \"\"\"\n Returns gamepass icons for each gamepass ID passed.\n Supported sizes: \n - 150x150 \n\n Arguments:\n gamepasses: Gamepasses you want the thumbnails of.\n size: size of the image.\n image_format: Format of the image.\n is_circular: If the image is a circle yes or no.\n\n Returns:\n A list of Thumbnails.\n \"\"\"\n thumbnails_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"thumbnails\", \"v1/game-passes\"),\n params={\n \"gamePassIds\": list(map(int, gamepasses)),\n \"size\": _to_size_string(size),\n \"format\": image_format.value,\n \"isCircular\": is_circular,\n },\n )\n thumbnails_data = thumbnails_response.json()[\"data\"]\n return [\n Thumbnail(client=self._client, data=thumbnail_data)\n for thumbnail_data in thumbnails_data\n ]\n\n async def get_universe_icons(\n self,\n universes: List[UniverseOrUniverseId],\n return_policy: ThumbnailReturnPolicy = ThumbnailReturnPolicy.place_holder,\n size: SizeTupleOrString = (50, 50),\n image_format: ThumbnailFormat = ThumbnailFormat.png,\n is_circular: bool = False,\n ) -> List[Thumbnail]:\n \"\"\"\n Returns universe icons for each universe ID passed.\n Supported sizes: \n - 50x50 \n - 128x128 \n - 150x150 \n - 256x256 \n - 512x512 \n - 768x432 \n\n Arguments:\n universes: Universes you want the thumbnails of.\n return_policy: How you want it returns look at enum.\n size: size of the image.\n image_format: Format of the image.\n is_circular: If the image is a circle yes or no.\n\n Returns:\n A list of Thumbnails.\n \"\"\"\n thumbnails_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"thumbnails\", \"v1/games/icons\"),\n params={\n \"universeIds\": list(map(int, universes)),\n \"returnPolicy\": return_policy.value,\n \"size\": _to_size_string(size),\n \"format\": image_format.value,\n \"isCircular\": is_circular,\n },\n )\n thumbnails_data = thumbnails_response.json()[\"data\"]\n return [\n Thumbnail(client=self._client, data=thumbnail_data)\n for thumbnail_data in thumbnails_data\n ]\n\n async def get_universe_thumbnails(\n self,\n universes: List[UniverseOrUniverseId],\n size: SizeTupleOrString = (768, 432),\n image_format: ThumbnailFormat = ThumbnailFormat.png,\n is_circular: bool = False,\n count_per_universe: int = None,\n defaults: bool = None,\n ) -> List[UniverseThumbnails]:\n \"\"\"\n Returns universe thumbnails for each universe ID passed.\n Supported sizes: \n - 768x432 \n - 576x324 \n - 480x270 \n - 384x216 \n - 256x144 \n\n Arguments:\n universes: Universes you want the thumbnails of.\n size: size of the image.\n image_format: Format of the image.\n count_per_universe: Unknown.\n is_circular: If the image is a circle yes or no.\n defaults: Whether to return default thumbnails.\n\n Returns:\n A list of Thumbnails.\n \"\"\"\n thumbnails_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\n \"thumbnails\", \"v1/games/multiget/thumbnails\"\n ),\n params={\n \"universeIds\": list(map(int, universes)),\n \"countPerUniverse\": count_per_universe,\n \"defaults\": defaults,\n \"size\": _to_size_string(size),\n \"format\": image_format.value,\n \"isCircular\": is_circular,\n },\n )\n thumbnails_data = thumbnails_response.json()[\"data\"]\n return [\n UniverseThumbnails(client=self._client, data=thumbnail_data)\n for thumbnail_data in thumbnails_data\n ]\n\n async def get_group_icons(\n self,\n groups: List[GroupOrGroupId],\n size: SizeTupleOrString = (150, 150),\n image_format: ThumbnailFormat = ThumbnailFormat.png,\n is_circular: bool = False,\n ) -> List[Thumbnail]:\n \"\"\"\n Returns icons for each group ID passed.\n Supported sizes: \n - 150x150 \n - 420x420 \n\n Arguments:\n groups: Groups you want the thumbnails of.\n size: size of the image.\n image_format: Format of the image.\n is_circular: If the image is a circle yes or no.\n\n Returns:\n A list of Thumbnails.\n \"\"\"\n thumbnails_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"thumbnails\", \"v1/groups/icons\"),\n params={\n \"groupIds\": list(map(int, groups)),\n \"size\": _to_size_string(size),\n \"format\": image_format.value,\n \"isCircular\": is_circular,\n },\n )\n thumbnails_data = thumbnails_response.json()[\"data\"]\n return [\n Thumbnail(client=self._client, data=thumbnail_data)\n for thumbnail_data in thumbnails_data\n ]\n\n async def get_place_icons(\n self,\n places: List[PlaceOrPlaceId],\n return_policy: ThumbnailReturnPolicy = ThumbnailReturnPolicy.place_holder,\n size: SizeTupleOrString = (50, 50),\n image_format: ThumbnailFormat = ThumbnailFormat.png,\n is_circular: bool = False,\n ) -> List[Thumbnail]:\n \"\"\"\n Returns icons for each place ID passed.\n Supported sizes: \n - 50x50 \n - 128x128 \n - 150x150 \n - 256x256 \n - 512x512 \n - 768x432 \n\n Arguments:\n places: Places you want the thumbnails of.\n return_policy: How you want it returns look at enum.\n size: size of the image.\n image_format: Format of the image.\n is_circular: if the image is a circle yes or no.\n Returns:\n A List of Thumbnails.\n \"\"\"\n thumbnails_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"thumbnails\", \"v1/places/gameicons\"),\n params={\n \"placeIds\": list(map(int, places)),\n \"returnPolicy\": return_policy.value,\n \"size\": _to_size_string(size),\n \"format\": image_format.value,\n \"isCircular\": is_circular,\n },\n )\n thumbnails_data = thumbnails_response.json()[\"data\"]\n return [\n Thumbnail(client=self._client, data=thumbnail_data)\n for thumbnail_data in thumbnails_data\n ]\n\n async def get_user_avatar_thumbnails(\n self,\n users: List[UserOrUserId],\n type: AvatarThumbnailType = AvatarThumbnailType.full_body,\n size: SizeTupleOrString = None,\n image_format: ThumbnailFormat = ThumbnailFormat.png,\n is_circular: bool = False,\n ) -> List[Thumbnail]:\n \"\"\"\n Returns avatar thumbnails for each user ID passed.\n The valid sizes depend on the `type` parameter.\n\n | Size | full_body | headshot | bust |\n |---|---|---|---|\n | 30x30 | \u2714\ufe0f | \u274c | \u274c |\n | 48x48 | \u2714\ufe0f | \u2714\ufe0f | \u2714\ufe0f |\n | 50x50 | \u274c | \u2714\ufe0f | \u2714\ufe0f |\n | 60x60 | \u2714\ufe0f | \u2714\ufe0f | \u2714\ufe0f |\n | 75x75 | \u2714\ufe0f | \u2714\ufe0f | \u2714\ufe0f |\n | 100x100 | \u2714\ufe0f | \u2714\ufe0f | \u2714\ufe0f |\n | 110x110 | \u2714\ufe0f | \u2714\ufe0f | \u274c |\n | 140x140 | \u2714\ufe0f | \u274c | \u274c |\n | 150x150 | \u2714\ufe0f | \u2714\ufe0f | \u2714\ufe0f |\n | 150x200 | \u2714\ufe0f | \u274c | \u274c |\n | 180x180 | \u2714\ufe0f | \u2714\ufe0f | \u2714\ufe0f |\n | 250x250 | \u2714\ufe0f | \u274c | \u274c |\n | 352x352 | \u2714\ufe0f | \u2714\ufe0f | \u2714\ufe0f |\n | 420x420 | \u2714\ufe0f | \u2714\ufe0f | \u2714\ufe0f |\n | 720x720 | \u2714\ufe0f | \u274c | \u274c |\n\n Arguments:\n users: Id of the users you want the thumbnails of.\n type: Type of avatar thumbnail you want look at enum.\n size: size of the image.\n image_format: Format of the image.\n is_circular: If the image is a circle yes or no.\n\n Returns:\n A list of Thumbnails.\n \"\"\"\n uri: str\n if type == AvatarThumbnailType.full_body:\n uri = \"avatar\"\n size = size or (30, 30)\n elif type == AvatarThumbnailType.bust:\n uri = \"avatar-bust\"\n size = size or (48, 48)\n elif type == AvatarThumbnailType.headshot:\n uri = \"avatar-headshot\"\n size = size or (48, 48)\n else:\n raise ValueError(\"Avatar type is invalid.\")\n\n thumbnails_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"thumbnails\", f\"v1/users/{uri}\"),\n params={\n \"userIds\": list(map(int, users)),\n \"size\": _to_size_string(size),\n \"format\": image_format.value,\n \"isCircular\": is_circular,\n },\n )\n\n thumbnails_data = thumbnails_response.json()[\"data\"]\n return [\n Thumbnail(client=self._client, data=thumbnail_data)\n for thumbnail_data in thumbnails_data\n ]\n\n async def get_user_avatar_thumbnail_3d(self, user: UserOrUserId) -> Thumbnail:\n \"\"\"\n Returns the user's thumbnail in 3d.\n\n Arguments:\n user: User you want the 3d thumbnail of.\n\n Returns:\n A Thumbnail.\n \"\"\"\n thumbnail_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"thumbnails\", \"v1/users/avatar-3d\"),\n params={\n \"userId\": int(user)\n },\n )\n thumbnail_data = thumbnail_response.json()\n return Thumbnail(client=self._client, data=thumbnail_data)\n
"},{"location":"reference/thumbnails/#roblox.thumbnails.ThumbnailProvider.__init__","title":"__init__(client)
","text":"Parameters:
Name Type Description Defaultclient
Client
Client object.
required Source code inroblox/thumbnails.py
def __init__(self, client: Client):\n \"\"\"\n Arguments:\n client: Client object.\n \"\"\"\n self._client: Client = client\n
"},{"location":"reference/thumbnails/#roblox.thumbnails.ThumbnailProvider.get_asset_thumbnail_3d","title":"get_asset_thumbnail_3d(asset)
async
","text":"Returns a 3D asset thumbnail for the user ID passed.
Parameters:
Name Type Description Defaultasset
AssetOrAssetId
Asset you want the thumbnails of.
requiredReturns:
Type DescriptionThumbnail
A Thumbnail.
Source code inroblox/thumbnails.py
async def get_asset_thumbnail_3d(self, asset: AssetOrAssetId) -> Thumbnail:\n \"\"\"\n Returns a 3D asset thumbnail for the user ID passed.\n\n Arguments:\n asset: Asset you want the thumbnails of.\n\n Returns:\n A Thumbnail.\n \"\"\"\n thumbnail_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\n \"thumbnails\", \"v1/assets-thumbnail-3d\"\n ),\n params={\"assetId\": int(asset)},\n )\n thumbnail_data = thumbnail_response.json()\n return Thumbnail(client=self._client, data=thumbnail_data)\n
"},{"location":"reference/thumbnails/#roblox.thumbnails.ThumbnailProvider.get_asset_thumbnails","title":"get_asset_thumbnails(assets, return_policy=ThumbnailReturnPolicy.place_holder, size=(30, 30), image_format=ThumbnailFormat.png, is_circular=False)
async
","text":"Returns asset thumbnails for the asset ID passed. Supported sizes: - 30x30 - 42x42 - 50x50 - 60x62 - 75x75 - 110x110 - 140x140 - 150x150 - 160x100 - 160x600 - 250x250 - 256x144 - 300x250 - 304x166 - 384x216 - 396x216 - 420x420 - 480x270 - 512x512 - 576x324 - 700x700 - 728x90 - 768x432
Parameters:
Name Type Description Defaultassets
List[AssetOrAssetId]
Assets you want the thumbnails of.
requiredreturn_policy
ThumbnailReturnPolicy
How you want it returns look at enum.
place_holder
size
SizeTupleOrString
size of the image.
(30, 30)
image_format
ThumbnailFormat
Format of the image.
png
is_circular
bool
if the image is a circle yes or no.
False
Returns:
Type DescriptionList[Thumbnail]
A list of Thumbnails.
Source code inroblox/thumbnails.py
async def get_asset_thumbnails(\n self,\n assets: List[AssetOrAssetId],\n return_policy: ThumbnailReturnPolicy = ThumbnailReturnPolicy.place_holder,\n size: SizeTupleOrString = (30, 30),\n image_format: ThumbnailFormat = ThumbnailFormat.png,\n is_circular: bool = False,\n) -> List[Thumbnail]:\n \"\"\"\n Returns asset thumbnails for the asset ID passed.\n Supported sizes: \n - 30x30 \n - 42x42 \n - 50x50 \n - 60x62 \n - 75x75 \n - 110x110 \n - 140x140 \n - 150x150 \n - 160x100 \n - 160x600 \n - 250x250 \n - 256x144 \n - 300x250 \n - 304x166 \n - 384x216 \n - 396x216 \n - 420x420 \n - 480x270 \n - 512x512 \n - 576x324 \n - 700x700 \n - 728x90 \n - 768x432 \n\n Arguments:\n assets: Assets you want the thumbnails of.\n return_policy: How you want it returns look at enum.\n size: size of the image.\n image_format: Format of the image.\n is_circular: if the image is a circle yes or no.\n\n Returns:\n A list of Thumbnails.\n \"\"\"\n thumbnails_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"thumbnails\", \"v1/assets\"),\n params={\n \"assetIds\": list(map(int, assets)),\n \"returnPolicy\": return_policy.value,\n \"size\": _to_size_string(size),\n \"format\": image_format.value,\n \"isCircular\": is_circular,\n },\n )\n thumbnails_data = thumbnails_response.json()[\"data\"]\n return [\n Thumbnail(client=self._client, data=thumbnail_data)\n for thumbnail_data in thumbnails_data\n ]\n
"},{"location":"reference/thumbnails/#roblox.thumbnails.ThumbnailProvider.get_badge_icons","title":"get_badge_icons(badges, size=(150, 150), image_format=ThumbnailFormat.png, is_circular=False)
async
","text":"Returns badge icons for each badge ID passed. Supported sizes: - 150x150
Parameters:
Name Type Description Defaultbadges
List[BadgeOrBadgeId]
Badges you want the thumbnails of.
requiredsize
SizeTupleOrString
size of the image.
(150, 150)
image_format
ThumbnailFormat
Format of the image.
png
is_circular
bool
if the image is a circle yes or no.
False
Returns:
Type DescriptionList[Thumbnail]
A list of Thumbnails.
Source code inroblox/thumbnails.py
async def get_badge_icons(\n self,\n badges: List[BadgeOrBadgeId],\n size: SizeTupleOrString = (150, 150),\n image_format: ThumbnailFormat = ThumbnailFormat.png,\n is_circular: bool = False,\n) -> List[Thumbnail]:\n \"\"\"\n Returns badge icons for each badge ID passed.\n Supported sizes: \n - 150x150 \n\n Arguments:\n badges: Badges you want the thumbnails of.\n size: size of the image.\n image_format: Format of the image.\n is_circular: if the image is a circle yes or no.\n\n Returns:\n A list of Thumbnails.\n \"\"\"\n thumbnails_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"thumbnails\", \"v1/badges/icons\"),\n params={\n \"badgeIds\": list(map(int, badges)),\n \"size\": _to_size_string(size),\n \"format\": image_format.value,\n \"isCircular\": is_circular,\n },\n )\n thumbnails_data = thumbnails_response.json()[\"data\"]\n return [\n Thumbnail(client=self._client, data=thumbnail_data)\n for thumbnail_data in thumbnails_data\n ]\n
"},{"location":"reference/thumbnails/#roblox.thumbnails.ThumbnailProvider.get_gamepass_icons","title":"get_gamepass_icons(gamepasses, size=(150, 150), image_format=ThumbnailFormat.png, is_circular=False)
async
","text":"Returns gamepass icons for each gamepass ID passed. Supported sizes: - 150x150
Parameters:
Name Type Description Defaultgamepasses
List[GamePassOrGamePassId]
Gamepasses you want the thumbnails of.
requiredsize
SizeTupleOrString
size of the image.
(150, 150)
image_format
ThumbnailFormat
Format of the image.
png
is_circular
bool
If the image is a circle yes or no.
False
Returns:
Type DescriptionList[Thumbnail]
A list of Thumbnails.
Source code inroblox/thumbnails.py
async def get_gamepass_icons(\n self,\n gamepasses: List[GamePassOrGamePassId],\n # TODO Make size enum\n size: SizeTupleOrString = (150, 150),\n image_format: ThumbnailFormat = ThumbnailFormat.png,\n is_circular: bool = False,\n) -> List[Thumbnail]:\n \"\"\"\n Returns gamepass icons for each gamepass ID passed.\n Supported sizes: \n - 150x150 \n\n Arguments:\n gamepasses: Gamepasses you want the thumbnails of.\n size: size of the image.\n image_format: Format of the image.\n is_circular: If the image is a circle yes or no.\n\n Returns:\n A list of Thumbnails.\n \"\"\"\n thumbnails_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"thumbnails\", \"v1/game-passes\"),\n params={\n \"gamePassIds\": list(map(int, gamepasses)),\n \"size\": _to_size_string(size),\n \"format\": image_format.value,\n \"isCircular\": is_circular,\n },\n )\n thumbnails_data = thumbnails_response.json()[\"data\"]\n return [\n Thumbnail(client=self._client, data=thumbnail_data)\n for thumbnail_data in thumbnails_data\n ]\n
"},{"location":"reference/thumbnails/#roblox.thumbnails.ThumbnailProvider.get_group_icons","title":"get_group_icons(groups, size=(150, 150), image_format=ThumbnailFormat.png, is_circular=False)
async
","text":"Returns icons for each group ID passed. Supported sizes: - 150x150 - 420x420
Parameters:
Name Type Description Defaultgroups
List[GroupOrGroupId]
Groups you want the thumbnails of.
requiredsize
SizeTupleOrString
size of the image.
(150, 150)
image_format
ThumbnailFormat
Format of the image.
png
is_circular
bool
If the image is a circle yes or no.
False
Returns:
Type DescriptionList[Thumbnail]
A list of Thumbnails.
Source code inroblox/thumbnails.py
async def get_group_icons(\n self,\n groups: List[GroupOrGroupId],\n size: SizeTupleOrString = (150, 150),\n image_format: ThumbnailFormat = ThumbnailFormat.png,\n is_circular: bool = False,\n) -> List[Thumbnail]:\n \"\"\"\n Returns icons for each group ID passed.\n Supported sizes: \n - 150x150 \n - 420x420 \n\n Arguments:\n groups: Groups you want the thumbnails of.\n size: size of the image.\n image_format: Format of the image.\n is_circular: If the image is a circle yes or no.\n\n Returns:\n A list of Thumbnails.\n \"\"\"\n thumbnails_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"thumbnails\", \"v1/groups/icons\"),\n params={\n \"groupIds\": list(map(int, groups)),\n \"size\": _to_size_string(size),\n \"format\": image_format.value,\n \"isCircular\": is_circular,\n },\n )\n thumbnails_data = thumbnails_response.json()[\"data\"]\n return [\n Thumbnail(client=self._client, data=thumbnail_data)\n for thumbnail_data in thumbnails_data\n ]\n
"},{"location":"reference/thumbnails/#roblox.thumbnails.ThumbnailProvider.get_place_icons","title":"get_place_icons(places, return_policy=ThumbnailReturnPolicy.place_holder, size=(50, 50), image_format=ThumbnailFormat.png, is_circular=False)
async
","text":"Returns icons for each place ID passed. Supported sizes: - 50x50 - 128x128 - 150x150 - 256x256 - 512x512 - 768x432
Parameters:
Name Type Description Defaultplaces
List[PlaceOrPlaceId]
Places you want the thumbnails of.
requiredreturn_policy
ThumbnailReturnPolicy
How you want it returns look at enum.
place_holder
size
SizeTupleOrString
size of the image.
(50, 50)
image_format
ThumbnailFormat
Format of the image.
png
is_circular
bool
if the image is a circle yes or no.
False
Source code in roblox/thumbnails.py
async def get_place_icons(\n self,\n places: List[PlaceOrPlaceId],\n return_policy: ThumbnailReturnPolicy = ThumbnailReturnPolicy.place_holder,\n size: SizeTupleOrString = (50, 50),\n image_format: ThumbnailFormat = ThumbnailFormat.png,\n is_circular: bool = False,\n) -> List[Thumbnail]:\n \"\"\"\n Returns icons for each place ID passed.\n Supported sizes: \n - 50x50 \n - 128x128 \n - 150x150 \n - 256x256 \n - 512x512 \n - 768x432 \n\n Arguments:\n places: Places you want the thumbnails of.\n return_policy: How you want it returns look at enum.\n size: size of the image.\n image_format: Format of the image.\n is_circular: if the image is a circle yes or no.\n Returns:\n A List of Thumbnails.\n \"\"\"\n thumbnails_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"thumbnails\", \"v1/places/gameicons\"),\n params={\n \"placeIds\": list(map(int, places)),\n \"returnPolicy\": return_policy.value,\n \"size\": _to_size_string(size),\n \"format\": image_format.value,\n \"isCircular\": is_circular,\n },\n )\n thumbnails_data = thumbnails_response.json()[\"data\"]\n return [\n Thumbnail(client=self._client, data=thumbnail_data)\n for thumbnail_data in thumbnails_data\n ]\n
"},{"location":"reference/thumbnails/#roblox.thumbnails.ThumbnailProvider.get_universe_icons","title":"get_universe_icons(universes, return_policy=ThumbnailReturnPolicy.place_holder, size=(50, 50), image_format=ThumbnailFormat.png, is_circular=False)
async
","text":"Returns universe icons for each universe ID passed. Supported sizes: - 50x50 - 128x128 - 150x150 - 256x256 - 512x512 - 768x432
Parameters:
Name Type Description Defaultuniverses
List[UniverseOrUniverseId]
Universes you want the thumbnails of.
requiredreturn_policy
ThumbnailReturnPolicy
How you want it returns look at enum.
place_holder
size
SizeTupleOrString
size of the image.
(50, 50)
image_format
ThumbnailFormat
Format of the image.
png
is_circular
bool
If the image is a circle yes or no.
False
Returns:
Type DescriptionList[Thumbnail]
A list of Thumbnails.
Source code inroblox/thumbnails.py
async def get_universe_icons(\n self,\n universes: List[UniverseOrUniverseId],\n return_policy: ThumbnailReturnPolicy = ThumbnailReturnPolicy.place_holder,\n size: SizeTupleOrString = (50, 50),\n image_format: ThumbnailFormat = ThumbnailFormat.png,\n is_circular: bool = False,\n) -> List[Thumbnail]:\n \"\"\"\n Returns universe icons for each universe ID passed.\n Supported sizes: \n - 50x50 \n - 128x128 \n - 150x150 \n - 256x256 \n - 512x512 \n - 768x432 \n\n Arguments:\n universes: Universes you want the thumbnails of.\n return_policy: How you want it returns look at enum.\n size: size of the image.\n image_format: Format of the image.\n is_circular: If the image is a circle yes or no.\n\n Returns:\n A list of Thumbnails.\n \"\"\"\n thumbnails_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"thumbnails\", \"v1/games/icons\"),\n params={\n \"universeIds\": list(map(int, universes)),\n \"returnPolicy\": return_policy.value,\n \"size\": _to_size_string(size),\n \"format\": image_format.value,\n \"isCircular\": is_circular,\n },\n )\n thumbnails_data = thumbnails_response.json()[\"data\"]\n return [\n Thumbnail(client=self._client, data=thumbnail_data)\n for thumbnail_data in thumbnails_data\n ]\n
"},{"location":"reference/thumbnails/#roblox.thumbnails.ThumbnailProvider.get_universe_thumbnails","title":"get_universe_thumbnails(universes, size=(768, 432), image_format=ThumbnailFormat.png, is_circular=False, count_per_universe=None, defaults=None)
async
","text":"Returns universe thumbnails for each universe ID passed. Supported sizes: - 768x432 - 576x324 - 480x270 - 384x216 - 256x144
Parameters:
Name Type Description Defaultuniverses
List[UniverseOrUniverseId]
Universes you want the thumbnails of.
requiredsize
SizeTupleOrString
size of the image.
(768, 432)
image_format
ThumbnailFormat
Format of the image.
png
count_per_universe
int
Unknown.
None
is_circular
bool
If the image is a circle yes or no.
False
defaults
bool
Whether to return default thumbnails.
None
Returns:
Type DescriptionList[UniverseThumbnails]
A list of Thumbnails.
Source code inroblox/thumbnails.py
async def get_universe_thumbnails(\n self,\n universes: List[UniverseOrUniverseId],\n size: SizeTupleOrString = (768, 432),\n image_format: ThumbnailFormat = ThumbnailFormat.png,\n is_circular: bool = False,\n count_per_universe: int = None,\n defaults: bool = None,\n) -> List[UniverseThumbnails]:\n \"\"\"\n Returns universe thumbnails for each universe ID passed.\n Supported sizes: \n - 768x432 \n - 576x324 \n - 480x270 \n - 384x216 \n - 256x144 \n\n Arguments:\n universes: Universes you want the thumbnails of.\n size: size of the image.\n image_format: Format of the image.\n count_per_universe: Unknown.\n is_circular: If the image is a circle yes or no.\n defaults: Whether to return default thumbnails.\n\n Returns:\n A list of Thumbnails.\n \"\"\"\n thumbnails_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\n \"thumbnails\", \"v1/games/multiget/thumbnails\"\n ),\n params={\n \"universeIds\": list(map(int, universes)),\n \"countPerUniverse\": count_per_universe,\n \"defaults\": defaults,\n \"size\": _to_size_string(size),\n \"format\": image_format.value,\n \"isCircular\": is_circular,\n },\n )\n thumbnails_data = thumbnails_response.json()[\"data\"]\n return [\n UniverseThumbnails(client=self._client, data=thumbnail_data)\n for thumbnail_data in thumbnails_data\n ]\n
"},{"location":"reference/thumbnails/#roblox.thumbnails.ThumbnailProvider.get_user_avatar_thumbnail_3d","title":"get_user_avatar_thumbnail_3d(user)
async
","text":"Returns the user's thumbnail in 3d.
Parameters:
Name Type Description Defaultuser
UserOrUserId
User you want the 3d thumbnail of.
requiredReturns:
Type DescriptionThumbnail
A Thumbnail.
Source code inroblox/thumbnails.py
async def get_user_avatar_thumbnail_3d(self, user: UserOrUserId) -> Thumbnail:\n \"\"\"\n Returns the user's thumbnail in 3d.\n\n Arguments:\n user: User you want the 3d thumbnail of.\n\n Returns:\n A Thumbnail.\n \"\"\"\n thumbnail_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"thumbnails\", \"v1/users/avatar-3d\"),\n params={\n \"userId\": int(user)\n },\n )\n thumbnail_data = thumbnail_response.json()\n return Thumbnail(client=self._client, data=thumbnail_data)\n
"},{"location":"reference/thumbnails/#roblox.thumbnails.ThumbnailProvider.get_user_avatar_thumbnails","title":"get_user_avatar_thumbnails(users, type=AvatarThumbnailType.full_body, size=None, image_format=ThumbnailFormat.png, is_circular=False)
async
","text":"Returns avatar thumbnails for each user ID passed. The valid sizes depend on the type
parameter.
Parameters:
Name Type Description Defaultusers
List[UserOrUserId]
Id of the users you want the thumbnails of.
requiredtype
AvatarThumbnailType
Type of avatar thumbnail you want look at enum.
full_body
size
SizeTupleOrString
size of the image.
None
image_format
ThumbnailFormat
Format of the image.
png
is_circular
bool
If the image is a circle yes or no.
False
Returns:
Type DescriptionList[Thumbnail]
A list of Thumbnails.
Source code inroblox/thumbnails.py
async def get_user_avatar_thumbnails(\n self,\n users: List[UserOrUserId],\n type: AvatarThumbnailType = AvatarThumbnailType.full_body,\n size: SizeTupleOrString = None,\n image_format: ThumbnailFormat = ThumbnailFormat.png,\n is_circular: bool = False,\n) -> List[Thumbnail]:\n \"\"\"\n Returns avatar thumbnails for each user ID passed.\n The valid sizes depend on the `type` parameter.\n\n | Size | full_body | headshot | bust |\n |---|---|---|---|\n | 30x30 | \u2714\ufe0f | \u274c | \u274c |\n | 48x48 | \u2714\ufe0f | \u2714\ufe0f | \u2714\ufe0f |\n | 50x50 | \u274c | \u2714\ufe0f | \u2714\ufe0f |\n | 60x60 | \u2714\ufe0f | \u2714\ufe0f | \u2714\ufe0f |\n | 75x75 | \u2714\ufe0f | \u2714\ufe0f | \u2714\ufe0f |\n | 100x100 | \u2714\ufe0f | \u2714\ufe0f | \u2714\ufe0f |\n | 110x110 | \u2714\ufe0f | \u2714\ufe0f | \u274c |\n | 140x140 | \u2714\ufe0f | \u274c | \u274c |\n | 150x150 | \u2714\ufe0f | \u2714\ufe0f | \u2714\ufe0f |\n | 150x200 | \u2714\ufe0f | \u274c | \u274c |\n | 180x180 | \u2714\ufe0f | \u2714\ufe0f | \u2714\ufe0f |\n | 250x250 | \u2714\ufe0f | \u274c | \u274c |\n | 352x352 | \u2714\ufe0f | \u2714\ufe0f | \u2714\ufe0f |\n | 420x420 | \u2714\ufe0f | \u2714\ufe0f | \u2714\ufe0f |\n | 720x720 | \u2714\ufe0f | \u274c | \u274c |\n\n Arguments:\n users: Id of the users you want the thumbnails of.\n type: Type of avatar thumbnail you want look at enum.\n size: size of the image.\n image_format: Format of the image.\n is_circular: If the image is a circle yes or no.\n\n Returns:\n A list of Thumbnails.\n \"\"\"\n uri: str\n if type == AvatarThumbnailType.full_body:\n uri = \"avatar\"\n size = size or (30, 30)\n elif type == AvatarThumbnailType.bust:\n uri = \"avatar-bust\"\n size = size or (48, 48)\n elif type == AvatarThumbnailType.headshot:\n uri = \"avatar-headshot\"\n size = size or (48, 48)\n else:\n raise ValueError(\"Avatar type is invalid.\")\n\n thumbnails_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"thumbnails\", f\"v1/users/{uri}\"),\n params={\n \"userIds\": list(map(int, users)),\n \"size\": _to_size_string(size),\n \"format\": image_format.value,\n \"isCircular\": is_circular,\n },\n )\n\n thumbnails_data = thumbnails_response.json()[\"data\"]\n return [\n Thumbnail(client=self._client, data=thumbnail_data)\n for thumbnail_data in thumbnails_data\n ]\n
"},{"location":"reference/thumbnails/#roblox.thumbnails.ThumbnailReturnPolicy","title":"ThumbnailReturnPolicy
","text":" Bases: Enum
The return policy for place/universe thumbnails.
Source code inroblox/thumbnails.py
class ThumbnailReturnPolicy(Enum):\n \"\"\"\n The return policy for place/universe thumbnails.\n \"\"\"\n\n place_holder = \"PlaceHolder\"\n auto_generated = \"AutoGenerated\"\n force_auto_generated = \"ForceAutoGenerated\"\n
"},{"location":"reference/thumbnails/#roblox.thumbnails.ThumbnailState","title":"ThumbnailState
","text":" Bases: Enum
The current state of the thumbnail.
Source code inroblox/thumbnails.py
class ThumbnailState(Enum):\n \"\"\"\n The current state of the thumbnail.\n \"\"\"\n\n completed = \"Completed\"\n in_review = \"InReview\"\n pending = \"Pending\"\n error = \"Error\"\n moderated = \"Moderated\"\n blocked = \"Blocked\"\n
"},{"location":"reference/thumbnails/#roblox.thumbnails.UniverseThumbnails","title":"UniverseThumbnails
","text":"Represents a universe's thumbnails as returned by https://thumbnails.roblox.com/v1/games/multiget/thumbnails.
Attributes:
Name Type Descriptionuniverse_id
int
The id of the target of the image.
error
Optional[str]
The errors you got.
thumbnails
List[Thumbnail]
List of thumbnails.
Source code inroblox/thumbnails.py
class UniverseThumbnails:\n \"\"\"\n Represents a universe's thumbnails as returned by https://thumbnails.roblox.com/v1/games/multiget/thumbnails.\n\n Attributes:\n universe_id: The id of the target of the image.\n error: The errors you got.\n thumbnails: List of thumbnails.\n \"\"\"\n\n def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: Shared object.\n data: The data from the request.\n \"\"\"\n self._client: Client = client\n # todo add base universe maby\n self.universe_id: int = data[\"universeId\"]\n self.error: Optional[str] = data[\"error\"]\n self.thumbnails: List[Thumbnail] = [\n Thumbnail(client=self._client, data=thumbnail_data)\n for thumbnail_data in data[\"thumbnails\"]\n ]\n
"},{"location":"reference/thumbnails/#roblox.thumbnails.UniverseThumbnails.__init__","title":"__init__(client, data)
","text":"Parameters:
Name Type Description Defaultclient
Client
Shared object.
requireddata
dict
The data from the request.
required Source code inroblox/thumbnails.py
def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: Shared object.\n data: The data from the request.\n \"\"\"\n self._client: Client = client\n # todo add base universe maby\n self.universe_id: int = data[\"universeId\"]\n self.error: Optional[str] = data[\"error\"]\n self.thumbnails: List[Thumbnail] = [\n Thumbnail(client=self._client, data=thumbnail_data)\n for thumbnail_data in data[\"thumbnails\"]\n ]\n
"},{"location":"reference/universes/","title":"universes","text":"This module contains classes intended to parse and deal with data from Roblox universe information endpoints.
"},{"location":"reference/universes/#roblox.universes.Universe","title":"Universe
","text":" Bases: BaseUniverse
Represents the response data of https://games.roblox.com/v1/games.
Attributes:
Name Type Descriptionid
int
The ID of this specific universe
root_place
BasePlace
The thumbnail provider object.
name
str
The delivery provider object.
description
str
The description of the game.
creator_type
Enum
Is the creator a group or a user.
creator
Union[PartialUser, UniversePartialGroup]
creator information.
price
Optional[int]
how much you need to pay to play the game.
allowed_gear_genres
List[str]
Unknown
allowed_gear_categories
List[str]
Unknown
is_genre_enforced
bool
Unknown
copying_allowed
bool
are you allowed to copy the game.
playing
int
amount of people currently playing the game.
visits
int
amount of visits to the game.
max_players
int
the maximum amount of players ber server.
created
datetime
when the game was created.
updated
datetime
when the game as been updated for the last time.
studio_access_to_apis_allowed
bool
does studio have access to the apis.
create_vip_servers_allowed
bool
can you create a vip server?
universe_avatar_type
UniverseAvatarType
type of avatars in the game.
genre
UniverseGenre
what genre the game is.
is_all_genre
bool
if it is all genres?
is_favorited_by_user
bool
if the authenticated user has it favorited.
favorited_count
int
the total amount of people who favorited the game.
Source code inroblox/universes.py
class Universe(BaseUniverse):\n \"\"\"\n Represents the response data of https://games.roblox.com/v1/games.\n\n Attributes:\n id: The ID of this specific universe\n root_place: The thumbnail provider object.\n name: The delivery provider object.\n description: The description of the game.\n creator_type: Is the creator a group or a user.\n creator: creator information.\n price: how much you need to pay to play the game.\n allowed_gear_genres: Unknown\n allowed_gear_categories: Unknown\n is_genre_enforced: Unknown\n copying_allowed: are you allowed to copy the game.\n playing: amount of people currently playing the game.\n visits: amount of visits to the game.\n max_players: the maximum amount of players ber server.\n created: when the game was created.\n updated: when the game as been updated for the last time.\n studio_access_to_apis_allowed: does studio have access to the apis.\n create_vip_servers_allowed: can you create a vip server?\n universe_avatar_type: type of avatars in the game.\n genre: what genre the game is.\n is_all_genre: if it is all genres?\n is_favorited_by_user: if the authenticated user has it favorited.\n favorited_count: the total amount of people who favorited the game.\n \"\"\"\n\n def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: The Client.\n data: The universe data.\n \"\"\"\n\n self._client: Client = client\n\n self.id: int = data[\"id\"]\n super().__init__(client=client, universe_id=self.id)\n self.root_place: BasePlace = BasePlace(client=client, place_id=data[\"rootPlaceId\"])\n self.name: str = data[\"name\"]\n self.description: str = data[\"description\"]\n self.creator_type: Enum = CreatorType(data[\"creator\"][\"type\"])\n # isRNVAccount is not part of PartialUser, UniversePartialGroup\n self.creator: Union[PartialUser, UniversePartialGroup]\n if self.creator_type == CreatorType.group:\n self.creator = UniversePartialGroup(client, data[\"creator\"])\n elif self.creator_type == CreatorType.user:\n self.creator = PartialUser(client, data[\"creator\"])\n self.price: Optional[int] = data[\"price\"]\n self.allowed_gear_genres: List[str] = data[\"allowedGearGenres\"]\n self.allowed_gear_categories: List[str] = data[\"allowedGearCategories\"]\n self.is_genre_enforced: bool = data[\"isGenreEnforced\"]\n self.copying_allowed: bool = data[\"copyingAllowed\"]\n self.playing: int = data[\"playing\"]\n self.visits: int = data[\"visits\"]\n self.max_players: int = data[\"maxPlayers\"]\n self.created: datetime = parse(data[\"created\"])\n self.updated: datetime = parse(data[\"updated\"])\n self.studio_access_to_apis_allowed: bool = data[\"studioAccessToApisAllowed\"]\n self.create_vip_servers_allowed: bool = data[\"createVipServersAllowed\"]\n self.universe_avatar_type: UniverseAvatarType = UniverseAvatarType(data[\"universeAvatarType\"])\n self.genre: UniverseGenre = UniverseGenre(data[\"genre\"])\n self.is_all_genre: bool = data[\"isAllGenre\"]\n # gameRating seems to be null across all games, so I omitted it from this class.\n self.is_favorited_by_user: bool = data[\"isFavoritedByUser\"]\n self.favorited_count: int = data[\"favoritedCount\"]\n
"},{"location":"reference/universes/#roblox.universes.Universe.__init__","title":"__init__(client, data)
","text":"Parameters:
Name Type Description Defaultclient
Client
The Client.
requireddata
dict
The universe data.
required Source code inroblox/universes.py
def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: The Client.\n data: The universe data.\n \"\"\"\n\n self._client: Client = client\n\n self.id: int = data[\"id\"]\n super().__init__(client=client, universe_id=self.id)\n self.root_place: BasePlace = BasePlace(client=client, place_id=data[\"rootPlaceId\"])\n self.name: str = data[\"name\"]\n self.description: str = data[\"description\"]\n self.creator_type: Enum = CreatorType(data[\"creator\"][\"type\"])\n # isRNVAccount is not part of PartialUser, UniversePartialGroup\n self.creator: Union[PartialUser, UniversePartialGroup]\n if self.creator_type == CreatorType.group:\n self.creator = UniversePartialGroup(client, data[\"creator\"])\n elif self.creator_type == CreatorType.user:\n self.creator = PartialUser(client, data[\"creator\"])\n self.price: Optional[int] = data[\"price\"]\n self.allowed_gear_genres: List[str] = data[\"allowedGearGenres\"]\n self.allowed_gear_categories: List[str] = data[\"allowedGearCategories\"]\n self.is_genre_enforced: bool = data[\"isGenreEnforced\"]\n self.copying_allowed: bool = data[\"copyingAllowed\"]\n self.playing: int = data[\"playing\"]\n self.visits: int = data[\"visits\"]\n self.max_players: int = data[\"maxPlayers\"]\n self.created: datetime = parse(data[\"created\"])\n self.updated: datetime = parse(data[\"updated\"])\n self.studio_access_to_apis_allowed: bool = data[\"studioAccessToApisAllowed\"]\n self.create_vip_servers_allowed: bool = data[\"createVipServersAllowed\"]\n self.universe_avatar_type: UniverseAvatarType = UniverseAvatarType(data[\"universeAvatarType\"])\n self.genre: UniverseGenre = UniverseGenre(data[\"genre\"])\n self.is_all_genre: bool = data[\"isAllGenre\"]\n # gameRating seems to be null across all games, so I omitted it from this class.\n self.is_favorited_by_user: bool = data[\"isFavoritedByUser\"]\n self.favorited_count: int = data[\"favoritedCount\"]\n
"},{"location":"reference/universes/#roblox.universes.UniverseAvatarType","title":"UniverseAvatarType
","text":" Bases: Enum
The current avatar type of the universe.
Source code inroblox/universes.py
class UniverseAvatarType(Enum):\n \"\"\"\n The current avatar type of the universe.\n \"\"\"\n\n R6 = \"MorphToR6\"\n R15 = \"MorphToR15\"\n player_choice = \"PlayerChoice\"\n
"},{"location":"reference/universes/#roblox.universes.UniverseGenre","title":"UniverseGenre
","text":" Bases: Enum
The universe's genre.
Source code inroblox/universes.py
class UniverseGenre(Enum):\n \"\"\"\n The universe's genre.\n \"\"\"\n\n all = \"All\"\n building = \"Building\"\n horror = \"Horror\"\n town_and_city = \"Town and City\"\n military = \"Military\"\n comedy = \"Comedy\"\n medieval = \"Medieval\"\n adventure = \"Adventure\"\n sci_fi = \"Sci-Fi\"\n naval = \"Naval\"\n fps = \"FPS\"\n rpg = \"RPG\"\n sports = \"Sports\"\n fighting = \"Fighting\"\n western = \"Western\"\n
"},{"location":"reference/users/","title":"users","text":"This module contains classes intended to parse and deal with data from Roblox user information endpoints.
"},{"location":"reference/users/#roblox.users.User","title":"User
","text":" Bases: BaseUser
Represents a single conversation.
Attributes:
Name Type Descriptionid
int
The id of the current user.
name
str
The name of the current user.
display_name
str
The display name of the current user.
external_app_display_name
Optional[str]
The external app display name of the current user.
is_banned
bool
If the user is banned.
description
str
The description the current user wrote for themself.
created
datetime
When the user created their account.
has_verified_badge
bool
If the user has a verified badge.
Source code inroblox/users.py
class User(BaseUser):\n \"\"\"\n Represents a single conversation.\n\n Attributes:\n id: The id of the current user.\n name: The name of the current user.\n display_name: The display name of the current user.\n external_app_display_name: The external app display name of the current user.\n is_banned: If the user is banned.\n description: The description the current user wrote for themself.\n created: When the user created their account.\n has_verified_badge: If the user has a verified badge.\n \"\"\"\n\n def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: Client object.\n data: The data from the request.\n \"\"\"\n super().__init__(client=client, user_id=data[\"id\"])\n\n self._client: Client = client\n\n self.name: str = data[\"name\"]\n self.display_name: str = data[\"displayName\"]\n self.external_app_display_name: Optional[str] = data[\"externalAppDisplayName\"]\n self.id: int = data[\"id\"]\n self.is_banned: bool = data[\"isBanned\"]\n self.description: str = data[\"description\"]\n self.created: datetime = parse(data[\"created\"])\n self.has_verified_badge: bool = data[\"hasVerifiedBadge\"]\n
"},{"location":"reference/users/#roblox.users.User.__init__","title":"__init__(client, data)
","text":"Parameters:
Name Type Description Defaultclient
Client
Client object.
requireddata
dict
The data from the request.
required Source code inroblox/users.py
def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: Client object.\n data: The data from the request.\n \"\"\"\n super().__init__(client=client, user_id=data[\"id\"])\n\n self._client: Client = client\n\n self.name: str = data[\"name\"]\n self.display_name: str = data[\"displayName\"]\n self.external_app_display_name: Optional[str] = data[\"externalAppDisplayName\"]\n self.id: int = data[\"id\"]\n self.is_banned: bool = data[\"isBanned\"]\n self.description: str = data[\"description\"]\n self.created: datetime = parse(data[\"created\"])\n self.has_verified_badge: bool = data[\"hasVerifiedBadge\"]\n
"},{"location":"reference/wall/","title":"wall","text":"Contains objects related to Roblox group walls.
"},{"location":"reference/wall/#roblox.wall.WallPost","title":"WallPost
","text":" Bases: WallPostRelationship
Represents a post on a Roblox group wall.
Attributes:
Name Type Descriptionid
int
The post ID.
poster
Optional[Member]
The member who made the post.
body
str
Body of the post.
created
datetime
Creation date of the post.
updated
datetime
Last updated date of the post.
Source code inroblox/wall.py
class WallPost(WallPostRelationship):\n \"\"\"\n Represents a post on a Roblox group wall.\n\n Attributes:\n id: The post ID.\n poster: The member who made the post.\n body: Body of the post.\n created: Creation date of the post.\n updated: Last updated date of the post.\n \"\"\"\n\n def __init__(self, client: Client, data: dict, group: BaseGroup):\n self._client: Client = client\n\n self.id: int = data[\"id\"]\n\n super().__init__(\n client=self._client,\n post_id=self.id,\n group=group\n )\n\n self.poster: Optional[Member] = data[\"poster\"] and Member(\n client=self._client,\n data=data[\"poster\"],\n group=self.group\n ) or None\n self.body: str = data[\"body\"]\n self.created: datetime = parse(data[\"created\"])\n self.updated: datetime = parse(data[\"updated\"])\n\n def __repr__(self):\n return f\"<{self.__class__.__name__} id={self.id} body={self.body!r} group={self.group}>\"\n
"},{"location":"reference/wall/#roblox.wall.WallPostRelationship","title":"WallPostRelationship
","text":"Represents a Roblox wall post ID.
Attributes:
Name Type Descriptionid
int
The post ID.
group
BaseGroup
The group whose wall this post exists on.
Source code inroblox/wall.py
class WallPostRelationship:\n \"\"\"\n Represents a Roblox wall post ID.\n\n Attributes:\n id: The post ID.\n group: The group whose wall this post exists on.\n \"\"\"\n\n def __init__(self, client: Client, post_id: int, group: Union[BaseGroup, int]):\n \"\"\"\n Arguments:\n client: The Client.\n post_id: The post ID.\n \"\"\"\n\n self._client: Client = client\n self.id: int = post_id\n\n self.group: BaseGroup\n\n if isinstance(group, int):\n self.group = BaseGroup(client=self._client, group_id=group)\n else:\n self.group = group\n\n async def delete(self):\n \"\"\"\n Deletes this wall post.\n \"\"\"\n await self._client.requests.delete(\n url=self._client.url_generator.get_url(\"groups\", f\"v1/groups/{self.group.id}/wall/posts/{self.id}\")\n )\n\n def __repr__(self):\n return f\"<{self.__class__.__name__} id={self.id} group={self.group}>\"\n
"},{"location":"reference/wall/#roblox.wall.WallPostRelationship.__init__","title":"__init__(client, post_id, group)
","text":"Parameters:
Name Type Description Defaultclient
Client
The Client.
requiredpost_id
int
The post ID.
required Source code inroblox/wall.py
def __init__(self, client: Client, post_id: int, group: Union[BaseGroup, int]):\n \"\"\"\n Arguments:\n client: The Client.\n post_id: The post ID.\n \"\"\"\n\n self._client: Client = client\n self.id: int = post_id\n\n self.group: BaseGroup\n\n if isinstance(group, int):\n self.group = BaseGroup(client=self._client, group_id=group)\n else:\n self.group = group\n
"},{"location":"reference/wall/#roblox.wall.WallPostRelationship.delete","title":"delete()
async
","text":"Deletes this wall post.
Source code inroblox/wall.py
async def delete(self):\n \"\"\"\n Deletes this wall post.\n \"\"\"\n await self._client.requests.delete(\n url=self._client.url_generator.get_url(\"groups\", f\"v1/groups/{self.group.id}/wall/posts/{self.id}\")\n )\n
"},{"location":"reference/bases/","title":"bases","text":"Contains base objects representing IDs on Roblox. As IDs represent objects on Roblox, you only need the ID of something to send requests for them. These bases represent one of those IDs.
"},{"location":"reference/bases/baseasset/","title":"baseasset","text":"This file contains the BaseAsset object, which represents a Roblox asset ID.
"},{"location":"reference/bases/baseasset/#roblox.bases.baseasset.BaseAsset","title":"BaseAsset
","text":" Bases: BaseItem
Represents a Roblox asset ID.
Attributes:
Name Type Descriptionid
int
The asset ID.
Source code inroblox/bases/baseasset.py
class BaseAsset(BaseItem):\n \"\"\"\n Represents a Roblox asset ID.\n\n Attributes:\n id: The asset ID.\n \"\"\"\n\n def __init__(self, client: Client, asset_id: int):\n \"\"\"\n Arguments:\n client: The Client this object belongs to.\n asset_id: The asset ID.\n \"\"\"\n\n self._client: Client = client\n self.id: int = asset_id\n\n async def get_resale_data(self) -> AssetResaleData:\n \"\"\"\n Gets the asset's limited resale data.\n The asset must be a limited item for this information to be present.\n\n Returns:\n The asset's limited resale data.\n \"\"\"\n resale_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"economy\", f\"v1/assets/{self.id}/resale-data\")\n )\n resale_data = resale_response.json()\n return AssetResaleData(data=resale_data)\n
"},{"location":"reference/bases/baseasset/#roblox.bases.baseasset.BaseAsset.__init__","title":"__init__(client, asset_id)
","text":"Parameters:
Name Type Description Defaultclient
Client
The Client this object belongs to.
requiredasset_id
int
The asset ID.
required Source code inroblox/bases/baseasset.py
def __init__(self, client: Client, asset_id: int):\n \"\"\"\n Arguments:\n client: The Client this object belongs to.\n asset_id: The asset ID.\n \"\"\"\n\n self._client: Client = client\n self.id: int = asset_id\n
"},{"location":"reference/bases/baseasset/#roblox.bases.baseasset.BaseAsset.get_resale_data","title":"get_resale_data()
async
","text":"Gets the asset's limited resale data. The asset must be a limited item for this information to be present.
Returns:
Type DescriptionAssetResaleData
The asset's limited resale data.
Source code inroblox/bases/baseasset.py
async def get_resale_data(self) -> AssetResaleData:\n \"\"\"\n Gets the asset's limited resale data.\n The asset must be a limited item for this information to be present.\n\n Returns:\n The asset's limited resale data.\n \"\"\"\n resale_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"economy\", f\"v1/assets/{self.id}/resale-data\")\n )\n resale_data = resale_response.json()\n return AssetResaleData(data=resale_data)\n
"},{"location":"reference/bases/basebadge/","title":"basebadge","text":"This file contains the BaseBadge object, which represents a Roblox badge ID.
"},{"location":"reference/bases/basebadge/#roblox.bases.basebadge.BaseBadge","title":"BaseBadge
","text":" Bases: BaseItem
Represents a Roblox badge ID.
Attributes:
Name Type Descriptionid
int
The badge ID.
Source code inroblox/bases/basebadge.py
class BaseBadge(BaseItem):\n \"\"\"\n Represents a Roblox badge ID.\n\n Attributes:\n id: The badge ID.\n \"\"\"\n\n def __init__(self, client: Client, badge_id: int):\n \"\"\"\n Arguments:\n client: The Client this object belongs to.\n badge_id: The badge ID.\n \"\"\"\n\n self._client: Client = client\n self.id: int = badge_id\n
"},{"location":"reference/bases/basebadge/#roblox.bases.basebadge.BaseBadge.__init__","title":"__init__(client, badge_id)
","text":"Parameters:
Name Type Description Defaultclient
Client
The Client this object belongs to.
requiredbadge_id
int
The badge ID.
required Source code inroblox/bases/basebadge.py
def __init__(self, client: Client, badge_id: int):\n \"\"\"\n Arguments:\n client: The Client this object belongs to.\n badge_id: The badge ID.\n \"\"\"\n\n self._client: Client = client\n self.id: int = badge_id\n
"},{"location":"reference/bases/baseconversation/","title":"baseconversation","text":"This file contains the BaseConversation object, which represents a Roblox conversation ID.
"},{"location":"reference/bases/baseconversation/#roblox.bases.baseconversation.BaseConversation","title":"BaseConversation
","text":" Bases: BaseItem
Represents a Roblox chat conversation ID.
Attributes:
Name Type Descriptionid
int
The conversation ID.
Source code inroblox/bases/baseconversation.py
class BaseConversation(BaseItem):\n \"\"\"\n Represents a Roblox chat conversation ID.\n\n Attributes:\n id: The conversation ID.\n \"\"\"\n\n def __init__(self, client: Client, conversation_id: int):\n \"\"\"\n Arguments:\n client: The Client this object belongs to.\n conversation_id: The conversation ID.\n \"\"\"\n\n self._client: Client = client\n self.id: int = conversation_id\n
"},{"location":"reference/bases/baseconversation/#roblox.bases.baseconversation.BaseConversation.__init__","title":"__init__(client, conversation_id)
","text":"Parameters:
Name Type Description Defaultclient
Client
The Client this object belongs to.
requiredconversation_id
int
The conversation ID.
required Source code inroblox/bases/baseconversation.py
def __init__(self, client: Client, conversation_id: int):\n \"\"\"\n Arguments:\n client: The Client this object belongs to.\n conversation_id: The conversation ID.\n \"\"\"\n\n self._client: Client = client\n self.id: int = conversation_id\n
"},{"location":"reference/bases/basegamepass/","title":"basegamepass","text":"This file contains the BaseGamePass object, which represents a Roblox gamepass ID.
"},{"location":"reference/bases/basegamepass/#roblox.bases.basegamepass.BaseGamePass","title":"BaseGamePass
","text":" Bases: BaseItem
Represents a Roblox gamepass ID.
Attributes:
Name Type Descriptionid
int
The gamepass ID.
Source code inroblox/bases/basegamepass.py
class BaseGamePass(BaseItem):\n \"\"\"\n Represents a Roblox gamepass ID.\n\n Attributes:\n id: The gamepass ID.\n \"\"\"\n\n def __init__(self, client: Client, gamepass_id: int):\n \"\"\"\n Arguments:\n client: The Client this object belongs to.\n gamepass_id: The gamepass ID.\n \"\"\"\n\n self._client: Client = client\n self.id: int = gamepass_id\n
"},{"location":"reference/bases/basegamepass/#roblox.bases.basegamepass.BaseGamePass.__init__","title":"__init__(client, gamepass_id)
","text":"Parameters:
Name Type Description Defaultclient
Client
The Client this object belongs to.
requiredgamepass_id
int
The gamepass ID.
required Source code inroblox/bases/basegamepass.py
def __init__(self, client: Client, gamepass_id: int):\n \"\"\"\n Arguments:\n client: The Client this object belongs to.\n gamepass_id: The gamepass ID.\n \"\"\"\n\n self._client: Client = client\n self.id: int = gamepass_id\n
"},{"location":"reference/bases/basegroup/","title":"basegroup","text":"This file contains the BaseGroup object, which represents a Roblox group ID. It also contains the GroupSettings object, which represents a group's settings.
"},{"location":"reference/bases/basegroup/#roblox.bases.basegroup.BaseGroup","title":"BaseGroup
","text":" Bases: BaseItem
Represents a Roblox group ID.
Attributes:
Name Type Descriptionid
int
The group's ID.
Source code inroblox/bases/basegroup.py
class BaseGroup(BaseItem):\n \"\"\"\n Represents a Roblox group ID.\n\n Attributes:\n id: The group's ID.\n \"\"\"\n\n def __init__(self, client: Client, group_id: int):\n \"\"\"\n Parameters:\n client: The Client this object belongs to.\n group_id: The group's ID.\n \"\"\"\n self._client: Client = client\n self.id: int = group_id\n\n async def get_settings(self) -> GroupSettings:\n \"\"\"\n Gets all the settings of the selected group\n\n Returns:\n The group's settings.\n \"\"\"\n settings_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"groups\", f\"v1/groups/{self.id}/settings\"),\n )\n settings_data = settings_response.json()\n return GroupSettings(\n client=self._client,\n data=settings_data\n )\n\n async def update_settings(\n self,\n is_approval_required: Optional[bool] = None,\n is_builders_club_required: Optional[bool] = None,\n are_enemies_allowed: Optional[bool] = None,\n are_group_funds_visible: Optional[bool] = None,\n are_group_games_visible: Optional[bool] = None,\n ) -> None:\n \"\"\"\n Updates this group's settings. Passing `None` will default this setting to the value already present in the\n\n Arguments:\n is_approval_required: Whether approval is required via a join request before joining this group.\n is_builders_club_required: Whether users are required to have a Premium subscription to join this group.\n are_enemies_allowed: Whether this group can send and recieve enemy requests.\n are_group_funds_visible: Whether the group fund balance is visible to external users.\n are_group_games_visible: Whether group games are visible to external users.\n \"\"\"\n await self._client.requests.patch(\n url=self._client.url_generator.get_url(\"groups\", f\"v1/groups/{self.id}/settings\"),\n json={\n \"isApprovalRequired\": is_approval_required,\n \"isBuildersClubRequired\": is_builders_club_required,\n \"areEnemiesAllowed\": are_enemies_allowed,\n \"areGroupFundsVisible\": are_group_funds_visible,\n \"areGroupGamesVisible\": are_group_games_visible,\n }\n )\n\n def get_members(self, page_size: int = 10, sort_order: SortOrder = SortOrder.Ascending,\n max_items: int = None) -> PageIterator:\n \"\"\"\n Gets all members of a group.\n\n Arguments:\n page_size: How many members should be returned for each page.\n sort_order: Order in which data should be grabbed.\n max_items: The maximum items to return when looping through this object.\n\n Returns:\n A PageIterator containing the group's members.\n \"\"\"\n return PageIterator(\n client=self._client,\n url=self._client.url_generator.get_url(\"groups\", f\"v1/groups/{self.id}/users\"),\n page_size=page_size,\n sort_order=sort_order,\n max_items=max_items,\n handler=lambda client, data: Member(client=client, data=data, group=self)\n )\n\n def get_member(self, user: Union[int, BaseUser]) -> MemberRelationship:\n \"\"\"\n Gets a member of a group.\n\n Arguments:\n user: A BaseUser or a User ID.\n\n Returns:\n A member.\n \"\"\"\n return MemberRelationship(\n client=self._client,\n user=user,\n group=self\n )\n\n async def get_member_by_username(self, username: str, exclude_banned_users: bool = False) -> MemberRelationship:\n \"\"\"\n Gets a member of a group by username.\n\n Arguments:\n username: A Roblox username.\n exclude_banned_users: Whether to exclude banned users from the data.\n\n Returns:\n A member.\n \"\"\"\n\n user: RequestedUsernamePartialUser = await self._client.get_user_by_username(\n username=username,\n exclude_banned_users=exclude_banned_users,\n expand=False\n )\n\n return MemberRelationship(\n client=self._client,\n user=user,\n group=self\n )\n\n async def get_roles(self) -> List[Role]:\n \"\"\"\n Gets all roles of the group.\n\n Returns:\n A list of the group's roles.\n \"\"\"\n roles_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"groups\", f\"v1/groups/{self.id}/roles\")\n )\n roles_data = roles_response.json()\n return [Role(\n client=self._client,\n data=role_data,\n group=self\n ) for role_data in roles_data[\"roles\"]]\n\n async def set_role(self, user: UserOrUserId, role: RoleOrRoleId) -> None:\n \"\"\"\n Sets a users role.\n\n Arguments:\n user: The user who's rank will be changed.\n role: The new role.\n \"\"\"\n await self._client.requests.patch(\n url=self._client.url_generator.get_url(\"groups\", f\"v1/groups/{self.id}/users/{int(user)}\"),\n json={\n \"roleId\": int(role)\n }\n )\n\n async def set_rank(self, user: UserOrUserId, rank: int) -> None:\n \"\"\"\n Changes a member's role using a rank number.\n\n Arguments:\n user: The user who's rank will be changed.\n rank: The rank number to change to. (1-255)\n \"\"\"\n roles = await self.get_roles()\n\n role = next((role for role in roles if role.rank == rank), None)\n if not role:\n raise InvalidRole(f\"Role with rank number {rank} does not exist.\")\n\n await self.set_role(int(user), role)\n\n async def kick_user(self, user: UserOrUserId):\n \"\"\"\n Kicks a user from a group.\n\n Arguments:\n user: The user who will be kicked from the group.\n \"\"\"\n await self._client.requests.delete(\n url=self._client.url_generator.get_url(\"groups\", f\"v1/groups/{self.id}/users/{int(user)}\")\n )\n\n async def delete_all_messages(self, user: UserOrUserId):\n \"\"\"\n Deletes all messages from a user in a group.\n\n Arguments:\n user: The user who will have their messages deleted.\n \"\"\"\n await self._client.requests.delete(\n url=self._client.url_generator.get_url(\"groups\", f\"/v1/groups/{self.id}/wall/users/{int(user)}/posts\")\n )\n\n def get_wall_posts(self, page_size: int = 10, sort_order: SortOrder = SortOrder.Ascending,\n max_items: int = None) -> PageIterator:\n \"\"\"\n Gets wall posts of a group.\n\n Arguments:\n page_size: How many posts should be returned for each page.\n sort_order: Order in which data should be grabbed.\n max_items: The maximum items to return when looping through this object.\n\n Returns: A PageIterator.\n \"\"\"\n return PageIterator(\n client=self._client,\n url=self._client.url_generator.get_url(\"groups\", f\"v2/groups/{self.id}/wall/posts\"),\n page_size=page_size,\n sort_order=sort_order,\n max_items=max_items,\n handler=lambda client, data: WallPost(client=client, data=data, group=self)\n )\n\n def get_wall_post(self, post_id: int) -> WallPostRelationship:\n \"\"\"\n Gets a wall post from an ID.\n\n Arguments:\n post_id: A post ID.\n\n Returns:\n A basic wall post relationship.\n \"\"\"\n return WallPostRelationship(\n client=self._client,\n post_id=post_id,\n group=self\n )\n\n def get_join_requests(self, page_size: int = 10, sort_order: SortOrder = SortOrder.Ascending,\n max_items: int = None) -> PageIterator:\n \"\"\"\n Gets all of this group's join requests.\n\n Arguments:\n page_size: How many members should be returned for each page.\n sort_order: Order in which data should be grabbed.\n max_items: The maximum items to return when looping through this object.\n\n Returns:\n A PageIterator containing group join requests.\n \"\"\"\n return PageIterator(\n client=self._client,\n url=self._client.url_generator.get_url(\"groups\", f\"v1/groups/{self.id}/join-requests\"),\n page_size=page_size,\n sort_order=sort_order,\n max_items=max_items,\n handler=lambda client, data: JoinRequest(client=client, data=data, group=self)\n )\n\n async def get_join_request(self, user: Union[int, BaseUser]) -> Optional[JoinRequest]:\n \"\"\"\n Gets a specific user's join request to this group.\n\n Returns:\n The user's join request, or None if they have no active join request.\n \"\"\"\n join_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"groups\", f\"v1/groups/{self.id}/join-requests/users/{int(user)}\")\n )\n join_data = join_response.json()\n return join_data and JoinRequest(\n\n client=self._client,\n data=join_data,\n group=self\n ) or None\n\n async def accept_user(self, user: Union[int, BaseUser, JoinRequest]):\n \"\"\"\n Accepts a user's request to join this group.\n\n Arguments:\n user: The user to accept into this group.\n \"\"\"\n await self._client.requests.post(\n url=self._client.url_generator.get_url(\"groups\", f\"v1/groups/{self.id}/join-requests/users/{int(user)}\")\n )\n\n async def decline_user(self, user: Union[int, BaseUser, JoinRequest]):\n \"\"\"\n Declines a user's request to join this group.\n\n Arguments:\n user: The user to decline from this group.\n \"\"\"\n await self._client.requests.delete(\n url=self._client.url_generator.get_url(\"groups\", f\"v1/groups/{self.id}/join-requests/users/{int(user)}\")\n )\n\n async def update_shout(self, message: str) -> Optional[Shout]:\n \"\"\"\n Updates the shout.\n\n Arguments:\n message: The new shout message.\n \"\"\"\n shout_response = await self._client.requests.patch(\n url=self._client.url_generator.get_url(\"groups\", f\"v1/groups/{self.id}/status\"),\n json={\n \"message\": message\n }\n )\n shout_data = shout_response.json()\n\n new_shout: Optional[Shout] = shout_data and Shout(\n client=self._client,\n data=shout_data\n ) or None\n\n return new_shout\n\n async def get_social_links(self) -> List[SocialLink]:\n \"\"\"\n Gets the group's social links.\n\n Returns:\n A list of the universe's social links.\n \"\"\"\n\n links_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"groups\", f\"v1/groups/{self.id}/social-links\")\n )\n links_data = links_response.json()[\"data\"]\n return [SocialLink(client=self._client, data=link_data) for link_data in links_data]\n\n def get_name_history(\n self, \n page_size: int = 10, \n sort_order: SortOrder = SortOrder.Ascending, \n max_items: int = None\n ) -> PageIterator:\n \"\"\"\n Grabs the groups's name history.\n\n Arguments:\n page_size: How many members should be returned for each page.\n sort_order: Order in which data should be grabbed.\n max_items: The maximum items to return when looping through this object.\n\n Returns:\n A PageIterator containing the groups's name history.\n \"\"\"\n return PageIterator(\n client=self._client,\n url=self._client.url_generator.get_url(\n \"groups\", f\"v1/groups/{self.id}/name-history\"\n ),\n page_size=page_size,\n sort_order=sort_order,\n max_items=max_items,\n handler=lambda client, data: GroupNameHistoryItem(client=client, data=data),\n )\n
"},{"location":"reference/bases/basegroup/#roblox.bases.basegroup.BaseGroup.__init__","title":"__init__(client, group_id)
","text":"Parameters:
Name Type Description Defaultclient
Client
The Client this object belongs to.
requiredgroup_id
int
The group's ID.
required Source code inroblox/bases/basegroup.py
def __init__(self, client: Client, group_id: int):\n \"\"\"\n Parameters:\n client: The Client this object belongs to.\n group_id: The group's ID.\n \"\"\"\n self._client: Client = client\n self.id: int = group_id\n
"},{"location":"reference/bases/basegroup/#roblox.bases.basegroup.BaseGroup.accept_user","title":"accept_user(user)
async
","text":"Accepts a user's request to join this group.
Parameters:
Name Type Description Defaultuser
Union[int, BaseUser, JoinRequest]
The user to accept into this group.
required Source code inroblox/bases/basegroup.py
async def accept_user(self, user: Union[int, BaseUser, JoinRequest]):\n \"\"\"\n Accepts a user's request to join this group.\n\n Arguments:\n user: The user to accept into this group.\n \"\"\"\n await self._client.requests.post(\n url=self._client.url_generator.get_url(\"groups\", f\"v1/groups/{self.id}/join-requests/users/{int(user)}\")\n )\n
"},{"location":"reference/bases/basegroup/#roblox.bases.basegroup.BaseGroup.decline_user","title":"decline_user(user)
async
","text":"Declines a user's request to join this group.
Parameters:
Name Type Description Defaultuser
Union[int, BaseUser, JoinRequest]
The user to decline from this group.
required Source code inroblox/bases/basegroup.py
async def decline_user(self, user: Union[int, BaseUser, JoinRequest]):\n \"\"\"\n Declines a user's request to join this group.\n\n Arguments:\n user: The user to decline from this group.\n \"\"\"\n await self._client.requests.delete(\n url=self._client.url_generator.get_url(\"groups\", f\"v1/groups/{self.id}/join-requests/users/{int(user)}\")\n )\n
"},{"location":"reference/bases/basegroup/#roblox.bases.basegroup.BaseGroup.delete_all_messages","title":"delete_all_messages(user)
async
","text":"Deletes all messages from a user in a group.
Parameters:
Name Type Description Defaultuser
UserOrUserId
The user who will have their messages deleted.
required Source code inroblox/bases/basegroup.py
async def delete_all_messages(self, user: UserOrUserId):\n \"\"\"\n Deletes all messages from a user in a group.\n\n Arguments:\n user: The user who will have their messages deleted.\n \"\"\"\n await self._client.requests.delete(\n url=self._client.url_generator.get_url(\"groups\", f\"/v1/groups/{self.id}/wall/users/{int(user)}/posts\")\n )\n
"},{"location":"reference/bases/basegroup/#roblox.bases.basegroup.BaseGroup.get_join_request","title":"get_join_request(user)
async
","text":"Gets a specific user's join request to this group.
Returns:
Type DescriptionOptional[JoinRequest]
The user's join request, or None if they have no active join request.
Source code inroblox/bases/basegroup.py
async def get_join_request(self, user: Union[int, BaseUser]) -> Optional[JoinRequest]:\n \"\"\"\n Gets a specific user's join request to this group.\n\n Returns:\n The user's join request, or None if they have no active join request.\n \"\"\"\n join_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"groups\", f\"v1/groups/{self.id}/join-requests/users/{int(user)}\")\n )\n join_data = join_response.json()\n return join_data and JoinRequest(\n\n client=self._client,\n data=join_data,\n group=self\n ) or None\n
"},{"location":"reference/bases/basegroup/#roblox.bases.basegroup.BaseGroup.get_join_requests","title":"get_join_requests(page_size=10, sort_order=SortOrder.Ascending, max_items=None)
","text":"Gets all of this group's join requests.
Parameters:
Name Type Description Defaultpage_size
int
How many members should be returned for each page.
10
sort_order
SortOrder
Order in which data should be grabbed.
Ascending
max_items
int
The maximum items to return when looping through this object.
None
Returns:
Type DescriptionPageIterator
A PageIterator containing group join requests.
Source code inroblox/bases/basegroup.py
def get_join_requests(self, page_size: int = 10, sort_order: SortOrder = SortOrder.Ascending,\n max_items: int = None) -> PageIterator:\n \"\"\"\n Gets all of this group's join requests.\n\n Arguments:\n page_size: How many members should be returned for each page.\n sort_order: Order in which data should be grabbed.\n max_items: The maximum items to return when looping through this object.\n\n Returns:\n A PageIterator containing group join requests.\n \"\"\"\n return PageIterator(\n client=self._client,\n url=self._client.url_generator.get_url(\"groups\", f\"v1/groups/{self.id}/join-requests\"),\n page_size=page_size,\n sort_order=sort_order,\n max_items=max_items,\n handler=lambda client, data: JoinRequest(client=client, data=data, group=self)\n )\n
"},{"location":"reference/bases/basegroup/#roblox.bases.basegroup.BaseGroup.get_member","title":"get_member(user)
","text":"Gets a member of a group.
Parameters:
Name Type Description Defaultuser
Union[int, BaseUser]
A BaseUser or a User ID.
requiredReturns:
Type DescriptionMemberRelationship
A member.
Source code inroblox/bases/basegroup.py
def get_member(self, user: Union[int, BaseUser]) -> MemberRelationship:\n \"\"\"\n Gets a member of a group.\n\n Arguments:\n user: A BaseUser or a User ID.\n\n Returns:\n A member.\n \"\"\"\n return MemberRelationship(\n client=self._client,\n user=user,\n group=self\n )\n
"},{"location":"reference/bases/basegroup/#roblox.bases.basegroup.BaseGroup.get_member_by_username","title":"get_member_by_username(username, exclude_banned_users=False)
async
","text":"Gets a member of a group by username.
Parameters:
Name Type Description Defaultusername
str
A Roblox username.
requiredexclude_banned_users
bool
Whether to exclude banned users from the data.
False
Returns:
Type DescriptionMemberRelationship
A member.
Source code inroblox/bases/basegroup.py
async def get_member_by_username(self, username: str, exclude_banned_users: bool = False) -> MemberRelationship:\n \"\"\"\n Gets a member of a group by username.\n\n Arguments:\n username: A Roblox username.\n exclude_banned_users: Whether to exclude banned users from the data.\n\n Returns:\n A member.\n \"\"\"\n\n user: RequestedUsernamePartialUser = await self._client.get_user_by_username(\n username=username,\n exclude_banned_users=exclude_banned_users,\n expand=False\n )\n\n return MemberRelationship(\n client=self._client,\n user=user,\n group=self\n )\n
"},{"location":"reference/bases/basegroup/#roblox.bases.basegroup.BaseGroup.get_members","title":"get_members(page_size=10, sort_order=SortOrder.Ascending, max_items=None)
","text":"Gets all members of a group.
Parameters:
Name Type Description Defaultpage_size
int
How many members should be returned for each page.
10
sort_order
SortOrder
Order in which data should be grabbed.
Ascending
max_items
int
The maximum items to return when looping through this object.
None
Returns:
Type DescriptionPageIterator
A PageIterator containing the group's members.
Source code inroblox/bases/basegroup.py
def get_members(self, page_size: int = 10, sort_order: SortOrder = SortOrder.Ascending,\n max_items: int = None) -> PageIterator:\n \"\"\"\n Gets all members of a group.\n\n Arguments:\n page_size: How many members should be returned for each page.\n sort_order: Order in which data should be grabbed.\n max_items: The maximum items to return when looping through this object.\n\n Returns:\n A PageIterator containing the group's members.\n \"\"\"\n return PageIterator(\n client=self._client,\n url=self._client.url_generator.get_url(\"groups\", f\"v1/groups/{self.id}/users\"),\n page_size=page_size,\n sort_order=sort_order,\n max_items=max_items,\n handler=lambda client, data: Member(client=client, data=data, group=self)\n )\n
"},{"location":"reference/bases/basegroup/#roblox.bases.basegroup.BaseGroup.get_name_history","title":"get_name_history(page_size=10, sort_order=SortOrder.Ascending, max_items=None)
","text":"Grabs the groups's name history.
Parameters:
Name Type Description Defaultpage_size
int
How many members should be returned for each page.
10
sort_order
SortOrder
Order in which data should be grabbed.
Ascending
max_items
int
The maximum items to return when looping through this object.
None
Returns:
Type DescriptionPageIterator
A PageIterator containing the groups's name history.
Source code inroblox/bases/basegroup.py
def get_name_history(\n self, \n page_size: int = 10, \n sort_order: SortOrder = SortOrder.Ascending, \n max_items: int = None\n) -> PageIterator:\n \"\"\"\n Grabs the groups's name history.\n\n Arguments:\n page_size: How many members should be returned for each page.\n sort_order: Order in which data should be grabbed.\n max_items: The maximum items to return when looping through this object.\n\n Returns:\n A PageIterator containing the groups's name history.\n \"\"\"\n return PageIterator(\n client=self._client,\n url=self._client.url_generator.get_url(\n \"groups\", f\"v1/groups/{self.id}/name-history\"\n ),\n page_size=page_size,\n sort_order=sort_order,\n max_items=max_items,\n handler=lambda client, data: GroupNameHistoryItem(client=client, data=data),\n )\n
"},{"location":"reference/bases/basegroup/#roblox.bases.basegroup.BaseGroup.get_roles","title":"get_roles()
async
","text":"Gets all roles of the group.
Returns:
Type DescriptionList[Role]
A list of the group's roles.
Source code inroblox/bases/basegroup.py
async def get_roles(self) -> List[Role]:\n \"\"\"\n Gets all roles of the group.\n\n Returns:\n A list of the group's roles.\n \"\"\"\n roles_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"groups\", f\"v1/groups/{self.id}/roles\")\n )\n roles_data = roles_response.json()\n return [Role(\n client=self._client,\n data=role_data,\n group=self\n ) for role_data in roles_data[\"roles\"]]\n
"},{"location":"reference/bases/basegroup/#roblox.bases.basegroup.BaseGroup.get_settings","title":"get_settings()
async
","text":"Gets all the settings of the selected group
Returns:
Type DescriptionGroupSettings
The group's settings.
Source code inroblox/bases/basegroup.py
async def get_settings(self) -> GroupSettings:\n \"\"\"\n Gets all the settings of the selected group\n\n Returns:\n The group's settings.\n \"\"\"\n settings_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"groups\", f\"v1/groups/{self.id}/settings\"),\n )\n settings_data = settings_response.json()\n return GroupSettings(\n client=self._client,\n data=settings_data\n )\n
"},{"location":"reference/bases/basegroup/#roblox.bases.basegroup.BaseGroup.get_social_links","title":"get_social_links()
async
","text":"Gets the group's social links.
Returns:
Type DescriptionList[SocialLink]
A list of the universe's social links.
Source code inroblox/bases/basegroup.py
async def get_social_links(self) -> List[SocialLink]:\n \"\"\"\n Gets the group's social links.\n\n Returns:\n A list of the universe's social links.\n \"\"\"\n\n links_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"groups\", f\"v1/groups/{self.id}/social-links\")\n )\n links_data = links_response.json()[\"data\"]\n return [SocialLink(client=self._client, data=link_data) for link_data in links_data]\n
"},{"location":"reference/bases/basegroup/#roblox.bases.basegroup.BaseGroup.get_wall_post","title":"get_wall_post(post_id)
","text":"Gets a wall post from an ID.
Parameters:
Name Type Description Defaultpost_id
int
A post ID.
requiredReturns:
Type DescriptionWallPostRelationship
A basic wall post relationship.
Source code inroblox/bases/basegroup.py
def get_wall_post(self, post_id: int) -> WallPostRelationship:\n \"\"\"\n Gets a wall post from an ID.\n\n Arguments:\n post_id: A post ID.\n\n Returns:\n A basic wall post relationship.\n \"\"\"\n return WallPostRelationship(\n client=self._client,\n post_id=post_id,\n group=self\n )\n
"},{"location":"reference/bases/basegroup/#roblox.bases.basegroup.BaseGroup.get_wall_posts","title":"get_wall_posts(page_size=10, sort_order=SortOrder.Ascending, max_items=None)
","text":"Gets wall posts of a group.
Parameters:
Name Type Description Defaultpage_size
int
How many posts should be returned for each page.
10
sort_order
SortOrder
Order in which data should be grabbed.
Ascending
max_items
int
The maximum items to return when looping through this object.
None
Source code in roblox/bases/basegroup.py
def get_wall_posts(self, page_size: int = 10, sort_order: SortOrder = SortOrder.Ascending,\n max_items: int = None) -> PageIterator:\n \"\"\"\n Gets wall posts of a group.\n\n Arguments:\n page_size: How many posts should be returned for each page.\n sort_order: Order in which data should be grabbed.\n max_items: The maximum items to return when looping through this object.\n\n Returns: A PageIterator.\n \"\"\"\n return PageIterator(\n client=self._client,\n url=self._client.url_generator.get_url(\"groups\", f\"v2/groups/{self.id}/wall/posts\"),\n page_size=page_size,\n sort_order=sort_order,\n max_items=max_items,\n handler=lambda client, data: WallPost(client=client, data=data, group=self)\n )\n
"},{"location":"reference/bases/basegroup/#roblox.bases.basegroup.BaseGroup.kick_user","title":"kick_user(user)
async
","text":"Kicks a user from a group.
Parameters:
Name Type Description Defaultuser
UserOrUserId
The user who will be kicked from the group.
required Source code inroblox/bases/basegroup.py
async def kick_user(self, user: UserOrUserId):\n \"\"\"\n Kicks a user from a group.\n\n Arguments:\n user: The user who will be kicked from the group.\n \"\"\"\n await self._client.requests.delete(\n url=self._client.url_generator.get_url(\"groups\", f\"v1/groups/{self.id}/users/{int(user)}\")\n )\n
"},{"location":"reference/bases/basegroup/#roblox.bases.basegroup.BaseGroup.set_rank","title":"set_rank(user, rank)
async
","text":"Changes a member's role using a rank number.
Parameters:
Name Type Description Defaultuser
UserOrUserId
The user who's rank will be changed.
requiredrank
int
The rank number to change to. (1-255)
required Source code inroblox/bases/basegroup.py
async def set_rank(self, user: UserOrUserId, rank: int) -> None:\n \"\"\"\n Changes a member's role using a rank number.\n\n Arguments:\n user: The user who's rank will be changed.\n rank: The rank number to change to. (1-255)\n \"\"\"\n roles = await self.get_roles()\n\n role = next((role for role in roles if role.rank == rank), None)\n if not role:\n raise InvalidRole(f\"Role with rank number {rank} does not exist.\")\n\n await self.set_role(int(user), role)\n
"},{"location":"reference/bases/basegroup/#roblox.bases.basegroup.BaseGroup.set_role","title":"set_role(user, role)
async
","text":"Sets a users role.
Parameters:
Name Type Description Defaultuser
UserOrUserId
The user who's rank will be changed.
requiredrole
RoleOrRoleId
The new role.
required Source code inroblox/bases/basegroup.py
async def set_role(self, user: UserOrUserId, role: RoleOrRoleId) -> None:\n \"\"\"\n Sets a users role.\n\n Arguments:\n user: The user who's rank will be changed.\n role: The new role.\n \"\"\"\n await self._client.requests.patch(\n url=self._client.url_generator.get_url(\"groups\", f\"v1/groups/{self.id}/users/{int(user)}\"),\n json={\n \"roleId\": int(role)\n }\n )\n
"},{"location":"reference/bases/basegroup/#roblox.bases.basegroup.BaseGroup.update_settings","title":"update_settings(is_approval_required=None, is_builders_club_required=None, are_enemies_allowed=None, are_group_funds_visible=None, are_group_games_visible=None)
async
","text":"Updates this group's settings. Passing None
will default this setting to the value already present in the
Parameters:
Name Type Description Defaultis_approval_required
Optional[bool]
Whether approval is required via a join request before joining this group.
None
is_builders_club_required
Optional[bool]
Whether users are required to have a Premium subscription to join this group.
None
are_enemies_allowed
Optional[bool]
Whether this group can send and recieve enemy requests.
None
are_group_funds_visible
Optional[bool]
Whether the group fund balance is visible to external users.
None
are_group_games_visible
Optional[bool]
Whether group games are visible to external users.
None
Source code in roblox/bases/basegroup.py
async def update_settings(\n self,\n is_approval_required: Optional[bool] = None,\n is_builders_club_required: Optional[bool] = None,\n are_enemies_allowed: Optional[bool] = None,\n are_group_funds_visible: Optional[bool] = None,\n are_group_games_visible: Optional[bool] = None,\n) -> None:\n \"\"\"\n Updates this group's settings. Passing `None` will default this setting to the value already present in the\n\n Arguments:\n is_approval_required: Whether approval is required via a join request before joining this group.\n is_builders_club_required: Whether users are required to have a Premium subscription to join this group.\n are_enemies_allowed: Whether this group can send and recieve enemy requests.\n are_group_funds_visible: Whether the group fund balance is visible to external users.\n are_group_games_visible: Whether group games are visible to external users.\n \"\"\"\n await self._client.requests.patch(\n url=self._client.url_generator.get_url(\"groups\", f\"v1/groups/{self.id}/settings\"),\n json={\n \"isApprovalRequired\": is_approval_required,\n \"isBuildersClubRequired\": is_builders_club_required,\n \"areEnemiesAllowed\": are_enemies_allowed,\n \"areGroupFundsVisible\": are_group_funds_visible,\n \"areGroupGamesVisible\": are_group_games_visible,\n }\n )\n
"},{"location":"reference/bases/basegroup/#roblox.bases.basegroup.BaseGroup.update_shout","title":"update_shout(message)
async
","text":"Updates the shout.
Parameters:
Name Type Description Defaultmessage
str
The new shout message.
required Source code inroblox/bases/basegroup.py
async def update_shout(self, message: str) -> Optional[Shout]:\n \"\"\"\n Updates the shout.\n\n Arguments:\n message: The new shout message.\n \"\"\"\n shout_response = await self._client.requests.patch(\n url=self._client.url_generator.get_url(\"groups\", f\"v1/groups/{self.id}/status\"),\n json={\n \"message\": message\n }\n )\n shout_data = shout_response.json()\n\n new_shout: Optional[Shout] = shout_data and Shout(\n client=self._client,\n data=shout_data\n ) or None\n\n return new_shout\n
"},{"location":"reference/bases/basegroup/#roblox.bases.basegroup.GroupNameHistoryItem","title":"GroupNameHistoryItem
","text":"Represents a group's previous name.
Attributes:
Name Type Descriptionname
str
The group's previous name.
created
datetime
A datetime object representing when this name was changed.
Source code inroblox/bases/basegroup.py
class GroupNameHistoryItem:\n \"\"\"\n Represents a group's previous name.\n\n Attributes:\n name: The group's previous name.\n created: A datetime object representing when this name was changed.\n \"\"\"\n\n def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: The Client this object belongs to.\n data: The group's previous name data.\n \"\"\"\n\n self._client: Client = client\n self.name: str = data[\"name\"]\n self.created: datetime = parse(data[\"created\"])\n\n def __repr__(self):\n return f\"<{self.__class__.__name__} name={self.name!r} created={self.created}>\"\n
"},{"location":"reference/bases/basegroup/#roblox.bases.basegroup.GroupNameHistoryItem.__init__","title":"__init__(client, data)
","text":"Parameters:
Name Type Description Defaultclient
Client
The Client this object belongs to.
requireddata
dict
The group's previous name data.
required Source code inroblox/bases/basegroup.py
def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: The Client this object belongs to.\n data: The group's previous name data.\n \"\"\"\n\n self._client: Client = client\n self.name: str = data[\"name\"]\n self.created: datetime = parse(data[\"created\"])\n
"},{"location":"reference/bases/basegroup/#roblox.bases.basegroup.GroupSettings","title":"GroupSettings
","text":"Represents a group's settings.
Attributes:
Name Type Descriptionis_approval_required
bool
Whether approval is required to join this group.
is_builders_club_required
bool
Whether a membership is required to join this group.
are_enemies_allowed
bool
Whether group enemies are allowed.
are_group_funds_visible
bool
Whether group funds are visible.
are_group_games_visible
bool
Whether group games are visible.
is_group_name_change_enabled
bool
Whether group name changes are enabled.
can_change_group_name
bool
Whether the name of this group can be changed.
Source code inroblox/bases/basegroup.py
class GroupSettings:\n \"\"\"\n Represents a group's settings.\n\n Attributes:\n is_approval_required: Whether approval is required to join this group.\n is_builders_club_required: Whether a membership is required to join this group.\n are_enemies_allowed: Whether group enemies are allowed.\n are_group_funds_visible: Whether group funds are visible.\n are_group_games_visible: Whether group games are visible.\n is_group_name_change_enabled: Whether group name changes are enabled.\n can_change_group_name: Whether the name of this group can be changed.\n \"\"\"\n\n def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: The Client this object belongs to.\n data: The group settings data.\n \"\"\"\n\n self._client: Client = client\n self.is_approval_required: bool = data[\"isApprovalRequired\"]\n self.is_builders_club_required: bool = data[\"isBuildersClubRequired\"]\n self.are_enemies_allowed: bool = data[\"areEnemiesAllowed\"]\n self.are_group_funds_visible: bool = data[\"areGroupFundsVisible\"]\n self.are_group_games_visible: bool = data[\"areGroupGamesVisible\"]\n self.is_group_name_change_enabled: bool = data[\"isGroupNameChangeEnabled\"]\n self.can_change_group_name: bool = data[\"canChangeGroupName\"]\n
"},{"location":"reference/bases/basegroup/#roblox.bases.basegroup.GroupSettings.__init__","title":"__init__(client, data)
","text":"Parameters:
Name Type Description Defaultclient
Client
The Client this object belongs to.
requireddata
dict
The group settings data.
required Source code inroblox/bases/basegroup.py
def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: The Client this object belongs to.\n data: The group settings data.\n \"\"\"\n\n self._client: Client = client\n self.is_approval_required: bool = data[\"isApprovalRequired\"]\n self.is_builders_club_required: bool = data[\"isBuildersClubRequired\"]\n self.are_enemies_allowed: bool = data[\"areEnemiesAllowed\"]\n self.are_group_funds_visible: bool = data[\"areGroupFundsVisible\"]\n self.are_group_games_visible: bool = data[\"areGroupGamesVisible\"]\n self.is_group_name_change_enabled: bool = data[\"isGroupNameChangeEnabled\"]\n self.can_change_group_name: bool = data[\"canChangeGroupName\"]\n
"},{"location":"reference/bases/basegroup/#roblox.bases.basegroup.JoinRequest","title":"JoinRequest
","text":"Represents a group join request.
Attributes:
Name Type Descriptioncreated
datetime
When this join request was sent.
requester
The user that sent the join request.
group
BaseGroup
The parent group that this join request is linked to.
Source code inroblox/bases/basegroup.py
class JoinRequest:\n \"\"\"\n Represents a group join request.\n\n Attributes:\n created: When this join request was sent.\n requester: The user that sent the join request.\n group: The parent group that this join request is linked to.\n \"\"\"\n\n def __init__(self, client: Client, data: dict, group: Union[BaseGroup, int]):\n self._client: Client = client\n self.created: datetime = parse(data[\"created\"])\n self.requester = PartialUser(client=self._client, data=data[\"requester\"])\n self.group: BaseGroup\n if isinstance(group, int):\n self.group = BaseGroup(client=self._client, group_id=group)\n else:\n self.group = group\n\n def __int__(self):\n return self.requester.id\n\n async def accept(self):\n \"\"\"\n Accepts this join request.\n \"\"\"\n await self.group.accept_user(self)\n\n async def decline(self):\n \"\"\"\n Declines this join request.\n \"\"\"\n await self.group.decline_user(self)\n
"},{"location":"reference/bases/basegroup/#roblox.bases.basegroup.JoinRequest.accept","title":"accept()
async
","text":"Accepts this join request.
Source code inroblox/bases/basegroup.py
async def accept(self):\n \"\"\"\n Accepts this join request.\n \"\"\"\n await self.group.accept_user(self)\n
"},{"location":"reference/bases/basegroup/#roblox.bases.basegroup.JoinRequest.decline","title":"decline()
async
","text":"Declines this join request.
Source code inroblox/bases/basegroup.py
async def decline(self):\n \"\"\"\n Declines this join request.\n \"\"\"\n await self.group.decline_user(self)\n
"},{"location":"reference/bases/baseinstance/","title":"baseinstance","text":"This file contains the BaseInstance object, which represents a Roblox instance ID.
"},{"location":"reference/bases/baseinstance/#roblox.bases.baseinstance.BaseInstance","title":"BaseInstance
","text":" Bases: BaseItem
Represents a Roblox instance ID. Instance IDs represent the ownership of a single Roblox item.
Attributes:
Name Type Descriptionid
int
The instance ID.
Source code inroblox/bases/baseinstance.py
class BaseInstance(BaseItem):\n \"\"\"\n Represents a Roblox instance ID.\n Instance IDs represent the ownership of a single Roblox item.\n\n Attributes:\n id: The instance ID.\n \"\"\"\n\n def __init__(self, client: Client, instance_id: int):\n \"\"\"\n Arguments:\n client: The Client this object belongs to.\n instance_id: The asset instance ID.\n \"\"\"\n\n self._client: Client = client\n self.id: int = instance_id\n
"},{"location":"reference/bases/baseinstance/#roblox.bases.baseinstance.BaseInstance.__init__","title":"__init__(client, instance_id)
","text":"Parameters:
Name Type Description Defaultclient
Client
The Client this object belongs to.
requiredinstance_id
int
The asset instance ID.
required Source code inroblox/bases/baseinstance.py
def __init__(self, client: Client, instance_id: int):\n \"\"\"\n Arguments:\n client: The Client this object belongs to.\n instance_id: The asset instance ID.\n \"\"\"\n\n self._client: Client = client\n self.id: int = instance_id\n
"},{"location":"reference/bases/baseitem/","title":"baseitem","text":"This file contains the BaseItem class, which all bases inherit.
"},{"location":"reference/bases/baseitem/#roblox.bases.baseitem.BaseItem","title":"BaseItem
","text":"This object represents a base Roblox item. All other bases inherit this object. This object overrides equals and not-equals methods ensuring that two bases with the same ID are always equal.
Source code inroblox/bases/baseitem.py
class BaseItem:\n \"\"\"\n This object represents a base Roblox item. All other bases inherit this object.\n This object overrides equals and not-equals methods ensuring that two bases with the same ID are always equal.\n \"\"\"\n id = None\n\n def __repr__(self):\n attributes_repr = \"\".join(f\" {key}={value!r}\" for key, value in self.__dict__.items() if not key.startswith(\"_\"))\n return f\"<{self.__class__.__name__}{attributes_repr}>\"\n\n def __int__(self):\n return self.id\n\n def __eq__(self, other):\n return isinstance(other, self.__class__) and other.id == self.id\n\n def __ne__(self, other):\n if isinstance(other, self.__class__):\n return other.id != self.id\n return True\n
"},{"location":"reference/bases/basejob/","title":"basejob","text":"This file contains the BaseJob object, which represents a Roblox job ID.
"},{"location":"reference/bases/basejob/#roblox.bases.basejob.BaseJob","title":"BaseJob
","text":" Bases: BaseItem
Represents Roblox job ID.
Job IDs are UUIDs that represent a single game server instance. Learn more on the Developer Hub here.
Attributes:
Name Type Descriptionid
str
The job ID.
Source code inroblox/bases/basejob.py
class BaseJob(BaseItem):\n \"\"\"\n Represents Roblox job ID.\n\n Job IDs are UUIDs that represent a single game server instance.\n Learn more on the Developer Hub [here](https://developer.roblox.com/en-us/api-reference/property/DataModel/JobId).\n\n Attributes:\n id: The job ID.\n \"\"\"\n\n def __init__(self, client: Client, job_id: str):\n \"\"\"\n Arguments:\n client: The Client this object belongs to.\n job_id: The job ID.\n \"\"\"\n\n self._client: Client = client\n self.id: str = job_id\n
"},{"location":"reference/bases/basejob/#roblox.bases.basejob.BaseJob.__init__","title":"__init__(client, job_id)
","text":"Parameters:
Name Type Description Defaultclient
Client
The Client this object belongs to.
requiredjob_id
str
The job ID.
required Source code inroblox/bases/basejob.py
def __init__(self, client: Client, job_id: str):\n \"\"\"\n Arguments:\n client: The Client this object belongs to.\n job_id: The job ID.\n \"\"\"\n\n self._client: Client = client\n self.id: str = job_id\n
"},{"location":"reference/bases/baseplace/","title":"baseplace","text":"This file contains the BasePlace object, which represents a Roblox place ID.
"},{"location":"reference/bases/baseplace/#roblox.bases.baseplace.BasePlace","title":"BasePlace
","text":" Bases: BaseAsset
Represents a Roblox place ID. Places are a form of Asset and as such this object derives from BaseAsset.
Attributes:
Name Type Descriptionid
int
The place ID.
Source code inroblox/bases/baseplace.py
class BasePlace(BaseAsset):\n \"\"\"\n Represents a Roblox place ID.\n Places are a form of Asset and as such this object derives from BaseAsset.\n\n Attributes:\n id: The place ID.\n \"\"\"\n\n def __init__(self, client: Client, place_id: int):\n \"\"\"\n Arguments:\n client: The Client this object belongs to.\n place_id: The place ID.\n \"\"\"\n\n super().__init__(client, place_id)\n\n self._client: Client = client\n self.id: int = place_id\n\n async def get_instances(self, start_index: int = 0):\n \"\"\"\n Returns a list of this place's current active servers, known in the API as \"game instances\".\n This list always contains 10 items or fewer.\n For more items, add 10 to the start index and repeat until no more items are available.\n\n !!! warning\n This function has been deprecated. The Roblox endpoint used by this function has been removed. Please update any code using this method to use \n\n Arguments:\n start_index: Where to start in the server index.\n \"\"\"\n from ..jobs import GameInstances\n\n instances_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"www\", f\"games/getgameinstancesjson\"),\n params={\n \"placeId\": self.id,\n \"startIndex\": start_index\n }\n )\n instances_data = instances_response.json()\n return GameInstances(\n client=self._client,\n data=instances_data\n )\n\n def get_servers(\n self,\n server_type: ServerType,\n page_size: int = 10, \n sort_order: SortOrder = SortOrder.Descending, \n exclude_full_games: bool = False,\n max_items: int = None\n ) -> PageIterator:\n \"\"\"\n Grabs the place's servers.\n\n Arguments:\n server_type: The type of servers to return.\n page_size: How many servers should be returned for each page.\n sort_order: Order in which data should be grabbed.\n exclude_full_games: Whether to exclude full servers.\n max_items: The maximum items to return when looping through this object.\n\n Returns:\n A PageIterator containing servers.\n \"\"\"\n from ..jobs import Server\n\n return PageIterator(\n client=self._client,\n url=self._client._url_generator.get_url(\"games\", f\"v1/games/{self.id}/servers/{server_type.value}\"),\n page_size=page_size,\n max_items=max_items,\n sort_order=sort_order,\n extra_parameters={\"excludeFullGames\": exclude_full_games},\n handler=lambda client, data: Server(client=client, data=data),\n )\n\n def get_private_servers(\n self,\n page_size: int = 10, \n sort_order: SortOrder = SortOrder.Descending, \n max_items: int = None\n ) -> PageIterator:\n \"\"\"\n Grabs the private servers of a place the authenticated user can access.\n\n Arguments:\n page_size: How many private servers should be returned for each page.\n sort_order: Order in which data should be grabbed.\n max_items: The maximum items to return when looping through this object.\n\n Returns:\n A PageIterator containing private servers.\n \"\"\"\n from ..jobs import PrivateServer\n\n return PageIterator(\n client=self._client,\n url=self._client._url_generator.get_url(\"games\", f\"v1/games/{self.id}/private-servers\"),\n page_size=page_size,\n max_items=max_items,\n sort_order=sort_order,\n handler=lambda client, data: PrivateServer(client=client, data=data),\n )\n
"},{"location":"reference/bases/baseplace/#roblox.bases.baseplace.BasePlace.__init__","title":"__init__(client, place_id)
","text":"Parameters:
Name Type Description Defaultclient
Client
The Client this object belongs to.
requiredplace_id
int
The place ID.
required Source code inroblox/bases/baseplace.py
def __init__(self, client: Client, place_id: int):\n \"\"\"\n Arguments:\n client: The Client this object belongs to.\n place_id: The place ID.\n \"\"\"\n\n super().__init__(client, place_id)\n\n self._client: Client = client\n self.id: int = place_id\n
"},{"location":"reference/bases/baseplace/#roblox.bases.baseplace.BasePlace.get_instances","title":"get_instances(start_index=0)
async
","text":"Returns a list of this place's current active servers, known in the API as \"game instances\". This list always contains 10 items or fewer. For more items, add 10 to the start index and repeat until no more items are available.
Warning
This function has been deprecated. The Roblox endpoint used by this function has been removed. Please update any code using this method to use
Parameters:
Name Type Description Defaultstart_index
int
Where to start in the server index.
0
Source code in roblox/bases/baseplace.py
async def get_instances(self, start_index: int = 0):\n \"\"\"\n Returns a list of this place's current active servers, known in the API as \"game instances\".\n This list always contains 10 items or fewer.\n For more items, add 10 to the start index and repeat until no more items are available.\n\n !!! warning\n This function has been deprecated. The Roblox endpoint used by this function has been removed. Please update any code using this method to use \n\n Arguments:\n start_index: Where to start in the server index.\n \"\"\"\n from ..jobs import GameInstances\n\n instances_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"www\", f\"games/getgameinstancesjson\"),\n params={\n \"placeId\": self.id,\n \"startIndex\": start_index\n }\n )\n instances_data = instances_response.json()\n return GameInstances(\n client=self._client,\n data=instances_data\n )\n
"},{"location":"reference/bases/baseplace/#roblox.bases.baseplace.BasePlace.get_private_servers","title":"get_private_servers(page_size=10, sort_order=SortOrder.Descending, max_items=None)
","text":"Grabs the private servers of a place the authenticated user can access.
Parameters:
Name Type Description Defaultpage_size
int
How many private servers should be returned for each page.
10
sort_order
SortOrder
Order in which data should be grabbed.
Descending
max_items
int
The maximum items to return when looping through this object.
None
Returns:
Type DescriptionPageIterator
A PageIterator containing private servers.
Source code inroblox/bases/baseplace.py
def get_private_servers(\n self,\n page_size: int = 10, \n sort_order: SortOrder = SortOrder.Descending, \n max_items: int = None\n) -> PageIterator:\n \"\"\"\n Grabs the private servers of a place the authenticated user can access.\n\n Arguments:\n page_size: How many private servers should be returned for each page.\n sort_order: Order in which data should be grabbed.\n max_items: The maximum items to return when looping through this object.\n\n Returns:\n A PageIterator containing private servers.\n \"\"\"\n from ..jobs import PrivateServer\n\n return PageIterator(\n client=self._client,\n url=self._client._url_generator.get_url(\"games\", f\"v1/games/{self.id}/private-servers\"),\n page_size=page_size,\n max_items=max_items,\n sort_order=sort_order,\n handler=lambda client, data: PrivateServer(client=client, data=data),\n )\n
"},{"location":"reference/bases/baseplace/#roblox.bases.baseplace.BasePlace.get_servers","title":"get_servers(server_type, page_size=10, sort_order=SortOrder.Descending, exclude_full_games=False, max_items=None)
","text":"Grabs the place's servers.
Parameters:
Name Type Description Defaultserver_type
ServerType
The type of servers to return.
requiredpage_size
int
How many servers should be returned for each page.
10
sort_order
SortOrder
Order in which data should be grabbed.
Descending
exclude_full_games
bool
Whether to exclude full servers.
False
max_items
int
The maximum items to return when looping through this object.
None
Returns:
Type DescriptionPageIterator
A PageIterator containing servers.
Source code inroblox/bases/baseplace.py
def get_servers(\n self,\n server_type: ServerType,\n page_size: int = 10, \n sort_order: SortOrder = SortOrder.Descending, \n exclude_full_games: bool = False,\n max_items: int = None\n) -> PageIterator:\n \"\"\"\n Grabs the place's servers.\n\n Arguments:\n server_type: The type of servers to return.\n page_size: How many servers should be returned for each page.\n sort_order: Order in which data should be grabbed.\n exclude_full_games: Whether to exclude full servers.\n max_items: The maximum items to return when looping through this object.\n\n Returns:\n A PageIterator containing servers.\n \"\"\"\n from ..jobs import Server\n\n return PageIterator(\n client=self._client,\n url=self._client._url_generator.get_url(\"games\", f\"v1/games/{self.id}/servers/{server_type.value}\"),\n page_size=page_size,\n max_items=max_items,\n sort_order=sort_order,\n extra_parameters={\"excludeFullGames\": exclude_full_games},\n handler=lambda client, data: Server(client=client, data=data),\n )\n
"},{"location":"reference/bases/baseplugin/","title":"baseplugin","text":"This file contains the BasePlugin object, which represents a Roblox plugin ID.
"},{"location":"reference/bases/baseplugin/#roblox.bases.baseplugin.BasePlugin","title":"BasePlugin
","text":" Bases: BaseAsset
Represents a Roblox plugin ID. Plugins are a form of Asset and as such this object derives from BaseAsset.
Attributes:
Name Type Descriptionid
int
The plugin ID.
Source code inroblox/bases/baseplugin.py
class BasePlugin(BaseAsset):\n \"\"\"\n Represents a Roblox plugin ID.\n Plugins are a form of Asset and as such this object derives from BaseAsset.\n\n Attributes:\n id: The plugin ID.\n \"\"\"\n\n def __init__(self, client: Client, plugin_id: int):\n \"\"\"\n Arguments:\n client: The Client this object belongs to.\n plugin_id: The plugin ID.\n \"\"\"\n\n super().__init__(client, plugin_id)\n\n self._client: Client = client\n self.id: int = plugin_id\n\n async def update(self, name: str = None, description: str = None, comments_enabled: str = None):\n \"\"\"\n Updates the plugin's data.\n\n Arguments:\n name: The new group name.\n description: The new group description.\n comments_enabled: Whether to enable comments.\n \"\"\"\n await self._client.requests.patch(\n url=self._client.url_generator.get_url(\n \"develop\", f\"v1/plugins/{self.id}\"\n ),\n json={\n \"name\": name,\n \"description\": description,\n \"commentsEnabled\": comments_enabled\n }\n )\n
"},{"location":"reference/bases/baseplugin/#roblox.bases.baseplugin.BasePlugin.__init__","title":"__init__(client, plugin_id)
","text":"Parameters:
Name Type Description Defaultclient
Client
The Client this object belongs to.
requiredplugin_id
int
The plugin ID.
required Source code inroblox/bases/baseplugin.py
def __init__(self, client: Client, plugin_id: int):\n \"\"\"\n Arguments:\n client: The Client this object belongs to.\n plugin_id: The plugin ID.\n \"\"\"\n\n super().__init__(client, plugin_id)\n\n self._client: Client = client\n self.id: int = plugin_id\n
"},{"location":"reference/bases/baseplugin/#roblox.bases.baseplugin.BasePlugin.update","title":"update(name=None, description=None, comments_enabled=None)
async
","text":"Updates the plugin's data.
Parameters:
Name Type Description Defaultname
str
The new group name.
None
description
str
The new group description.
None
comments_enabled
str
Whether to enable comments.
None
Source code in roblox/bases/baseplugin.py
async def update(self, name: str = None, description: str = None, comments_enabled: str = None):\n \"\"\"\n Updates the plugin's data.\n\n Arguments:\n name: The new group name.\n description: The new group description.\n comments_enabled: Whether to enable comments.\n \"\"\"\n await self._client.requests.patch(\n url=self._client.url_generator.get_url(\n \"develop\", f\"v1/plugins/{self.id}\"\n ),\n json={\n \"name\": name,\n \"description\": description,\n \"commentsEnabled\": comments_enabled\n }\n )\n
"},{"location":"reference/bases/baserobloxbadge/","title":"baserobloxbadge","text":"This file contains the BaseRobloxBadge object, which represents a Roblox roblox badge ID.
"},{"location":"reference/bases/baserobloxbadge/#roblox.bases.baserobloxbadge.BaseRobloxBadge","title":"BaseRobloxBadge
","text":" Bases: BaseItem
Represents a Roblox roblox badge ID.
Warning
This is not a badge! It is a roblox badge.
Attributes:
Name Type Descriptionid
int
The roblox badge ID.
Source code inroblox/bases/baserobloxbadge.py
class BaseRobloxBadge(BaseItem):\n \"\"\"\n Represents a Roblox roblox badge ID.\n !!! warning\n This is not a badge! It is a **roblox badge**.\n\n Attributes:\n id: The roblox badge ID.\n \"\"\"\n\n def __init__(self, client: Client, roblox_badge_id: int):\n \"\"\"\n Arguments:\n client: The Client this object belongs to.\n roblox_badge_id: The roblox badge ID.\n \"\"\"\n\n self._client: Client = client\n self.id: int = roblox_badge_id\n
"},{"location":"reference/bases/baserobloxbadge/#roblox.bases.baserobloxbadge.BaseRobloxBadge.__init__","title":"__init__(client, roblox_badge_id)
","text":"Parameters:
Name Type Description Defaultclient
Client
The Client this object belongs to.
requiredroblox_badge_id
int
The roblox badge ID.
required Source code inroblox/bases/baserobloxbadge.py
def __init__(self, client: Client, roblox_badge_id: int):\n \"\"\"\n Arguments:\n client: The Client this object belongs to.\n roblox_badge_id: The roblox badge ID.\n \"\"\"\n\n self._client: Client = client\n self.id: int = roblox_badge_id\n
"},{"location":"reference/bases/baserole/","title":"baserole","text":"This file contains the BaseRole object, which represents a Roblox group role ID.
"},{"location":"reference/bases/baserole/#roblox.bases.baserole.BaseRole","title":"BaseRole
","text":" Bases: BaseItem
Represents a Roblox group role ID.
Attributes:
Name Type Descriptionid
int
The role ID.
Source code inroblox/bases/baserole.py
class BaseRole(BaseItem):\n \"\"\"\n Represents a Roblox group role ID.\n\n Attributes:\n id: The role ID.\n \"\"\"\n\n def __init__(self, client: Client, role_id: int):\n \"\"\"\n Arguments:\n client: The Client this object belongs to.\n role_id: The role ID.\n \"\"\"\n\n self._client: Client = client\n self.id: int = role_id\n
"},{"location":"reference/bases/baserole/#roblox.bases.baserole.BaseRole.__init__","title":"__init__(client, role_id)
","text":"Parameters:
Name Type Description Defaultclient
Client
The Client this object belongs to.
requiredrole_id
int
The role ID.
required Source code inroblox/bases/baserole.py
def __init__(self, client: Client, role_id: int):\n \"\"\"\n Arguments:\n client: The Client this object belongs to.\n role_id: The role ID.\n \"\"\"\n\n self._client: Client = client\n self.id: int = role_id\n
"},{"location":"reference/bases/basesociallink/","title":"basesociallink","text":"This file contains the BaseUniverseSocialLink object, which represents a Roblox social link ID.
"},{"location":"reference/bases/basesociallink/#roblox.bases.basesociallink.BaseUniverseSocialLink","title":"BaseUniverseSocialLink
","text":" Bases: BaseItem
Represents a Roblox universe social link ID.
Attributes:
Name Type Descriptionid
int
The universe social link ID.
Source code inroblox/bases/basesociallink.py
class BaseUniverseSocialLink(BaseItem):\n \"\"\"\n Represents a Roblox universe social link ID.\n\n Attributes:\n id: The universe social link ID.\n \"\"\"\n\n def __init__(self, client: Client, social_link_id: int):\n \"\"\"\n Arguments:\n client: The Client this object belongs to.\n social_link_id: The universe social link ID.\n \"\"\"\n\n self._client: Client = client\n self.id: int = social_link_id\n
"},{"location":"reference/bases/basesociallink/#roblox.bases.basesociallink.BaseUniverseSocialLink.__init__","title":"__init__(client, social_link_id)
","text":"Parameters:
Name Type Description Defaultclient
Client
The Client this object belongs to.
requiredsocial_link_id
int
The universe social link ID.
required Source code inroblox/bases/basesociallink.py
def __init__(self, client: Client, social_link_id: int):\n \"\"\"\n Arguments:\n client: The Client this object belongs to.\n social_link_id: The universe social link ID.\n \"\"\"\n\n self._client: Client = client\n self.id: int = social_link_id\n
"},{"location":"reference/bases/baseuniverse/","title":"baseuniverse","text":"This file contains the BaseUniverse object, which represents a Roblox universe ID. It also contains the UniverseLiveStats object, which represents a universe's live stats.
"},{"location":"reference/bases/baseuniverse/#roblox.bases.baseuniverse.BaseUniverse","title":"BaseUniverse
","text":" Bases: BaseItem
Represents a Roblox universe ID.
Attributes:
Name Type Descriptionid
int
The universe ID.
Source code inroblox/bases/baseuniverse.py
class BaseUniverse(BaseItem):\n \"\"\"\n Represents a Roblox universe ID.\n\n Attributes:\n id: The universe ID.\n \"\"\"\n\n def __init__(self, client: Client, universe_id: int):\n \"\"\"\n Arguments:\n client: The Client this object belongs to.\n universe_id: The universe ID.\n \"\"\"\n\n self._client: Client = client\n self.id: int = universe_id\n\n async def get_favorite_count(self) -> int:\n \"\"\"\n Grabs the universe's favorite count.\n\n Returns:\n The universe's favorite count.\n \"\"\"\n favorite_count_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"games\", f\"v1/games/{self.id}/favorites/count\")\n )\n favorite_count_data = favorite_count_response.json()\n return favorite_count_data[\"favoritesCount\"]\n\n async def is_favorited(self) -> bool:\n \"\"\"\n Grabs the authenticated user's favorite status for this game.\n\n Returns:\n Whether the authenticated user has favorited this game.\n \"\"\"\n is_favorited_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"games\", f\"v1/games/{self.id}/favorites\")\n )\n is_favorited_data = is_favorited_response.json()\n return is_favorited_data[\"isFavorited\"]\n\n def get_badges(self, page_size: int = 10, sort_order: SortOrder = SortOrder.Ascending,\n max_items: int = None) -> PageIterator:\n \"\"\"\n Gets the universe's badges.\n\n Arguments:\n page_size: How many members should be returned for each page.\n sort_order: Order in which data should be grabbed.\n max_items: The maximum items to return when looping through this object.\n\n Returns:\n A PageIterator containing this universe's badges.\n \"\"\"\n\n return PageIterator(\n client=self._client,\n url=self._client.url_generator.get_url(\"badges\", f\"v1/universes/{self.id}/badges\"),\n page_size=page_size,\n sort_order=sort_order,\n max_items=max_items,\n handler=_universe_badges_handler,\n )\n\n async def get_live_stats(self) -> UniverseLiveStats:\n \"\"\"\n Gets the universe's live stats.\n This data does not update live. These are just the stats that are shown on the website's live stats display.\n\n Returns:\n The universe's live stats.\n \"\"\"\n stats_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"develop\", f\"v1/universes/{self.id}/live-stats\")\n )\n stats_data = stats_response.json()\n return UniverseLiveStats(data=stats_data)\n\n def get_gamepasses(self, page_size: int = 10, sort_order: SortOrder = SortOrder.Ascending,\n max_items: int = None) -> PageIterator:\n \"\"\"\n Gets the universe's gamepasses.\n\n Arguments:\n page_size: How many members should be returned for each page.\n sort_order: Order in which data should be grabbed.\n max_items: The maximum items to return when looping through this object.\n\n Returns:\n A PageIterator containing the universe's gamepasses.\n \"\"\"\n\n return PageIterator(\n client=self._client,\n url=self._client.url_generator.get_url(\"games\", f\"v1/games/{self.id}/game-passes\"),\n page_size=page_size,\n sort_order=sort_order,\n max_items=max_items,\n handler=lambda client, data: GamePass(client, data),\n )\n\n async def get_social_links(self) -> List[SocialLink]:\n \"\"\"\n Gets the universe's social links.\n\n Returns:\n A list of the universe's social links.\n \"\"\"\n\n links_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"games\", f\"v1/games/{self.id}/social-links/list\")\n )\n links_data = links_response.json()[\"data\"]\n return [SocialLink(client=self._client, data=link_data) for link_data in links_data]\n
"},{"location":"reference/bases/baseuniverse/#roblox.bases.baseuniverse.BaseUniverse.__init__","title":"__init__(client, universe_id)
","text":"Parameters:
Name Type Description Defaultclient
Client
The Client this object belongs to.
requireduniverse_id
int
The universe ID.
required Source code inroblox/bases/baseuniverse.py
def __init__(self, client: Client, universe_id: int):\n \"\"\"\n Arguments:\n client: The Client this object belongs to.\n universe_id: The universe ID.\n \"\"\"\n\n self._client: Client = client\n self.id: int = universe_id\n
"},{"location":"reference/bases/baseuniverse/#roblox.bases.baseuniverse.BaseUniverse.get_badges","title":"get_badges(page_size=10, sort_order=SortOrder.Ascending, max_items=None)
","text":"Gets the universe's badges.
Parameters:
Name Type Description Defaultpage_size
int
How many members should be returned for each page.
10
sort_order
SortOrder
Order in which data should be grabbed.
Ascending
max_items
int
The maximum items to return when looping through this object.
None
Returns:
Type DescriptionPageIterator
A PageIterator containing this universe's badges.
Source code inroblox/bases/baseuniverse.py
def get_badges(self, page_size: int = 10, sort_order: SortOrder = SortOrder.Ascending,\n max_items: int = None) -> PageIterator:\n \"\"\"\n Gets the universe's badges.\n\n Arguments:\n page_size: How many members should be returned for each page.\n sort_order: Order in which data should be grabbed.\n max_items: The maximum items to return when looping through this object.\n\n Returns:\n A PageIterator containing this universe's badges.\n \"\"\"\n\n return PageIterator(\n client=self._client,\n url=self._client.url_generator.get_url(\"badges\", f\"v1/universes/{self.id}/badges\"),\n page_size=page_size,\n sort_order=sort_order,\n max_items=max_items,\n handler=_universe_badges_handler,\n )\n
"},{"location":"reference/bases/baseuniverse/#roblox.bases.baseuniverse.BaseUniverse.get_favorite_count","title":"get_favorite_count()
async
","text":"Grabs the universe's favorite count.
Returns:
Type Descriptionint
The universe's favorite count.
Source code inroblox/bases/baseuniverse.py
async def get_favorite_count(self) -> int:\n \"\"\"\n Grabs the universe's favorite count.\n\n Returns:\n The universe's favorite count.\n \"\"\"\n favorite_count_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"games\", f\"v1/games/{self.id}/favorites/count\")\n )\n favorite_count_data = favorite_count_response.json()\n return favorite_count_data[\"favoritesCount\"]\n
"},{"location":"reference/bases/baseuniverse/#roblox.bases.baseuniverse.BaseUniverse.get_gamepasses","title":"get_gamepasses(page_size=10, sort_order=SortOrder.Ascending, max_items=None)
","text":"Gets the universe's gamepasses.
Parameters:
Name Type Description Defaultpage_size
int
How many members should be returned for each page.
10
sort_order
SortOrder
Order in which data should be grabbed.
Ascending
max_items
int
The maximum items to return when looping through this object.
None
Returns:
Type DescriptionPageIterator
A PageIterator containing the universe's gamepasses.
Source code inroblox/bases/baseuniverse.py
def get_gamepasses(self, page_size: int = 10, sort_order: SortOrder = SortOrder.Ascending,\n max_items: int = None) -> PageIterator:\n \"\"\"\n Gets the universe's gamepasses.\n\n Arguments:\n page_size: How many members should be returned for each page.\n sort_order: Order in which data should be grabbed.\n max_items: The maximum items to return when looping through this object.\n\n Returns:\n A PageIterator containing the universe's gamepasses.\n \"\"\"\n\n return PageIterator(\n client=self._client,\n url=self._client.url_generator.get_url(\"games\", f\"v1/games/{self.id}/game-passes\"),\n page_size=page_size,\n sort_order=sort_order,\n max_items=max_items,\n handler=lambda client, data: GamePass(client, data),\n )\n
"},{"location":"reference/bases/baseuniverse/#roblox.bases.baseuniverse.BaseUniverse.get_live_stats","title":"get_live_stats()
async
","text":"Gets the universe's live stats. This data does not update live. These are just the stats that are shown on the website's live stats display.
Returns:
Type DescriptionUniverseLiveStats
The universe's live stats.
Source code inroblox/bases/baseuniverse.py
async def get_live_stats(self) -> UniverseLiveStats:\n \"\"\"\n Gets the universe's live stats.\n This data does not update live. These are just the stats that are shown on the website's live stats display.\n\n Returns:\n The universe's live stats.\n \"\"\"\n stats_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"develop\", f\"v1/universes/{self.id}/live-stats\")\n )\n stats_data = stats_response.json()\n return UniverseLiveStats(data=stats_data)\n
"},{"location":"reference/bases/baseuniverse/#roblox.bases.baseuniverse.BaseUniverse.get_social_links","title":"get_social_links()
async
","text":"Gets the universe's social links.
Returns:
Type DescriptionList[SocialLink]
A list of the universe's social links.
Source code inroblox/bases/baseuniverse.py
async def get_social_links(self) -> List[SocialLink]:\n \"\"\"\n Gets the universe's social links.\n\n Returns:\n A list of the universe's social links.\n \"\"\"\n\n links_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"games\", f\"v1/games/{self.id}/social-links/list\")\n )\n links_data = links_response.json()[\"data\"]\n return [SocialLink(client=self._client, data=link_data) for link_data in links_data]\n
"},{"location":"reference/bases/baseuniverse/#roblox.bases.baseuniverse.BaseUniverse.is_favorited","title":"is_favorited()
async
","text":"Grabs the authenticated user's favorite status for this game.
Returns:
Type Descriptionbool
Whether the authenticated user has favorited this game.
Source code inroblox/bases/baseuniverse.py
async def is_favorited(self) -> bool:\n \"\"\"\n Grabs the authenticated user's favorite status for this game.\n\n Returns:\n Whether the authenticated user has favorited this game.\n \"\"\"\n is_favorited_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"games\", f\"v1/games/{self.id}/favorites\")\n )\n is_favorited_data = is_favorited_response.json()\n return is_favorited_data[\"isFavorited\"]\n
"},{"location":"reference/bases/baseuniverse/#roblox.bases.baseuniverse.UniverseLiveStats","title":"UniverseLiveStats
","text":"Represents a universe's live stats.
Attributes:
Name Type Descriptiontotal_player_count
int
The amount of players present in this universe's subplaces.
game_count
int
The amount of active servers for this universe's subplaces.
player_counts_by_device_type
Dict[str, int]
A dictionary where the keys are device types and the values are the amount of this universe's subplace's active players which are on that device type.
Source code inroblox/bases/baseuniverse.py
class UniverseLiveStats:\n \"\"\"\n Represents a universe's live stats.\n\n Attributes:\n total_player_count: The amount of players present in this universe's subplaces.\n game_count: The amount of active servers for this universe's subplaces.\n player_counts_by_device_type: A dictionary where the keys are device types and the values are the amount of\n this universe's subplace's active players which are on that device type.\n \"\"\"\n\n def __init__(self, data: dict):\n self.total_player_count: int = data[\"totalPlayerCount\"]\n self.game_count: int = data[\"gameCount\"]\n self.player_counts_by_device_type: Dict[str, int] = data[\"playerCountsByDeviceType\"]\n
"},{"location":"reference/bases/baseuser/","title":"baseuser","text":"This file contains the BaseUser object, which represents a Roblox user ID.
"},{"location":"reference/bases/baseuser/#roblox.bases.baseuser.BaseUser","title":"BaseUser
","text":" Bases: BaseItem
Represents a Roblox user ID.
Attributes:
Name Type Descriptionid
int
The user ID.
Source code inroblox/bases/baseuser.py
class BaseUser(BaseItem):\n \"\"\"\n Represents a Roblox user ID.\n\n Attributes:\n id: The user ID.\n \"\"\"\n\n def __init__(self, client: Client, user_id: int):\n \"\"\"\n Arguments:\n client: The Client this object belongs to.\n user_id: The user ID.\n \"\"\"\n\n self._client: Client = client\n self.id: int = user_id\n\n def username_history(\n self, page_size: int = 10, sort_order: SortOrder = SortOrder.Ascending, max_items: int = None\n ) -> PageIterator:\n \"\"\"\n Grabs the user's username history.\n\n Arguments:\n page_size: How many members should be returned for each page.\n sort_order: Order in which data should be grabbed.\n max_items: The maximum items to return when looping through this object.\n\n Returns:\n A PageIterator containing the user's username history.\n \"\"\"\n return PageIterator(\n client=self._client,\n url=self._client.url_generator.get_url(\n \"users\", f\"v1/users/{self.id}/username-history\"\n ),\n page_size=page_size,\n sort_order=sort_order,\n max_items=max_items,\n handler=lambda client, data: data[\"name\"],\n )\n\n async def get_presence(self) -> Optional[Presence]:\n \"\"\"\n Grabs the user's presence.\n\n Returns:\n The user's presence, if they have an active presence.\n \"\"\"\n presences = await self._client.presence.get_user_presences([self.id])\n try:\n return presences[0]\n except IndexError:\n return None\n\n async def get_friends(self) -> List[Friend]:\n \"\"\"\n Grabs the user's friends.\n\n Returns:\n A list of the user's friends.\n \"\"\"\n\n from ..friends import Friend\n friends_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"friends\", f\"v1/users/{self.id}/friends\")\n )\n friends_data = friends_response.json()[\"data\"]\n return [Friend(client=self._client, data=friend_data) for friend_data in friends_data]\n\n async def get_currency(self) -> int:\n \"\"\"\n Grabs the user's current Robux amount. Only works on the authenticated user.\n\n Returns:\n The user's Robux amount.\n \"\"\"\n currency_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"economy\", f\"v1/users/{self.id}/currency\")\n )\n currency_data = currency_response.json()\n return currency_data[\"robux\"]\n\n async def has_premium(self) -> bool:\n \"\"\"\n Checks if the user has a Roblox Premium membership.\n\n Returns:\n Whether the user has Premium or not.\n \"\"\"\n premium_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"premiumfeatures\", f\"v1/users/{self.id}/validate-membership\")\n )\n premium_data = premium_response.text\n return premium_data == \"true\"\n\n async def get_item_instance(self, item_type: InstanceType, item_id: int) -> Optional[ItemInstance]:\n \"\"\"\n Gets an item instance for a specific user.\n\n Arguments:\n item_type: The type of item to get an instance for.\n item_id: The item's ID.\n\n Returns: An ItemInstance, if it exists.\n \"\"\"\n\n item_type: str = item_type.value.lower()\n\n # this is so we can have special classes for other types\n item_class = instance_classes.get(item_type) or ItemInstance\n\n instance_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"inventory\", f\"v1/users/{self.id}/items/{item_type}/{item_id}\")\n )\n instance_data = instance_response.json()[\"data\"]\n if len(instance_data) > 0:\n return item_class(\n client=self._client,\n data=instance_data[0]\n )\n else:\n return None\n\n async def get_asset_instance(self, asset: AssetOrAssetId) -> Optional[AssetInstance]:\n \"\"\"\n Checks if a user owns the asset, and returns details about the asset if they do.\n\n Returns:\n An asset instance, if the user owns this asset.\n \"\"\"\n return await self.get_item_instance(\n item_type=InstanceType.asset,\n item_id=int(asset)\n )\n\n async def get_gamepass_instance(self, gamepass: GamePassOrGamePassId) -> Optional[GamePassInstance]:\n \"\"\"\n Checks if a user owns the gamepass, and returns details about the asset if they do.\n\n Returns:\n An gamepass instance, if the user owns this gamepass.\n \"\"\"\n return await self.get_item_instance(\n item_type=InstanceType.gamepass,\n item_id=int(gamepass)\n )\n\n async def get_badge_awarded_dates(self, badges: list[BaseBadge]) -> List[PartialBadge]:\n \"\"\"\n Gets the dates that each badge in a list of badges were awarded to this user.\n\n Returns:\n A list of partial badges containing badge awarded dates.\n \"\"\"\n awarded_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"badges\", f\"v1/users/{self.id}/badges/awarded-dates\"),\n params={\n \"badgeIds\": [badge.id for badge in badges]\n }\n )\n awarded_data: list = awarded_response.json()[\"data\"]\n return [\n PartialBadge(\n client=self._client,\n data=partial_data\n ) for partial_data in awarded_data\n ]\n\n async def get_group_roles(self) -> List[Role]:\n \"\"\"\n Gets a list of roles for all groups this user is in.\n\n Returns:\n A list of roles.\n \"\"\"\n from ..roles import Role\n from ..groups import Group\n roles_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"groups\", f\"v1/users/{self.id}/groups/roles\")\n )\n roles_data = roles_response.json()[\"data\"]\n return [\n Role(\n client=self._client,\n data=role_data[\"role\"],\n group=Group(\n client=self._client,\n data=role_data[\"group\"]\n )\n ) for role_data in roles_data\n ]\n\n async def get_roblox_badges(self) -> List[RobloxBadge]:\n \"\"\"\n Gets the user's Roblox badges.\n\n Returns:\n A list of Roblox badges.\n \"\"\"\n\n badges_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"accountinformation\", f\"v1/users/{self.id}/roblox-badges\")\n )\n badges_data = badges_response.json()\n return [RobloxBadge(client=self._client, data=badge_data) for badge_data in badges_data]\n\n async def get_promotion_channels(self) -> UserPromotionChannels:\n \"\"\"\n Gets the user's promotion channels.\n\n Returns:\n The user's promotion channels.\n \"\"\"\n channels_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"accountinformation\", f\"v1/users/{self.id}/promotion-channels\")\n )\n channels_data = channels_response.json()\n return UserPromotionChannels(\n data=channels_data\n )\n\n async def _get_friend_channel_count(self, channel: str) -> int:\n count_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"friends\", f\"v1/users/{self.id}/{channel}/count\")\n )\n return count_response.json()[\"count\"]\n\n def _get_friend_channel_iterator(\n self,\n channel: str,\n page_size: int = 10,\n sort_order: SortOrder = SortOrder.Ascending, max_items: int = None\n ) -> PageIterator:\n from ..friends import Friend\n return PageIterator(\n client=self._client,\n url=self._client.url_generator.get_url(\"friends\", f\"v1/users/{self.id}/{channel}\"),\n page_size=page_size,\n sort_order=sort_order,\n max_items=max_items,\n handler=lambda client, data: Friend(client=client, data=data)\n )\n\n async def get_friend_count(self) -> int:\n \"\"\"\n Gets the user's friend count.\n\n Returns:\n The user's friend count.\n \"\"\"\n return await self._get_friend_channel_count(\"friends\")\n\n async def get_follower_count(self) -> int:\n \"\"\"\n Gets the user's follower count.\n\n Returns:\n The user's follower count.\n \"\"\"\n return await self._get_friend_channel_count(\"followers\")\n\n async def get_following_count(self) -> int:\n \"\"\"\n Gets the user's following count.\n\n Returns:\n The user's following count.\n \"\"\"\n return await self._get_friend_channel_count(\"followings\")\n\n def get_followers(\n self,\n page_size: int = 10,\n sort_order: SortOrder = SortOrder.Ascending, max_items: int = None\n ) -> PageIterator:\n \"\"\"\n Gets the user's followers.\n\n Returns:\n A PageIterator containing everyone who follows this user.\n \"\"\"\n return self._get_friend_channel_iterator(\n channel=\"followers\",\n page_size=page_size,\n sort_order=sort_order,\n max_items=max_items,\n )\n\n def get_followings(\n self,\n page_size: int = 10,\n sort_order: SortOrder = SortOrder.Ascending, max_items: int = None\n ) -> PageIterator:\n \"\"\"\n Gets the user's followings.\n\n Returns:\n A PageIterator containing everyone that this user is following.\n \"\"\"\n return self._get_friend_channel_iterator(\n channel=\"followings\",\n page_size=page_size,\n sort_order=sort_order,\n max_items=max_items,\n )\n
"},{"location":"reference/bases/baseuser/#roblox.bases.baseuser.BaseUser.__init__","title":"__init__(client, user_id)
","text":"Parameters:
Name Type Description Defaultclient
Client
The Client this object belongs to.
requireduser_id
int
The user ID.
required Source code inroblox/bases/baseuser.py
def __init__(self, client: Client, user_id: int):\n \"\"\"\n Arguments:\n client: The Client this object belongs to.\n user_id: The user ID.\n \"\"\"\n\n self._client: Client = client\n self.id: int = user_id\n
"},{"location":"reference/bases/baseuser/#roblox.bases.baseuser.BaseUser.get_asset_instance","title":"get_asset_instance(asset)
async
","text":"Checks if a user owns the asset, and returns details about the asset if they do.
Returns:
Type DescriptionOptional[AssetInstance]
An asset instance, if the user owns this asset.
Source code inroblox/bases/baseuser.py
async def get_asset_instance(self, asset: AssetOrAssetId) -> Optional[AssetInstance]:\n \"\"\"\n Checks if a user owns the asset, and returns details about the asset if they do.\n\n Returns:\n An asset instance, if the user owns this asset.\n \"\"\"\n return await self.get_item_instance(\n item_type=InstanceType.asset,\n item_id=int(asset)\n )\n
"},{"location":"reference/bases/baseuser/#roblox.bases.baseuser.BaseUser.get_badge_awarded_dates","title":"get_badge_awarded_dates(badges)
async
","text":"Gets the dates that each badge in a list of badges were awarded to this user.
Returns:
Type DescriptionList[PartialBadge]
A list of partial badges containing badge awarded dates.
Source code inroblox/bases/baseuser.py
async def get_badge_awarded_dates(self, badges: list[BaseBadge]) -> List[PartialBadge]:\n \"\"\"\n Gets the dates that each badge in a list of badges were awarded to this user.\n\n Returns:\n A list of partial badges containing badge awarded dates.\n \"\"\"\n awarded_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"badges\", f\"v1/users/{self.id}/badges/awarded-dates\"),\n params={\n \"badgeIds\": [badge.id for badge in badges]\n }\n )\n awarded_data: list = awarded_response.json()[\"data\"]\n return [\n PartialBadge(\n client=self._client,\n data=partial_data\n ) for partial_data in awarded_data\n ]\n
"},{"location":"reference/bases/baseuser/#roblox.bases.baseuser.BaseUser.get_currency","title":"get_currency()
async
","text":"Grabs the user's current Robux amount. Only works on the authenticated user.
Returns:
Type Descriptionint
The user's Robux amount.
Source code inroblox/bases/baseuser.py
async def get_currency(self) -> int:\n \"\"\"\n Grabs the user's current Robux amount. Only works on the authenticated user.\n\n Returns:\n The user's Robux amount.\n \"\"\"\n currency_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"economy\", f\"v1/users/{self.id}/currency\")\n )\n currency_data = currency_response.json()\n return currency_data[\"robux\"]\n
"},{"location":"reference/bases/baseuser/#roblox.bases.baseuser.BaseUser.get_follower_count","title":"get_follower_count()
async
","text":"Gets the user's follower count.
Returns:
Type Descriptionint
The user's follower count.
Source code inroblox/bases/baseuser.py
async def get_follower_count(self) -> int:\n \"\"\"\n Gets the user's follower count.\n\n Returns:\n The user's follower count.\n \"\"\"\n return await self._get_friend_channel_count(\"followers\")\n
"},{"location":"reference/bases/baseuser/#roblox.bases.baseuser.BaseUser.get_followers","title":"get_followers(page_size=10, sort_order=SortOrder.Ascending, max_items=None)
","text":"Gets the user's followers.
Returns:
Type DescriptionPageIterator
A PageIterator containing everyone who follows this user.
Source code inroblox/bases/baseuser.py
def get_followers(\n self,\n page_size: int = 10,\n sort_order: SortOrder = SortOrder.Ascending, max_items: int = None\n) -> PageIterator:\n \"\"\"\n Gets the user's followers.\n\n Returns:\n A PageIterator containing everyone who follows this user.\n \"\"\"\n return self._get_friend_channel_iterator(\n channel=\"followers\",\n page_size=page_size,\n sort_order=sort_order,\n max_items=max_items,\n )\n
"},{"location":"reference/bases/baseuser/#roblox.bases.baseuser.BaseUser.get_following_count","title":"get_following_count()
async
","text":"Gets the user's following count.
Returns:
Type Descriptionint
The user's following count.
Source code inroblox/bases/baseuser.py
async def get_following_count(self) -> int:\n \"\"\"\n Gets the user's following count.\n\n Returns:\n The user's following count.\n \"\"\"\n return await self._get_friend_channel_count(\"followings\")\n
"},{"location":"reference/bases/baseuser/#roblox.bases.baseuser.BaseUser.get_followings","title":"get_followings(page_size=10, sort_order=SortOrder.Ascending, max_items=None)
","text":"Gets the user's followings.
Returns:
Type DescriptionPageIterator
A PageIterator containing everyone that this user is following.
Source code inroblox/bases/baseuser.py
def get_followings(\n self,\n page_size: int = 10,\n sort_order: SortOrder = SortOrder.Ascending, max_items: int = None\n) -> PageIterator:\n \"\"\"\n Gets the user's followings.\n\n Returns:\n A PageIterator containing everyone that this user is following.\n \"\"\"\n return self._get_friend_channel_iterator(\n channel=\"followings\",\n page_size=page_size,\n sort_order=sort_order,\n max_items=max_items,\n )\n
"},{"location":"reference/bases/baseuser/#roblox.bases.baseuser.BaseUser.get_friend_count","title":"get_friend_count()
async
","text":"Gets the user's friend count.
Returns:
Type Descriptionint
The user's friend count.
Source code inroblox/bases/baseuser.py
async def get_friend_count(self) -> int:\n \"\"\"\n Gets the user's friend count.\n\n Returns:\n The user's friend count.\n \"\"\"\n return await self._get_friend_channel_count(\"friends\")\n
"},{"location":"reference/bases/baseuser/#roblox.bases.baseuser.BaseUser.get_friends","title":"get_friends()
async
","text":"Grabs the user's friends.
Returns:
Type DescriptionList[Friend]
A list of the user's friends.
Source code inroblox/bases/baseuser.py
async def get_friends(self) -> List[Friend]:\n \"\"\"\n Grabs the user's friends.\n\n Returns:\n A list of the user's friends.\n \"\"\"\n\n from ..friends import Friend\n friends_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"friends\", f\"v1/users/{self.id}/friends\")\n )\n friends_data = friends_response.json()[\"data\"]\n return [Friend(client=self._client, data=friend_data) for friend_data in friends_data]\n
"},{"location":"reference/bases/baseuser/#roblox.bases.baseuser.BaseUser.get_gamepass_instance","title":"get_gamepass_instance(gamepass)
async
","text":"Checks if a user owns the gamepass, and returns details about the asset if they do.
Returns:
Type DescriptionOptional[GamePassInstance]
An gamepass instance, if the user owns this gamepass.
Source code inroblox/bases/baseuser.py
async def get_gamepass_instance(self, gamepass: GamePassOrGamePassId) -> Optional[GamePassInstance]:\n \"\"\"\n Checks if a user owns the gamepass, and returns details about the asset if they do.\n\n Returns:\n An gamepass instance, if the user owns this gamepass.\n \"\"\"\n return await self.get_item_instance(\n item_type=InstanceType.gamepass,\n item_id=int(gamepass)\n )\n
"},{"location":"reference/bases/baseuser/#roblox.bases.baseuser.BaseUser.get_group_roles","title":"get_group_roles()
async
","text":"Gets a list of roles for all groups this user is in.
Returns:
Type DescriptionList[Role]
A list of roles.
Source code inroblox/bases/baseuser.py
async def get_group_roles(self) -> List[Role]:\n \"\"\"\n Gets a list of roles for all groups this user is in.\n\n Returns:\n A list of roles.\n \"\"\"\n from ..roles import Role\n from ..groups import Group\n roles_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"groups\", f\"v1/users/{self.id}/groups/roles\")\n )\n roles_data = roles_response.json()[\"data\"]\n return [\n Role(\n client=self._client,\n data=role_data[\"role\"],\n group=Group(\n client=self._client,\n data=role_data[\"group\"]\n )\n ) for role_data in roles_data\n ]\n
"},{"location":"reference/bases/baseuser/#roblox.bases.baseuser.BaseUser.get_item_instance","title":"get_item_instance(item_type, item_id)
async
","text":"Gets an item instance for a specific user.
Parameters:
Name Type Description Defaultitem_type
InstanceType
The type of item to get an instance for.
requireditem_id
int
The item's ID.
required Source code inroblox/bases/baseuser.py
async def get_item_instance(self, item_type: InstanceType, item_id: int) -> Optional[ItemInstance]:\n \"\"\"\n Gets an item instance for a specific user.\n\n Arguments:\n item_type: The type of item to get an instance for.\n item_id: The item's ID.\n\n Returns: An ItemInstance, if it exists.\n \"\"\"\n\n item_type: str = item_type.value.lower()\n\n # this is so we can have special classes for other types\n item_class = instance_classes.get(item_type) or ItemInstance\n\n instance_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"inventory\", f\"v1/users/{self.id}/items/{item_type}/{item_id}\")\n )\n instance_data = instance_response.json()[\"data\"]\n if len(instance_data) > 0:\n return item_class(\n client=self._client,\n data=instance_data[0]\n )\n else:\n return None\n
"},{"location":"reference/bases/baseuser/#roblox.bases.baseuser.BaseUser.get_presence","title":"get_presence()
async
","text":"Grabs the user's presence.
Returns:
Type DescriptionOptional[Presence]
The user's presence, if they have an active presence.
Source code inroblox/bases/baseuser.py
async def get_presence(self) -> Optional[Presence]:\n \"\"\"\n Grabs the user's presence.\n\n Returns:\n The user's presence, if they have an active presence.\n \"\"\"\n presences = await self._client.presence.get_user_presences([self.id])\n try:\n return presences[0]\n except IndexError:\n return None\n
"},{"location":"reference/bases/baseuser/#roblox.bases.baseuser.BaseUser.get_promotion_channels","title":"get_promotion_channels()
async
","text":"Gets the user's promotion channels.
Returns:
Type DescriptionUserPromotionChannels
The user's promotion channels.
Source code inroblox/bases/baseuser.py
async def get_promotion_channels(self) -> UserPromotionChannels:\n \"\"\"\n Gets the user's promotion channels.\n\n Returns:\n The user's promotion channels.\n \"\"\"\n channels_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"accountinformation\", f\"v1/users/{self.id}/promotion-channels\")\n )\n channels_data = channels_response.json()\n return UserPromotionChannels(\n data=channels_data\n )\n
"},{"location":"reference/bases/baseuser/#roblox.bases.baseuser.BaseUser.get_roblox_badges","title":"get_roblox_badges()
async
","text":"Gets the user's Roblox badges.
Returns:
Type DescriptionList[RobloxBadge]
A list of Roblox badges.
Source code inroblox/bases/baseuser.py
async def get_roblox_badges(self) -> List[RobloxBadge]:\n \"\"\"\n Gets the user's Roblox badges.\n\n Returns:\n A list of Roblox badges.\n \"\"\"\n\n badges_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"accountinformation\", f\"v1/users/{self.id}/roblox-badges\")\n )\n badges_data = badges_response.json()\n return [RobloxBadge(client=self._client, data=badge_data) for badge_data in badges_data]\n
"},{"location":"reference/bases/baseuser/#roblox.bases.baseuser.BaseUser.has_premium","title":"has_premium()
async
","text":"Checks if the user has a Roblox Premium membership.
Returns:
Type Descriptionbool
Whether the user has Premium or not.
Source code inroblox/bases/baseuser.py
async def has_premium(self) -> bool:\n \"\"\"\n Checks if the user has a Roblox Premium membership.\n\n Returns:\n Whether the user has Premium or not.\n \"\"\"\n premium_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"premiumfeatures\", f\"v1/users/{self.id}/validate-membership\")\n )\n premium_data = premium_response.text\n return premium_data == \"true\"\n
"},{"location":"reference/bases/baseuser/#roblox.bases.baseuser.BaseUser.username_history","title":"username_history(page_size=10, sort_order=SortOrder.Ascending, max_items=None)
","text":"Grabs the user's username history.
Parameters:
Name Type Description Defaultpage_size
int
How many members should be returned for each page.
10
sort_order
SortOrder
Order in which data should be grabbed.
Ascending
max_items
int
The maximum items to return when looping through this object.
None
Returns:
Type DescriptionPageIterator
A PageIterator containing the user's username history.
Source code inroblox/bases/baseuser.py
def username_history(\n self, page_size: int = 10, sort_order: SortOrder = SortOrder.Ascending, max_items: int = None\n) -> PageIterator:\n \"\"\"\n Grabs the user's username history.\n\n Arguments:\n page_size: How many members should be returned for each page.\n sort_order: Order in which data should be grabbed.\n max_items: The maximum items to return when looping through this object.\n\n Returns:\n A PageIterator containing the user's username history.\n \"\"\"\n return PageIterator(\n client=self._client,\n url=self._client.url_generator.get_url(\n \"users\", f\"v1/users/{self.id}/username-history\"\n ),\n page_size=page_size,\n sort_order=sort_order,\n max_items=max_items,\n handler=lambda client, data: data[\"name\"],\n )\n
"},{"location":"reference/partials/","title":"partials","text":"Contains partial objects representing objects on Roblox. Some endpoints return some, but not all, data for an object, and these partial objects represent that data.
"},{"location":"reference/partials/partialbadge/","title":"partialbadge","text":"This file contains partial objects related to Roblox badges.
"},{"location":"reference/partials/partialbadge/#roblox.partials.partialbadge.PartialBadge","title":"PartialBadge
","text":" Bases: BaseBadge
Represents partial badge data.
Attributes:
Name Type Description_data
The data we get back from the endpoint.
_client
Client
The cCient object, which is passed to all objects this Client generates.
id
int
The universe ID.
awarded
datetime
The date when the badge was awarded.
Source code inroblox/partials/partialbadge.py
class PartialBadge(BaseBadge):\n \"\"\"\n Represents partial badge data.\n\n Attributes:\n _data: The data we get back from the endpoint.\n _client: The cCient object, which is passed to all objects this Client generates.\n id: The universe ID.\n awarded: The date when the badge was awarded.\n \"\"\"\n\n def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: The Client.\n data: The raw data.\n \"\"\"\n self._client: Client = client\n\n self.id: int = data[\"badgeId\"]\n\n super().__init__(client=client, badge_id=self.id)\n\n self.awarded: datetime = parse(data[\"awardedDate\"])\n
"},{"location":"reference/partials/partialbadge/#roblox.partials.partialbadge.PartialBadge.__init__","title":"__init__(client, data)
","text":"Parameters:
Name Type Description Defaultclient
Client
The Client.
requireddata
dict
The raw data.
required Source code inroblox/partials/partialbadge.py
def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: The Client.\n data: The raw data.\n \"\"\"\n self._client: Client = client\n\n self.id: int = data[\"badgeId\"]\n\n super().__init__(client=client, badge_id=self.id)\n\n self.awarded: datetime = parse(data[\"awardedDate\"])\n
"},{"location":"reference/partials/partialgroup/","title":"partialgroup","text":"This file contains partial objects related to Roblox groups.
"},{"location":"reference/partials/partialgroup/#roblox.partials.partialgroup.AssetPartialGroup","title":"AssetPartialGroup
","text":" Bases: BaseGroup
Represents a partial group in the context of a Roblox asset. Intended to parse the data[0][\"creator\"]
data from https://games.roblox.com/v1/games.
Attributes:
Name Type Description_client
Client
The Client object, which is passed to all objects this Client generates.
id
int
The group's name.
creator
BaseUser
The group's owner.
name
str
The group's name.
has_verified_badge
bool
If the group has a verified badge.
Source code inroblox/partials/partialgroup.py
class AssetPartialGroup(BaseGroup):\n \"\"\"\n Represents a partial group in the context of a Roblox asset.\n Intended to parse the `data[0][\"creator\"]` data from https://games.roblox.com/v1/games.\n\n Attributes:\n _client: The Client object, which is passed to all objects this Client generates.\n id: The group's name.\n creator: The group's owner.\n name: The group's name.\n has_verified_badge: If the group has a verified badge.\n \"\"\"\n\n def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: The Client.\n data: The data from the endpoint.\n \"\"\"\n self._client: Client = client\n\n self.creator: BaseUser = BaseUser(client=client, user_id=data[\"Id\"])\n self.id: int = data[\"CreatorTargetId\"]\n self.name: str = data[\"Name\"]\n self.has_verified_badge: bool = data[\"HasVerifiedBadge\"]\n\n super().__init__(client, self.id)\n
"},{"location":"reference/partials/partialgroup/#roblox.partials.partialgroup.AssetPartialGroup.__init__","title":"__init__(client, data)
","text":"Parameters:
Name Type Description Defaultclient
Client
The Client.
requireddata
dict
The data from the endpoint.
required Source code inroblox/partials/partialgroup.py
def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: The Client.\n data: The data from the endpoint.\n \"\"\"\n self._client: Client = client\n\n self.creator: BaseUser = BaseUser(client=client, user_id=data[\"Id\"])\n self.id: int = data[\"CreatorTargetId\"]\n self.name: str = data[\"Name\"]\n self.has_verified_badge: bool = data[\"HasVerifiedBadge\"]\n\n super().__init__(client, self.id)\n
"},{"location":"reference/partials/partialgroup/#roblox.partials.partialgroup.UniversePartialGroup","title":"UniversePartialGroup
","text":" Bases: BaseGroup
Represents a partial group in the context of a Roblox universe.
Attributes:
Name Type Description_data
The data we get back from the endpoint.
_client
Client
The client object, which is passed to all objects this client generates.
id
Id of the group
name
str
Name of the group
has_verified_badge
bool
If the group has a verified badge.
Source code inroblox/partials/partialgroup.py
class UniversePartialGroup(BaseGroup):\n \"\"\"\n Represents a partial group in the context of a Roblox universe.\n\n Attributes:\n _data: The data we get back from the endpoint.\n _client: The client object, which is passed to all objects this client generates.\n id: Id of the group\n name: Name of the group\n has_verified_badge: If the group has a verified badge.\n \"\"\"\n\n def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: The ClientSharedObject.\n data: The data from the endpoint.\n \"\"\"\n self._client: Client = client\n self.id = data[\"id\"]\n self.name: str = data[\"name\"]\n self.has_verified_badge: bool = data[\"hasVerifiedBadge\"]\n\n super().__init__(client, self.id)\n
"},{"location":"reference/partials/partialgroup/#roblox.partials.partialgroup.UniversePartialGroup.__init__","title":"__init__(client, data)
","text":"Parameters:
Name Type Description Defaultclient
Client
The ClientSharedObject.
requireddata
dict
The data from the endpoint.
required Source code inroblox/partials/partialgroup.py
def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: The ClientSharedObject.\n data: The data from the endpoint.\n \"\"\"\n self._client: Client = client\n self.id = data[\"id\"]\n self.name: str = data[\"name\"]\n self.has_verified_badge: bool = data[\"hasVerifiedBadge\"]\n\n super().__init__(client, self.id)\n
"},{"location":"reference/partials/partialrole/","title":"partialrole","text":"This file contains partial objects related to Roblox group roles.
"},{"location":"reference/partials/partialrole/#roblox.partials.partialrole.PartialRole","title":"PartialRole
","text":" Bases: BaseRole
Represents partial group role information.
Attributes:
Name Type Description_client
Client
The Client object.
id
int
The role's ID.
name
str
The role's name.
rank
int
The role's rank ID.
Source code inroblox/partials/partialrole.py
class PartialRole(BaseRole):\n \"\"\"\n Represents partial group role information.\n\n Attributes:\n _client: The Client object.\n id: The role's ID.\n name: The role's name.\n rank: The role's rank ID.\n \"\"\"\n\n def __init__(self, client: Client, data: dict):\n self._client: Client = client\n\n self.id: int = data[\"id\"]\n super().__init__(client=self._client, role_id=self.id)\n self.name: str = data[\"name\"]\n self.rank: int = data[\"rank\"]\n
"},{"location":"reference/partials/partialuniverse/","title":"partialuniverse","text":"This file contains partial objects related to Roblox universes.
"},{"location":"reference/partials/partialuniverse/#roblox.partials.partialuniverse.ChatPartialUniverse","title":"ChatPartialUniverse
","text":" Bases: BaseUniverse
Represents a partial universe in the context of a chat conversation.
Attributes:
Name Type Description_data
The data we get back from the endpoint.
_client
Client
The client object, which is passed to all objects this client generates.
id
int
The universe ID.
root_place
BasePlace
The universe's root place.
Source code inroblox/partials/partialuniverse.py
class ChatPartialUniverse(BaseUniverse):\n \"\"\"\n Represents a partial universe in the context of a chat conversation.\n\n Attributes:\n _data: The data we get back from the endpoint.\n _client: The client object, which is passed to all objects this client generates.\n id: The universe ID.\n root_place: The universe's root place.\n \"\"\"\n\n def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: The ClientSharedObject.\n data: The raw data.\n \"\"\"\n self._client: Client = client\n\n self.id: int = data[\"universeId\"]\n\n super().__init__(client=client, universe_id=self.id)\n\n self.root_place: BasePlace = BasePlace(client=client, place_id=data[\"rootPlaceId\"])\n
"},{"location":"reference/partials/partialuniverse/#roblox.partials.partialuniverse.ChatPartialUniverse.__init__","title":"__init__(client, data)
","text":"Parameters:
Name Type Description Defaultclient
Client
The ClientSharedObject.
requireddata
dict
The raw data.
required Source code inroblox/partials/partialuniverse.py
def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: The ClientSharedObject.\n data: The raw data.\n \"\"\"\n self._client: Client = client\n\n self.id: int = data[\"universeId\"]\n\n super().__init__(client=client, universe_id=self.id)\n\n self.root_place: BasePlace = BasePlace(client=client, place_id=data[\"rootPlaceId\"])\n
"},{"location":"reference/partials/partialuniverse/#roblox.partials.partialuniverse.PartialUniverse","title":"PartialUniverse
","text":" Bases: BaseUniverse
Represents partial universe information.
Attributes:. _client: The Client object, which is passed to all objects this Client generates. id: The universe ID. name: The name of the universe. root_place: The universe's root place.
Source code inroblox/partials/partialuniverse.py
class PartialUniverse(BaseUniverse):\n \"\"\"\n Represents partial universe information.\n\n Attributes:.\n _client: The Client object, which is passed to all objects this Client generates.\n id: The universe ID.\n name: The name of the universe.\n root_place: The universe's root place.\n \"\"\"\n\n def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: The Client.\n data: The raw data.\n \"\"\"\n self._client: Client = client\n\n self.id: int = data[\"id\"]\n\n super().__init__(client=client, universe_id=self.id)\n\n self.name: str = data[\"name\"]\n self.root_place: BasePlace = BasePlace(client=client, place_id=data[\"rootPlaceId\"])\n
"},{"location":"reference/partials/partialuniverse/#roblox.partials.partialuniverse.PartialUniverse.__init__","title":"__init__(client, data)
","text":"Parameters:
Name Type Description Defaultclient
Client
The Client.
requireddata
dict
The raw data.
required Source code inroblox/partials/partialuniverse.py
def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: The Client.\n data: The raw data.\n \"\"\"\n self._client: Client = client\n\n self.id: int = data[\"id\"]\n\n super().__init__(client=client, universe_id=self.id)\n\n self.name: str = data[\"name\"]\n self.root_place: BasePlace = BasePlace(client=client, place_id=data[\"rootPlaceId\"])\n
"},{"location":"reference/partials/partialuser/","title":"partialuser","text":"This file contains partial objects related to Roblox users.
"},{"location":"reference/partials/partialuser/#roblox.partials.partialuser.PartialUser","title":"PartialUser
","text":" Bases: BaseUser
Represents partial user information.
Attributes:
Name Type Description_client
Client
The Client object, which is passed to all objects this Client generates.
id
int
The user's ID.
name
str
The user's name.
display_name
str
The user's display name.
has_verified_badge
bool
If the user has a verified badge.
Source code inroblox/partials/partialuser.py
class PartialUser(BaseUser):\n \"\"\"\n Represents partial user information.\n\n Attributes:\n _client: The Client object, which is passed to all objects this Client generates.\n id: The user's ID.\n name: The user's name.\n display_name: The user's display name.\n has_verified_badge: If the user has a verified badge.\n \"\"\"\n\n def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: The Client.\n data: The data from the endpoint.\n \"\"\"\n self._client: Client = client\n\n self.id: int = data.get(\"id\") or data.get(\"userId\") or data.get(\"Id\")\n\n super().__init__(client=client, user_id=self.id)\n\n self.name: str = data.get(\"name\") or data.get(\"Name\") or data.get(\"username\") or data.get(\"Username\")\n self.display_name: str = data.get(\"displayName\")\n self.has_verified_badge: bool = data.get(\"hasVerifiedBadge\", False) or data.get(\"HasVerifiedBadge\", False)\n
"},{"location":"reference/partials/partialuser/#roblox.partials.partialuser.PartialUser.__init__","title":"__init__(client, data)
","text":"Parameters:
Name Type Description Defaultclient
Client
The Client.
requireddata
dict
The data from the endpoint.
required Source code inroblox/partials/partialuser.py
def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: The Client.\n data: The data from the endpoint.\n \"\"\"\n self._client: Client = client\n\n self.id: int = data.get(\"id\") or data.get(\"userId\") or data.get(\"Id\")\n\n super().__init__(client=client, user_id=self.id)\n\n self.name: str = data.get(\"name\") or data.get(\"Name\") or data.get(\"username\") or data.get(\"Username\")\n self.display_name: str = data.get(\"displayName\")\n self.has_verified_badge: bool = data.get(\"hasVerifiedBadge\", False) or data.get(\"HasVerifiedBadge\", False)\n
"},{"location":"reference/partials/partialuser/#roblox.partials.partialuser.PreviousUsernamesPartialUser","title":"PreviousUsernamesPartialUser
","text":" Bases: PartialUser
Represents a partial user in the context of a search where the user's previous usernames are present. Attributes: previous_usernames: A list of the user's previous usernames.
Source code inroblox/partials/partialuser.py
class PreviousUsernamesPartialUser(PartialUser):\n \"\"\"\n Represents a partial user in the context of a search where the user's previous usernames are present.\n Attributes:\n previous_usernames: A list of the user's previous usernames.\n \"\"\"\n\n def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: The Client.\n data: The data from the endpoint.\n \"\"\"\n super().__init__(client=client, data=data)\n\n self.previous_usernames: List[str] = data[\"previousUsernames\"]\n
"},{"location":"reference/partials/partialuser/#roblox.partials.partialuser.PreviousUsernamesPartialUser.__init__","title":"__init__(client, data)
","text":"Parameters:
Name Type Description Defaultclient
Client
The Client.
requireddata
dict
The data from the endpoint.
required Source code inroblox/partials/partialuser.py
def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: The Client.\n data: The data from the endpoint.\n \"\"\"\n super().__init__(client=client, data=data)\n\n self.previous_usernames: List[str] = data[\"previousUsernames\"]\n
"},{"location":"reference/partials/partialuser/#roblox.partials.partialuser.RequestedUsernamePartialUser","title":"RequestedUsernamePartialUser
","text":" Bases: PartialUser
Represents a partial user in the context of a search where the requested username is present.
Attributes:
Name Type Descriptionrequested_username
Optional[str]
The requested username.
Source code inroblox/partials/partialuser.py
class RequestedUsernamePartialUser(PartialUser):\n \"\"\"\n Represents a partial user in the context of a search where the requested username is present.\n\n Attributes:\n requested_username: The requested username.\n \"\"\"\n\n def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: The Client.\n data: The data from the endpoint.\n \"\"\"\n super().__init__(client=client, data=data)\n\n self.requested_username: Optional[str] = data.get(\"requestedUsername\")\n
"},{"location":"reference/partials/partialuser/#roblox.partials.partialuser.RequestedUsernamePartialUser.__init__","title":"__init__(client, data)
","text":"Parameters:
Name Type Description Defaultclient
Client
The Client.
requireddata
dict
The data from the endpoint.
required Source code inroblox/partials/partialuser.py
def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: The Client.\n data: The data from the endpoint.\n \"\"\"\n super().__init__(client=client, data=data)\n\n self.requested_username: Optional[str] = data.get(\"requestedUsername\")\n
"},{"location":"reference/utilities/","title":"utilities","text":"Contains utilities used internally for ro.py.
"},{"location":"reference/utilities/exceptions/","title":"exceptions","text":"Contains exceptions used by ro.py.
"},{"location":"reference/utilities/exceptions/#roblox.utilities.exceptions.AssetNotFound","title":"AssetNotFound
","text":" Bases: ItemNotFound
Raised for invalid asset IDs.
Source code inroblox/utilities/exceptions.py
class AssetNotFound(ItemNotFound):\n \"\"\"\n Raised for invalid asset IDs.\n \"\"\"\n pass\n
"},{"location":"reference/utilities/exceptions/#roblox.utilities.exceptions.BadRequest","title":"BadRequest
","text":" Bases: HTTPException
HTTP exception raised for status code 400.
Source code inroblox/utilities/exceptions.py
class BadRequest(HTTPException):\n \"\"\"HTTP exception raised for status code 400.\"\"\"\n pass\n
"},{"location":"reference/utilities/exceptions/#roblox.utilities.exceptions.BadgeNotFound","title":"BadgeNotFound
","text":" Bases: ItemNotFound
Raised for invalid badge IDs.
Source code inroblox/utilities/exceptions.py
class BadgeNotFound(ItemNotFound):\n \"\"\"\n Raised for invalid badge IDs.\n \"\"\"\n pass\n
"},{"location":"reference/utilities/exceptions/#roblox.utilities.exceptions.Forbidden","title":"Forbidden
","text":" Bases: HTTPException
HTTP exception raised for status code 403. This usually means the X-CSRF-Token was not properly provided.
Source code inroblox/utilities/exceptions.py
class Forbidden(HTTPException):\n \"\"\"HTTP exception raised for status code 403. This usually means the X-CSRF-Token was not properly provided.\"\"\"\n pass\n
"},{"location":"reference/utilities/exceptions/#roblox.utilities.exceptions.GroupNotFound","title":"GroupNotFound
","text":" Bases: ItemNotFound
Raised for invalid group IDs.
Source code inroblox/utilities/exceptions.py
class GroupNotFound(ItemNotFound):\n \"\"\"\n Raised for invalid group IDs.\n \"\"\"\n pass\n
"},{"location":"reference/utilities/exceptions/#roblox.utilities.exceptions.HTTPException","title":"HTTPException
","text":" Bases: RobloxException
Exception that's raised when an HTTP request fails.
Attributes:
Name Type Descriptionresponse
Response
The HTTP response object.
status
int
The HTTP response status code.
errors
List[ResponseError]
A list of Roblox response errors.
Source code inroblox/utilities/exceptions.py
class HTTPException(RobloxException):\n \"\"\"\n Exception that's raised when an HTTP request fails.\n\n Attributes:\n response: The HTTP response object.\n status: The HTTP response status code.\n errors: A list of Roblox response errors.\n \"\"\"\n\n def __init__(self, response: Response, errors: Optional[list] = None):\n \"\"\"\n Arguments:\n response: The raw response object.\n errors: A list of errors.\n \"\"\"\n self.response: Response = response\n self.status: int = response.status_code\n self.errors: List[ResponseError]\n\n if errors:\n self.errors = [\n ResponseError(data=error_data) for error_data in errors\n ]\n else:\n self.errors = []\n\n if self.errors:\n error_string = self._generate_string()\n super().__init__(\n f\"{response.status_code} {response.reason_phrase}: {response.url}.\\n\\nErrors:\\n{error_string}\")\n else:\n super().__init__(f\"{response.status_code} {response.reason_phrase}: {response.url}\")\n\n def _generate_string(self) -> str:\n parsed_errors = []\n for error in self.errors:\n # Make each error into a parsed string\n parsed_error = f\"\\t{error.code}: {error.message}\"\n error_messages = []\n\n error.user_facing_message and error_messages.append(f\"User-facing message: {error.user_facing_message}\")\n error.field and error_messages.append(f\"Field: {error.field}\")\n error.retryable and error_messages.append(f\"Retryable: {error.retryable}\")\n\n if error_messages:\n error_message_string = \"\\n\\t\\t\".join(error_messages)\n parsed_error += f\"\\n\\t\\t{error_message_string}\"\n\n parsed_errors.append(parsed_error)\n\n # Turn the parsed errors into a joined string\n return \"\\n\".join(parsed_errors)\n
"},{"location":"reference/utilities/exceptions/#roblox.utilities.exceptions.HTTPException.__init__","title":"__init__(response, errors=None)
","text":"Parameters:
Name Type Description Defaultresponse
Response
The raw response object.
requirederrors
Optional[list]
A list of errors.
None
Source code in roblox/utilities/exceptions.py
def __init__(self, response: Response, errors: Optional[list] = None):\n \"\"\"\n Arguments:\n response: The raw response object.\n errors: A list of errors.\n \"\"\"\n self.response: Response = response\n self.status: int = response.status_code\n self.errors: List[ResponseError]\n\n if errors:\n self.errors = [\n ResponseError(data=error_data) for error_data in errors\n ]\n else:\n self.errors = []\n\n if self.errors:\n error_string = self._generate_string()\n super().__init__(\n f\"{response.status_code} {response.reason_phrase}: {response.url}.\\n\\nErrors:\\n{error_string}\")\n else:\n super().__init__(f\"{response.status_code} {response.reason_phrase}: {response.url}\")\n
"},{"location":"reference/utilities/exceptions/#roblox.utilities.exceptions.InternalServerError","title":"InternalServerError
","text":" Bases: HTTPException
HTTP exception raised for status code 500. This usually means that there was an issue on Roblox's end, but due to faulty coding on Roblox's part this can sometimes mean that an endpoint used internally was disabled or that invalid parameters were passed.
Source code inroblox/utilities/exceptions.py
class InternalServerError(HTTPException):\n \"\"\"\n HTTP exception raised for status code 500.\n This usually means that there was an issue on Roblox's end, but due to faulty coding on Roblox's part this can\n sometimes mean that an endpoint used internally was disabled or that invalid parameters were passed.\n \"\"\"\n pass\n
"},{"location":"reference/utilities/exceptions/#roblox.utilities.exceptions.InvalidRole","title":"InvalidRole
","text":" Bases: RobloxException
Raised when a role doesn't exist.
Source code inroblox/utilities/exceptions.py
class InvalidRole(RobloxException):\n \"\"\"\n Raised when a role doesn't exist.\n \"\"\"\n pass\n
"},{"location":"reference/utilities/exceptions/#roblox.utilities.exceptions.ItemNotFound","title":"ItemNotFound
","text":" Bases: RobloxException
Raised for invalid items.
Source code inroblox/utilities/exceptions.py
class ItemNotFound(RobloxException):\n \"\"\"\n Raised for invalid items.\n \"\"\"\n\n def __init__(self, message: str, response: Optional[Response] = None):\n \"\"\"\n Arguments:\n response: The raw response object.\n \"\"\"\n self.response: Optional[Response] = response\n self.status: Optional[int] = response.status_code if response else None\n super().__init__(message)\n
"},{"location":"reference/utilities/exceptions/#roblox.utilities.exceptions.ItemNotFound.__init__","title":"__init__(message, response=None)
","text":"Parameters:
Name Type Description Defaultresponse
Optional[Response]
The raw response object.
None
Source code in roblox/utilities/exceptions.py
def __init__(self, message: str, response: Optional[Response] = None):\n \"\"\"\n Arguments:\n response: The raw response object.\n \"\"\"\n self.response: Optional[Response] = response\n self.status: Optional[int] = response.status_code if response else None\n super().__init__(message)\n
"},{"location":"reference/utilities/exceptions/#roblox.utilities.exceptions.NoMoreItems","title":"NoMoreItems
","text":" Bases: RobloxException
Raised when there are no more items left to iterate through.
Source code inroblox/utilities/exceptions.py
class NoMoreItems(RobloxException):\n \"\"\"\n Raised when there are no more items left to iterate through.\n \"\"\"\n pass\n
"},{"location":"reference/utilities/exceptions/#roblox.utilities.exceptions.NotFound","title":"NotFound
","text":" Bases: HTTPException
HTTP exception raised for status code 404. This usually means we have an internal URL issue - please make a GitHub issue about this!
Source code inroblox/utilities/exceptions.py
class NotFound(HTTPException):\n \"\"\"\n HTTP exception raised for status code 404.\n This usually means we have an internal URL issue - please make a GitHub issue about this!\n \"\"\"\n pass\n
"},{"location":"reference/utilities/exceptions/#roblox.utilities.exceptions.PlaceNotFound","title":"PlaceNotFound
","text":" Bases: ItemNotFound
Raised for invalid place IDs.
Source code inroblox/utilities/exceptions.py
class PlaceNotFound(ItemNotFound):\n \"\"\"\n Raised for invalid place IDs.\n \"\"\"\n pass\n
"},{"location":"reference/utilities/exceptions/#roblox.utilities.exceptions.PluginNotFound","title":"PluginNotFound
","text":" Bases: ItemNotFound
Raised for invalid plugin IDs.
Source code inroblox/utilities/exceptions.py
class PluginNotFound(ItemNotFound):\n \"\"\"\n Raised for invalid plugin IDs.\n \"\"\"\n pass\n
"},{"location":"reference/utilities/exceptions/#roblox.utilities.exceptions.ResponseError","title":"ResponseError
","text":"Represents an error returned by a Roblox game server.
Attributes:
Name Type Descriptioncode
int
The error code.
message
Optional[str]
The error message.
user_facing_message
Optional[str]
A more simple error message intended for frontend use.
field
Optional[str]
The field causing this error.
retryable
Optional[str]
Whether retrying this exception could supress this issue.
Source code inroblox/utilities/exceptions.py
class ResponseError:\n \"\"\"\n Represents an error returned by a Roblox game server.\n\n Attributes:\n code: The error code.\n message: The error message.\n user_facing_message: A more simple error message intended for frontend use.\n field: The field causing this error.\n retryable: Whether retrying this exception could supress this issue.\n \"\"\"\n\n def __init__(self, data: dict):\n self.code: int = data[\"code\"]\n self.message: Optional[str] = data.get(\"message\")\n self.user_facing_message: Optional[str] = data.get(\"userFacingMessage\")\n self.field: Optional[str] = data.get(\"field\")\n self.retryable: Optional[str] = data.get(\"retryable\")\n
"},{"location":"reference/utilities/exceptions/#roblox.utilities.exceptions.RobloxException","title":"RobloxException
","text":" Bases: Exception
Base exception for all of ro.py.
Source code inroblox/utilities/exceptions.py
class RobloxException(Exception):\n \"\"\"\n Base exception for all of ro.py.\n \"\"\"\n pass\n
"},{"location":"reference/utilities/exceptions/#roblox.utilities.exceptions.TooManyRequests","title":"TooManyRequests
","text":" Bases: HTTPException
HTTP exception raised for status code 429. This means that Roblox has ratelimited you.
Source code inroblox/utilities/exceptions.py
class TooManyRequests(HTTPException):\n \"\"\"\n HTTP exception raised for status code 429.\n This means that Roblox has [ratelimited](https://en.wikipedia.org/wiki/Rate_limiting) you.\n \"\"\"\n pass\n
"},{"location":"reference/utilities/exceptions/#roblox.utilities.exceptions.Unauthorized","title":"Unauthorized
","text":" Bases: HTTPException
HTTP exception raised for status code 401. This usually means you aren't properly authenticated.
Source code inroblox/utilities/exceptions.py
class Unauthorized(HTTPException):\n \"\"\"HTTP exception raised for status code 401. This usually means you aren't properly authenticated.\"\"\"\n
"},{"location":"reference/utilities/exceptions/#roblox.utilities.exceptions.UniverseNotFound","title":"UniverseNotFound
","text":" Bases: ItemNotFound
Raised for invalid universe IDs.
Source code inroblox/utilities/exceptions.py
class UniverseNotFound(ItemNotFound):\n \"\"\"\n Raised for invalid universe IDs.\n \"\"\"\n pass\n
"},{"location":"reference/utilities/exceptions/#roblox.utilities.exceptions.UserNotFound","title":"UserNotFound
","text":" Bases: ItemNotFound
Raised for invalid user IDs or usernames.
Source code inroblox/utilities/exceptions.py
class UserNotFound(ItemNotFound):\n \"\"\"\n Raised for invalid user IDs or usernames.\n \"\"\"\n pass\n
"},{"location":"reference/utilities/exceptions/#roblox.utilities.exceptions.get_exception_from_status_code","title":"get_exception_from_status_code(code)
","text":"Gets an exception that should be raised instead of the generic HTTPException for this status code.
Source code inroblox/utilities/exceptions.py
def get_exception_from_status_code(code: int) -> Type[HTTPException]:\n \"\"\"\n Gets an exception that should be raised instead of the generic HTTPException for this status code.\n \"\"\"\n return _codes_exceptions.get(code) or HTTPException\n
"},{"location":"reference/utilities/iterators/","title":"iterators","text":"This module contains iterators used internally by ro.py to provide paginated information.
"},{"location":"reference/utilities/iterators/#roblox.utilities.iterators.IteratorItems","title":"IteratorItems
","text":" Bases: AsyncIterator
Represents the items inside of an iterator.
Source code inroblox/utilities/iterators.py
class IteratorItems(AsyncIterator):\n \"\"\"\n Represents the items inside of an iterator.\n \"\"\"\n\n def __init__(self, iterator: RobloxIterator, max_items: Optional[int] = None):\n self._iterator = iterator\n self._position: int = 0\n self._global_position: int = 0\n self._items: list = []\n self._max_items = max_items\n\n def __aiter__(self):\n self._position = 0\n self._items = []\n return self\n\n async def __anext__(self):\n if self._position == len(self._items):\n # we are at the end of our current page of items. start again with a new page\n self._position = 0\n try:\n # get new items\n self._items = await self._iterator.next()\n except NoMoreItems:\n # if there aren't any more items, reset and break the loop\n self._position = 0\n self._global_position = 0\n self._items = []\n raise StopAsyncIteration\n\n if self._max_items is not None and self._global_position >= self._max_items:\n raise StopAsyncIteration\n\n # if we got here we know there are more items\n try:\n item = self._items[self._position]\n except IndexError:\n # edge case for group roles\n raise StopAsyncIteration\n # we advance the iterator by one for the next iteration\n self._position += 1\n self._global_position += 1\n return item\n
"},{"location":"reference/utilities/iterators/#roblox.utilities.iterators.IteratorPages","title":"IteratorPages
","text":" Bases: AsyncIterator
Represents the pages inside of an iterator.
Source code inroblox/utilities/iterators.py
class IteratorPages(AsyncIterator):\n \"\"\"\n Represents the pages inside of an iterator.\n \"\"\"\n\n def __init__(self, iterator: RobloxIterator):\n self._iterator = iterator\n\n def __aiter__(self):\n return self\n\n async def __anext__(self):\n try:\n page = await self._iterator.next()\n return page\n except NoMoreItems:\n raise StopAsyncIteration\n
"},{"location":"reference/utilities/iterators/#roblox.utilities.iterators.PageIterator","title":"PageIterator
","text":" Bases: RobloxIterator
Represents a cursor-based, paginated Roblox object. Learn more about iterators in the pagination tutorial: Pagination For more information about how cursor-based pagination works, see https://robloxapi.wiki/wiki/Pagination.
Attributes:
Name Type Description_client
Client
The Client.
url
str
The endpoint to hit for new page data.
sort_order
SortOrder
The sort order to use for returned data.
page_size
int
How much data should be returned per-page.
extra_parameters
dict
Extra parameters to pass to the endpoint.
handler
Callable
A callable object to use to convert raw endpoint data to parsed objects.
handler_kwargs
dict
Extra keyword arguments to pass to the handler.
next_cursor
str
Cursor to use to advance to the next page.
previous_cursor
str
Cursor to use to advance to the previous page.
iterator_position
int
What position in the iterator_items the iterator is currently at.
iterator_items
list
List of current items the iterator is working on.
Source code inroblox/utilities/iterators.py
class PageIterator(RobloxIterator):\n \"\"\"\n Represents a cursor-based, paginated Roblox object. Learn more about iterators in the pagination tutorial:\n [Pagination](../../tutorials/pagination.md)\n For more information about how cursor-based pagination works, see https://robloxapi.wiki/wiki/Pagination.\n\n Attributes:\n _client: The Client.\n url: The endpoint to hit for new page data.\n sort_order: The sort order to use for returned data.\n page_size: How much data should be returned per-page.\n extra_parameters: Extra parameters to pass to the endpoint.\n handler: A callable object to use to convert raw endpoint data to parsed objects.\n handler_kwargs: Extra keyword arguments to pass to the handler.\n next_cursor: Cursor to use to advance to the next page.\n previous_cursor: Cursor to use to advance to the previous page.\n iterator_position: What position in the iterator_items the iterator is currently at.\n iterator_items: List of current items the iterator is working on.\n \"\"\"\n\n def __init__(\n self,\n client: Client,\n url: str,\n sort_order: SortOrder = SortOrder.Ascending,\n page_size: int = 10,\n max_items: int = None,\n extra_parameters: Optional[dict] = None,\n handler: Optional[Callable] = None,\n handler_kwargs: Optional[dict] = None\n ):\n \"\"\"\n Parameters:\n client: The Client.\n url: The endpoint to hit for new page data.\n sort_order: The sort order to use for returned data.\n page_size: How much data should be returned per-page.\n max_items: The maximum amount of items to return when this iterator is looped through.\n extra_parameters: Extra parameters to pass to the endpoint.\n handler: A callable object to use to convert raw endpoint data to parsed objects.\n handler_kwargs: Extra keyword arguments to pass to the handler.\n \"\"\"\n super().__init__(max_items=max_items)\n\n self._client: Client = client\n\n # store some basic arguments in the object\n self.url: str = url\n self.sort_order: SortOrder = sort_order\n self.page_size: int = page_size\n\n self.extra_parameters: dict = extra_parameters or {}\n self.handler: Callable = handler\n self.handler_kwargs: dict = handler_kwargs or {}\n\n # cursors to use for next, previous\n self.next_cursor: str = \"\"\n self.previous_cursor: str = \"\"\n\n # iter values\n self.iterator_position: int = 0\n self.iterator_items: list = []\n self.next_started: bool = False\n\n async def next(self):\n \"\"\"\n Advances the iterator to the next page.\n \"\"\"\n if self.next_started and not self.next_cursor:\n \"\"\"\n If we just started and there is no cursor, this is the last page, because we can go back but not forward.\n We should raise an exception here.\n \"\"\"\n raise NoMoreItems(\"No more items.\")\n\n if not self.next_started:\n self.next_started = True\n\n page_response = await self._client.requests.get(\n url=self.url,\n params={\n \"cursor\": self.next_cursor,\n \"limit\": self.page_size,\n \"sortOrder\": self.sort_order.value,\n **self.extra_parameters\n }\n )\n page_data = page_response.json()\n\n # fill in cursors\n self.next_cursor = page_data[\"nextPageCursor\"]\n self.previous_cursor = page_data[\"previousPageCursor\"]\n\n data = page_data[\"data\"]\n\n if self.handler:\n data = [\n self.handler(\n client=self._client,\n data=item_data,\n **self.handler_kwargs\n ) for item_data in data\n ]\n\n return data\n
"},{"location":"reference/utilities/iterators/#roblox.utilities.iterators.PageIterator.__init__","title":"__init__(client, url, sort_order=SortOrder.Ascending, page_size=10, max_items=None, extra_parameters=None, handler=None, handler_kwargs=None)
","text":"Parameters:
Name Type Description Defaultclient
Client
The Client.
requiredurl
str
The endpoint to hit for new page data.
requiredsort_order
SortOrder
The sort order to use for returned data.
Ascending
page_size
int
How much data should be returned per-page.
10
max_items
int
The maximum amount of items to return when this iterator is looped through.
None
extra_parameters
Optional[dict]
Extra parameters to pass to the endpoint.
None
handler
Optional[Callable]
A callable object to use to convert raw endpoint data to parsed objects.
None
handler_kwargs
Optional[dict]
Extra keyword arguments to pass to the handler.
None
Source code in roblox/utilities/iterators.py
def __init__(\n self,\n client: Client,\n url: str,\n sort_order: SortOrder = SortOrder.Ascending,\n page_size: int = 10,\n max_items: int = None,\n extra_parameters: Optional[dict] = None,\n handler: Optional[Callable] = None,\n handler_kwargs: Optional[dict] = None\n):\n \"\"\"\n Parameters:\n client: The Client.\n url: The endpoint to hit for new page data.\n sort_order: The sort order to use for returned data.\n page_size: How much data should be returned per-page.\n max_items: The maximum amount of items to return when this iterator is looped through.\n extra_parameters: Extra parameters to pass to the endpoint.\n handler: A callable object to use to convert raw endpoint data to parsed objects.\n handler_kwargs: Extra keyword arguments to pass to the handler.\n \"\"\"\n super().__init__(max_items=max_items)\n\n self._client: Client = client\n\n # store some basic arguments in the object\n self.url: str = url\n self.sort_order: SortOrder = sort_order\n self.page_size: int = page_size\n\n self.extra_parameters: dict = extra_parameters or {}\n self.handler: Callable = handler\n self.handler_kwargs: dict = handler_kwargs or {}\n\n # cursors to use for next, previous\n self.next_cursor: str = \"\"\n self.previous_cursor: str = \"\"\n\n # iter values\n self.iterator_position: int = 0\n self.iterator_items: list = []\n self.next_started: bool = False\n
"},{"location":"reference/utilities/iterators/#roblox.utilities.iterators.PageIterator.next","title":"next()
async
","text":"Advances the iterator to the next page.
Source code inroblox/utilities/iterators.py
async def next(self):\n \"\"\"\n Advances the iterator to the next page.\n \"\"\"\n if self.next_started and not self.next_cursor:\n \"\"\"\n If we just started and there is no cursor, this is the last page, because we can go back but not forward.\n We should raise an exception here.\n \"\"\"\n raise NoMoreItems(\"No more items.\")\n\n if not self.next_started:\n self.next_started = True\n\n page_response = await self._client.requests.get(\n url=self.url,\n params={\n \"cursor\": self.next_cursor,\n \"limit\": self.page_size,\n \"sortOrder\": self.sort_order.value,\n **self.extra_parameters\n }\n )\n page_data = page_response.json()\n\n # fill in cursors\n self.next_cursor = page_data[\"nextPageCursor\"]\n self.previous_cursor = page_data[\"previousPageCursor\"]\n\n data = page_data[\"data\"]\n\n if self.handler:\n data = [\n self.handler(\n client=self._client,\n data=item_data,\n **self.handler_kwargs\n ) for item_data in data\n ]\n\n return data\n
"},{"location":"reference/utilities/iterators/#roblox.utilities.iterators.PageNumberIterator","title":"PageNumberIterator
","text":" Bases: RobloxIterator
Represents an iterator that is advanced with page numbers and sizes, like those seen on chat.roblox.com.
Attributes:
Name Type Descriptionurl
str
The endpoint to hit for new page data.
page_number
int
The current page number.
page_size
int
The size of each page.
extra_parameters
dict
Extra parameters to pass to the endpoint.
handler
Callable
A callable object to use to convert raw endpoint data to parsed objects.
handler_kwargs
dict
Extra keyword arguments to pass to the handler.
Source code inroblox/utilities/iterators.py
class PageNumberIterator(RobloxIterator):\n \"\"\"\n Represents an iterator that is advanced with page numbers and sizes, like those seen on chat.roblox.com.\n\n Attributes:\n url: The endpoint to hit for new page data.\n page_number: The current page number.\n page_size: The size of each page.\n extra_parameters: Extra parameters to pass to the endpoint.\n handler: A callable object to use to convert raw endpoint data to parsed objects.\n handler_kwargs: Extra keyword arguments to pass to the handler.\n \"\"\"\n\n def __init__(\n self,\n client: Client,\n url: str,\n page_size: int = 10,\n extra_parameters: Optional[dict] = None,\n handler: Optional[Callable] = None,\n handler_kwargs: Optional[dict] = None\n ):\n super().__init__()\n\n self._client: Client = client\n\n self.url: str = url\n self.page_number: int = 1\n self.page_size: int = page_size\n\n self.extra_parameters: dict = extra_parameters or {}\n self.handler: Callable = handler\n self.handler_kwargs: dict = handler_kwargs or {}\n\n self.iterator_position = 0\n self.iterator_items = []\n\n async def next(self):\n \"\"\"\n Advances the iterator to the next page.\n \"\"\"\n page_response = await self._client.requests.get(\n url=self.url,\n params={\n \"pageNumber\": self.page_number,\n \"pageSize\": self.page_size,\n **self.extra_parameters\n }\n )\n data = page_response.json()\n\n if len(data) == 0:\n raise NoMoreItems(\"No more items.\")\n\n self.page_number += 1\n\n if self.handler:\n data = [\n self.handler(\n client=self._client,\n data=item_data,\n **self.handler_kwargs\n ) for item_data in data\n ]\n\n return data\n
"},{"location":"reference/utilities/iterators/#roblox.utilities.iterators.PageNumberIterator.next","title":"next()
async
","text":"Advances the iterator to the next page.
Source code inroblox/utilities/iterators.py
async def next(self):\n \"\"\"\n Advances the iterator to the next page.\n \"\"\"\n page_response = await self._client.requests.get(\n url=self.url,\n params={\n \"pageNumber\": self.page_number,\n \"pageSize\": self.page_size,\n **self.extra_parameters\n }\n )\n data = page_response.json()\n\n if len(data) == 0:\n raise NoMoreItems(\"No more items.\")\n\n self.page_number += 1\n\n if self.handler:\n data = [\n self.handler(\n client=self._client,\n data=item_data,\n **self.handler_kwargs\n ) for item_data in data\n ]\n\n return data\n
"},{"location":"reference/utilities/iterators/#roblox.utilities.iterators.RobloxIterator","title":"RobloxIterator
","text":"Represents a basic iterator which all iterators should implement.
Source code inroblox/utilities/iterators.py
class RobloxIterator:\n \"\"\"\n Represents a basic iterator which all iterators should implement.\n \"\"\"\n\n def __init__(self, max_items: int = None):\n self.max_items: Optional[int] = max_items\n\n async def next(self):\n \"\"\"\n Moves to the next page and returns that page's data.\n \"\"\"\n\n raise NotImplementedError\n\n async def flatten(self, max_items: int = None) -> list:\n \"\"\"\n Flattens the data into a list.\n \"\"\"\n if max_items is None:\n max_items = self.max_items\n\n items: list = []\n\n while True:\n try:\n new_items = await self.next()\n items += new_items\n except NoMoreItems:\n break\n\n if max_items is not None and len(items) >= max_items:\n break\n\n return items[:max_items]\n\n def __aiter__(self):\n return IteratorItems(\n iterator=self,\n max_items=self.max_items\n )\n\n def items(self, max_items: int = None) -> IteratorItems:\n \"\"\"\n Returns an AsyncIterable containing each iterator item.\n \"\"\"\n if max_items is None:\n max_items = self.max_items\n return IteratorItems(\n iterator=self,\n max_items=max_items\n )\n\n def pages(self) -> IteratorPages:\n \"\"\"\n Returns an AsyncIterable containing each iterator page. Each page is a list of items.\n \"\"\"\n return IteratorPages(self)\n
"},{"location":"reference/utilities/iterators/#roblox.utilities.iterators.RobloxIterator.flatten","title":"flatten(max_items=None)
async
","text":"Flattens the data into a list.
Source code inroblox/utilities/iterators.py
async def flatten(self, max_items: int = None) -> list:\n \"\"\"\n Flattens the data into a list.\n \"\"\"\n if max_items is None:\n max_items = self.max_items\n\n items: list = []\n\n while True:\n try:\n new_items = await self.next()\n items += new_items\n except NoMoreItems:\n break\n\n if max_items is not None and len(items) >= max_items:\n break\n\n return items[:max_items]\n
"},{"location":"reference/utilities/iterators/#roblox.utilities.iterators.RobloxIterator.items","title":"items(max_items=None)
","text":"Returns an AsyncIterable containing each iterator item.
Source code inroblox/utilities/iterators.py
def items(self, max_items: int = None) -> IteratorItems:\n \"\"\"\n Returns an AsyncIterable containing each iterator item.\n \"\"\"\n if max_items is None:\n max_items = self.max_items\n return IteratorItems(\n iterator=self,\n max_items=max_items\n )\n
"},{"location":"reference/utilities/iterators/#roblox.utilities.iterators.RobloxIterator.next","title":"next()
async
","text":"Moves to the next page and returns that page's data.
Source code inroblox/utilities/iterators.py
async def next(self):\n \"\"\"\n Moves to the next page and returns that page's data.\n \"\"\"\n\n raise NotImplementedError\n
"},{"location":"reference/utilities/iterators/#roblox.utilities.iterators.RobloxIterator.pages","title":"pages()
","text":"Returns an AsyncIterable containing each iterator page. Each page is a list of items.
Source code inroblox/utilities/iterators.py
def pages(self) -> IteratorPages:\n \"\"\"\n Returns an AsyncIterable containing each iterator page. Each page is a list of items.\n \"\"\"\n return IteratorPages(self)\n
"},{"location":"reference/utilities/iterators/#roblox.utilities.iterators.SortOrder","title":"SortOrder
","text":" Bases: Enum
Order in which page data should load in.
Source code inroblox/utilities/iterators.py
class SortOrder(Enum):\n \"\"\"\n Order in which page data should load in.\n \"\"\"\n\n Ascending = \"Asc\"\n Descending = \"Desc\"\n
"},{"location":"reference/utilities/requests/","title":"requests","text":"This module contains classes used internally by ro.py for sending requests to Roblox endpoints.
"},{"location":"reference/utilities/requests/#roblox.utilities.requests.CleanAsyncClient","title":"CleanAsyncClient
","text":" Bases: AsyncClient
This is a clean-on-delete version of httpx.AsyncClient.
Source code inroblox/utilities/requests.py
class CleanAsyncClient(AsyncClient):\n \"\"\"\n This is a clean-on-delete version of httpx.AsyncClient.\n \"\"\"\n\n def __init__(self):\n super().__init__()\n\n def __del__(self):\n try:\n asyncio.get_event_loop().create_task(self.aclose())\n except RuntimeError:\n pass\n
"},{"location":"reference/utilities/requests/#roblox.utilities.requests.Requests","title":"Requests
","text":"A special request object that implements special functionality required to connect to some Roblox endpoints.
Attributes:
Name Type Descriptionsession
CleanAsyncClient
Base session object to use when sending requests.
xcsrf_token_name
str
The header that will contain the Cross-Site Request Forgery token.
Source code inroblox/utilities/requests.py
class Requests:\n \"\"\"\n A special request object that implements special functionality required to connect to some Roblox endpoints.\n\n Attributes:\n session: Base session object to use when sending requests.\n xcsrf_token_name: The header that will contain the Cross-Site Request Forgery token.\n \"\"\"\n\n def __init__(\n self,\n session: CleanAsyncClient = None,\n xcsrf_token_name: str = \"X-CSRF-Token\"\n ):\n \"\"\"\n Arguments:\n session: A custom session object to use for sending requests, compatible with httpx.AsyncClient.\n xcsrf_token_name: The header to place X-CSRF-Token data into.\n \"\"\"\n self.session: CleanAsyncClient\n\n if session is None:\n self.session = CleanAsyncClient()\n else:\n self.session = session\n\n self.xcsrf_token_name: str = xcsrf_token_name\n\n self.session.headers[\"User-Agent\"] = \"Roblox/WinInet\"\n self.session.headers[\"Referer\"] = \"www.roblox.com\"\n\n async def request(self, method: str, *args, **kwargs) -> Response:\n \"\"\"\n Arguments:\n method: The request method.\n\n Returns:\n An HTTP response.\n \"\"\"\n\n handle_xcsrf_token = kwargs.pop(\"handle_xcsrf_token\", True)\n skip_roblox = kwargs.pop(\"skip_roblox\", False)\n\n response = await self.session.request(method, *args, **kwargs)\n\n if skip_roblox:\n return response\n\n method = method.lower()\n\n if handle_xcsrf_token and self.xcsrf_token_name in response.headers and _xcsrf_allowed_methods.get(method):\n self.session.headers[self.xcsrf_token_name] = response.headers[self.xcsrf_token_name]\n if response.status_code == 403: # Request failed, send it again\n response = await self.session.request(method, *args, **kwargs)\n\n if kwargs.get(\"stream\"):\n # Streamed responses should not be decoded, so we immediately return the response.\n return response\n\n if response.is_error:\n # Something went wrong, parse an error\n content_type = response.headers.get(\"Content-Type\")\n errors = None\n if content_type and content_type.startswith(\"application/json\"):\n data = None\n try:\n data = response.json()\n except JSONDecodeError:\n pass\n errors = data and data.get(\"errors\")\n\n exception = get_exception_from_status_code(response.status_code)(\n response=response,\n errors=errors\n )\n raise exception\n else:\n return response\n\n async def get(self, *args, **kwargs) -> Response:\n \"\"\"\n Sends a GET request.\n\n Returns:\n An HTTP response.\n \"\"\"\n\n return await self.request(\"GET\", *args, **kwargs)\n\n async def post(self, *args, **kwargs) -> Response:\n \"\"\"\n Sends a POST request.\n\n Returns:\n An HTTP response.\n \"\"\"\n\n return await self.request(\"POST\", *args, **kwargs)\n\n async def put(self, *args, **kwargs) -> Response:\n \"\"\"\n Sends a PATCH request.\n\n Returns:\n An HTTP response.\n \"\"\"\n\n return await self.request(\"PUT\", *args, **kwargs)\n\n async def patch(self, *args, **kwargs) -> Response:\n \"\"\"\n Sends a PATCH request.\n\n Returns:\n An HTTP response.\n \"\"\"\n\n return await self.request(\"PATCH\", *args, **kwargs)\n\n async def delete(self, *args, **kwargs) -> Response:\n \"\"\"\n Sends a DELETE request.\n\n Returns:\n An HTTP response.\n \"\"\"\n\n return await self.request(\"DELETE\", *args, **kwargs)\n
"},{"location":"reference/utilities/requests/#roblox.utilities.requests.Requests.__init__","title":"__init__(session=None, xcsrf_token_name='X-CSRF-Token')
","text":"Parameters:
Name Type Description Defaultsession
CleanAsyncClient
A custom session object to use for sending requests, compatible with httpx.AsyncClient.
None
xcsrf_token_name
str
The header to place X-CSRF-Token data into.
'X-CSRF-Token'
Source code in roblox/utilities/requests.py
def __init__(\n self,\n session: CleanAsyncClient = None,\n xcsrf_token_name: str = \"X-CSRF-Token\"\n):\n \"\"\"\n Arguments:\n session: A custom session object to use for sending requests, compatible with httpx.AsyncClient.\n xcsrf_token_name: The header to place X-CSRF-Token data into.\n \"\"\"\n self.session: CleanAsyncClient\n\n if session is None:\n self.session = CleanAsyncClient()\n else:\n self.session = session\n\n self.xcsrf_token_name: str = xcsrf_token_name\n\n self.session.headers[\"User-Agent\"] = \"Roblox/WinInet\"\n self.session.headers[\"Referer\"] = \"www.roblox.com\"\n
"},{"location":"reference/utilities/requests/#roblox.utilities.requests.Requests.delete","title":"delete(*args, **kwargs)
async
","text":"Sends a DELETE request.
Returns:
Type DescriptionResponse
An HTTP response.
Source code inroblox/utilities/requests.py
async def delete(self, *args, **kwargs) -> Response:\n \"\"\"\n Sends a DELETE request.\n\n Returns:\n An HTTP response.\n \"\"\"\n\n return await self.request(\"DELETE\", *args, **kwargs)\n
"},{"location":"reference/utilities/requests/#roblox.utilities.requests.Requests.get","title":"get(*args, **kwargs)
async
","text":"Sends a GET request.
Returns:
Type DescriptionResponse
An HTTP response.
Source code inroblox/utilities/requests.py
async def get(self, *args, **kwargs) -> Response:\n \"\"\"\n Sends a GET request.\n\n Returns:\n An HTTP response.\n \"\"\"\n\n return await self.request(\"GET\", *args, **kwargs)\n
"},{"location":"reference/utilities/requests/#roblox.utilities.requests.Requests.patch","title":"patch(*args, **kwargs)
async
","text":"Sends a PATCH request.
Returns:
Type DescriptionResponse
An HTTP response.
Source code inroblox/utilities/requests.py
async def patch(self, *args, **kwargs) -> Response:\n \"\"\"\n Sends a PATCH request.\n\n Returns:\n An HTTP response.\n \"\"\"\n\n return await self.request(\"PATCH\", *args, **kwargs)\n
"},{"location":"reference/utilities/requests/#roblox.utilities.requests.Requests.post","title":"post(*args, **kwargs)
async
","text":"Sends a POST request.
Returns:
Type DescriptionResponse
An HTTP response.
Source code inroblox/utilities/requests.py
async def post(self, *args, **kwargs) -> Response:\n \"\"\"\n Sends a POST request.\n\n Returns:\n An HTTP response.\n \"\"\"\n\n return await self.request(\"POST\", *args, **kwargs)\n
"},{"location":"reference/utilities/requests/#roblox.utilities.requests.Requests.put","title":"put(*args, **kwargs)
async
","text":"Sends a PATCH request.
Returns:
Type DescriptionResponse
An HTTP response.
Source code inroblox/utilities/requests.py
async def put(self, *args, **kwargs) -> Response:\n \"\"\"\n Sends a PATCH request.\n\n Returns:\n An HTTP response.\n \"\"\"\n\n return await self.request(\"PUT\", *args, **kwargs)\n
"},{"location":"reference/utilities/requests/#roblox.utilities.requests.Requests.request","title":"request(method, *args, **kwargs)
async
","text":"Parameters:
Name Type Description Defaultmethod
str
The request method.
requiredReturns:
Type DescriptionResponse
An HTTP response.
Source code inroblox/utilities/requests.py
async def request(self, method: str, *args, **kwargs) -> Response:\n \"\"\"\n Arguments:\n method: The request method.\n\n Returns:\n An HTTP response.\n \"\"\"\n\n handle_xcsrf_token = kwargs.pop(\"handle_xcsrf_token\", True)\n skip_roblox = kwargs.pop(\"skip_roblox\", False)\n\n response = await self.session.request(method, *args, **kwargs)\n\n if skip_roblox:\n return response\n\n method = method.lower()\n\n if handle_xcsrf_token and self.xcsrf_token_name in response.headers and _xcsrf_allowed_methods.get(method):\n self.session.headers[self.xcsrf_token_name] = response.headers[self.xcsrf_token_name]\n if response.status_code == 403: # Request failed, send it again\n response = await self.session.request(method, *args, **kwargs)\n\n if kwargs.get(\"stream\"):\n # Streamed responses should not be decoded, so we immediately return the response.\n return response\n\n if response.is_error:\n # Something went wrong, parse an error\n content_type = response.headers.get(\"Content-Type\")\n errors = None\n if content_type and content_type.startswith(\"application/json\"):\n data = None\n try:\n data = response.json()\n except JSONDecodeError:\n pass\n errors = data and data.get(\"errors\")\n\n exception = get_exception_from_status_code(response.status_code)(\n response=response,\n errors=errors\n )\n raise exception\n else:\n return response\n
"},{"location":"reference/utilities/types/","title":"types","text":"Contains types used internally by ro.py.
"},{"location":"reference/utilities/url/","title":"url","text":"This module contains functions and objects used internally by ro.py to generate URLs.
"},{"location":"reference/utilities/url/#roblox.utilities.url.URLGenerator","title":"URLGenerator
","text":"Generates URLs based on a chosen base URL.
Attributes:
Name Type Descriptionbase_url
The base URL.
Source code inroblox/utilities/url.py
class URLGenerator:\n \"\"\"\n Generates URLs based on a chosen base URL.\n\n Attributes:\n base_url: The base URL.\n \"\"\"\n\n def __init__(self, base_url: str):\n self.base_url = base_url\n\n def get_subdomain(self, subdomain: str, protocol: str = \"https\") -> str:\n \"\"\"\n Returns the full URL of a subdomain, given the base subdomain name.\n\n Arguments:\n subdomain: The URL subdomain.\n protocol: The URL protocol.\n \"\"\"\n return f\"{protocol}://{subdomain}.{self.base_url}\"\n\n def get_url(\n self,\n subdomain: str,\n path: str = \"\",\n base_url: str = None,\n protocol: str = \"https\",\n ) -> str:\n \"\"\"\n Returns a full URL, given a subdomain name, protocol, and path.\n\n Arguments:\n subdomain: The URL subdomain.\n protocol: The URL protocol.\n path: The URL path.\n base_url: The base URL.\n \"\"\"\n if base_url is None:\n base_url = self.base_url\n return f\"{protocol}://{subdomain}.{base_url}/{path}\"\n
"},{"location":"reference/utilities/url/#roblox.utilities.url.URLGenerator.get_subdomain","title":"get_subdomain(subdomain, protocol='https')
","text":"Returns the full URL of a subdomain, given the base subdomain name.
Parameters:
Name Type Description Defaultsubdomain
str
The URL subdomain.
requiredprotocol
str
The URL protocol.
'https'
Source code in roblox/utilities/url.py
def get_subdomain(self, subdomain: str, protocol: str = \"https\") -> str:\n \"\"\"\n Returns the full URL of a subdomain, given the base subdomain name.\n\n Arguments:\n subdomain: The URL subdomain.\n protocol: The URL protocol.\n \"\"\"\n return f\"{protocol}://{subdomain}.{self.base_url}\"\n
"},{"location":"reference/utilities/url/#roblox.utilities.url.URLGenerator.get_url","title":"get_url(subdomain, path='', base_url=None, protocol='https')
","text":"Returns a full URL, given a subdomain name, protocol, and path.
Parameters:
Name Type Description Defaultsubdomain
str
The URL subdomain.
requiredprotocol
str
The URL protocol.
'https'
path
str
The URL path.
''
base_url
str
The base URL.
None
Source code in roblox/utilities/url.py
def get_url(\n self,\n subdomain: str,\n path: str = \"\",\n base_url: str = None,\n protocol: str = \"https\",\n) -> str:\n \"\"\"\n Returns a full URL, given a subdomain name, protocol, and path.\n\n Arguments:\n subdomain: The URL subdomain.\n protocol: The URL protocol.\n path: The URL path.\n base_url: The base URL.\n \"\"\"\n if base_url is None:\n base_url = self.base_url\n return f\"{protocol}://{subdomain}.{base_url}/{path}\"\n
"},{"location":"tutorials/","title":"Tutorials","text":"This tutorial is intended for people building standalone applications. It expects basic Python knowledge but will explain almost everything you need to know to build. Make sure to read through the entire page instead of skimming it to ensure you don't miss anything important!
If at any point you are struggling to understand what to do, join the RoAPI Discord for help and support.
"},{"location":"tutorials/authentication/","title":"Authentication","text":"To authenticate our client, we need our .ROBLOSECURITY token. To learn about why we need this and how to get it, please see ROBLOSECURITY.
Once we have our token, we can add it to our client by passing it as the first parameter. Use the following code and replace TOKEN
with the .ROBLOSECURITY token grabbed earlier to authenticate your client.
from roblox import Client\nclient = Client(\"TOKEN\")\n
To test your token, replace the code in main()
with the following:
user = await client.get_authenticated_user()\nprint(\"ID:\", user.id)\nprint(\"Name:\", user.name)\n
If this raises an error, or the name and ID differ from what is expected, follow the instructions and try again. The issue with this structure is that it is not secure. It's easy to slip up and copy your code and accidentally send someone your token, and it makes it harder to collaborate on code with others."},{"location":"tutorials/authentication/#using-a-env-file","title":"Using a .env file","text":"To solve this problem, we'll create a separate file called .env
which will contain our token.
Your file should look like this, where TOKEN is the .ROBLOSECURITY token you grabbed earlier. .env
ROBLOXTOKEN=TOKEN\n
Place it in the same folder as your application's main file. Your file structure should look like this:
.\n\u251c\u2500 .env\n\u2514\u2500 main.py\n
Next, install the python-dotenv library with the following command:
$ pip install python-dotenv\n
Then, add these lines to the top of your code: import os\nfrom dotenv import load_dotenv\n
After that, replace the code where you generate your client with this: load_dotenv()\nclient = Client(os.getenv(\"ROBLOXTOKEN\"))\n
Test it with get_authenticated_user
and you should be all set! Finished code
main.pyimport asyncio\nimport os\nfrom dotenv import load_dotenv\nfrom roblox import Client\n\nload_dotenv()\n\nclient = Client(os.getenv(\"ROBLOXTOKEN\"))\n\nasync def main():\n user = await client.get_authenticated_user()\n print(\"ID:\", user.id)\n print(\"Name:\", user.name)\n\nasyncio.get_event_loop().run_until_complete(main())\n
"},{"location":"tutorials/bases/","title":"Bases","text":"Let's say you want to use ro.py to fetch the username history of a user, and you already know their user ID. You could do this:
user = await client.get_user(968108160)\nasync for username in user.username_history():\n print(username)\n
This code works, but it has an issue: we're sending an unnecessary request to Roblox. To explain why, let's take a look at what ro.py is doing behind the scenes in this code. - First, we call await client.get_user(2067807455)
. ro.py asks Roblox for information about the user with the ID 2067807455 and returns it as a User object. - Next, we iterate through user.username_history
. ro.py asks Roblox for the username history for user 2067807455 and returns it to you.
In this code, we call await client.get_user()
, but we don't use any user information, like user.name
or user.description
. We don't need to make this request!
ro.py lets you do this with the client.get_base_TYPE
functions. We'll can the client.get_base_user()
function to improve the code:
user = client.get_base_user(2067807455) # no await!\nasync for username in user.username_history():\n print(username)\n
Hint
In ro.py, all functions you await
or paginators you iterate through with async for
make at least one request internally. Notice how you need to await
the get_user
function, but not the get_base_user
function!
This works for other Roblox types as well, like groups and assets. For example, this code kicks a user from a group with only 1 request:
group = client.get_base_group(9695397)\nuser = client.get_base_user(2067807455)\nawait group.kick_user(user)\n
There's another technique we can use to optimize this example further. For functions that accept only one type, like kick_user
which always accepts a user, ro.py accepts bare user IDs:
group = client.get_base_group(9695397)\nawait group.kick_user(2067807455)\n
"},{"location":"tutorials/error-handling/","title":"Error handling","text":"You can import ro.py exceptions from the roblox.utilities.exceptions
module or from the main roblox
module:
from roblox.utilities.exceptions import InternalServerError\n# or\nfrom roblox import InternalServerError\n
"},{"location":"tutorials/error-handling/#client-errors","title":"Client errors","text":"All of the Client.get_TYPE()
methods, like get_user()
and get_group()
, raise their own exceptions.
client.get_asset()
AssetNotFound
client.get_badge()
BadgeNotFound
client.get_group()
GroupNotFound
client.get_place()
PlaceNotFound
client.get_plugin()
PluginNotFound
client.get_universe()
UniverseNotFound
client.get_user()
UserNotFound
client.get_user_by_username()
UserNotFound
Here is an example of catching one of these exceptions:
try:\n user = await client.get_user_by_username(\"InvalidUsername!!!\")\nexcept UserNotFound:\n print(\"Invalid username!\")\n
All of these exceptions are subclasses of ItemNotFound
, which you can use as a catch-all.
When Roblox returns an error, ro.py raises an HTTP exception.
For example, if we try to post a group shout to a group that we don't the necessary permissions in, Roblox stops us and returns a 401 Unauthorized
error:
group = await client.get_group(1)\nawait group.update_shout(\"Shout!\")\n
This code will raise an error like this: roblox.utilities.exceptions.Unauthorized: 401 Unauthorized: https://groups.roblox.com/v1/groups/1/status.\n\nErrors:\n 0: Authorization has been denied for this request.\n
You can catch this error as follows:: group = await client.get_group(1)\ntry:\n await group.update_shout(\"Shout!\")\n print(\"Shout updated.\")\nexcept Unauthorized:\n print(\"Not allowed to shout.\")\n
These are the different types of exceptions raised depending on the HTTP error code Roblox returns:
HTTP status code Exception 400BadRequest
401 Unauthorized
403 Forbidden
429 TooManyRequests
500 InternalServerError
All of these exceptions are subclasses of the HTTPException
error, which you can use as a catch-all. For other unrecognized error codes, ro.py will fallback to the default HTTPException
.
For all HTTP exceptions, ro.py exposes a response
attribute so you can get the response information:
group = await client.get_group(1)\ntry:\n await group.update_shout(\"Shout!\")\n print(\"Shout updated.\")\nexcept Unauthorized as exception:\n print(\"Not allowed to shout.\")\n print(\"URL:\", exception.response.url)\n
Roblox also returns extra error data, which is what you see in the default error message. We can access this with the .errors
attribute, which is a list of ResponseError
: group = await client.get_group(1)\ntry:\n await group.update_shout(\"Shout!\")\n print(\"Shout updated.\")\nexcept Unauthorized as exception:\n print(\"Not allowed to shout.\")\n if len(exception.errors) > 0:\n error = exception.errors[0]\n print(\"Reason:\", error.message)\n
"},{"location":"tutorials/get-started/","title":"Get started","text":"At the beginning of every ro.py application is the client. The client represents a Roblox session, and it's your gateway to everything in ro.py.
To initialize a client, import it from the roblox
module: main.py
from roblox import Client\nclient = Client()\n
We can use the client to get information from Roblox by calling await client.get_TYPE()
, where TYPE
is a Roblox datatype, like a user or group.
There's a problem, though: if we run the following code... main.py
from roblox import Client\nclient = Client()\nawait client.get_user(1)\n
...it'll raise an error like this: File \"...\", line 1\nSyntaxError: 'await' outside function\n
This is because ro.py, like many Python libraries, is based on asyncio, a builtin Python library that allows for concurrent code. In the case of ro.py, this means your app can do something, like process Discord bot commands, while ro.py waits for Roblox to respond, saving tons of time and preventing one slow function from slowing down the whole program. Neat!
This means we need to wrap our code in an asynchronous function and then run it with asyncio.run
, like so:
import asyncio\nfrom roblox import Client\nclient = Client()\n\nasync def main():\n await client.get_user(1)\n\nasyncio.run(main())\n
This is the basic structure of every simple ro.py application. More complicated apps might not work like this - for example, in a Discord bot, another library might already be handling the asyncio part for you - but for simple scripts, this is what you'll be doing.
Now the error is gone, but our code doesn't do anything yet. Let's try printing out some information about this user. Add these lines to the end of your main function:
main.pyprint(\"Name:\", user.name)\nprint(\"Display Name:\", user.display_name)\nprint(\"Description:\", user.description)\n
Great! We now have a program that prints out a user's name, display name, and description. This same basic concept works for other kinds of objects on Roblox, like groups. Try replacing the code in your main function with this:
group = await client.get_group(1)\nprint(\"Name:\", group.name)\nprint(\"Description:\", group.description)\n
To see a list of everything you can do with the client, see Client
in the Code Reference.
So far, we've been using ro.py unauthenticated. Basically, we aren't logged in to Roblox, which means we can't perform any actions, like updating our description, or access any sensitive information, like which game our friend is playing right now. Your next mission, if you choose to accept it, is authenticating your client.
"},{"location":"tutorials/pagination/","title":"Pagination","text":"Certain Roblox endpoints are paginated. This means that going through their data is kind of like flipping through the pages of a book - you start at page 1 and then you can move forwards or backwards until you reach the start or the end.
This can be annoying when all you want is \"every member in a group\" or \"the last 10 posts on a group wall\", so ro.py abstracts this away into an iterator that you can use to loop over your data.
As an example, the Client.user_search()
function takes in a keyword (like \"builderman\") and returns a PageIterator
which you can loop through to get the search results.
A simple async for
can loop through the data no problem:
async for user in client.user_search(\"builderman\"):\n print(user.name)\n
We can limit the amount of items returned using the max_items
argument: async for user in client.user_search(\"builderman\", max_items=10):\n print(user.name)\n
We can also use .items()
: async for user in client.user_search(\"builderman\").items(10):\n print(user.name)\n
"},{"location":"tutorials/pagination/#looping-through-pages","title":"Looping through pages","text":"If we want to instead loop through each page, we can use .pages()
:
async for page in client.user_search(\"builderman\").pages():\n print(\"Page:\")\n for user in page:\n print(f\"\\t{user.name}\")\n
The size of this page depends on the value of the page_size
argument. It can be either 10, 25, 50 or 100. Higher values mean you send less requests to get the same amount of data, however these requests will usually take longer. async for page in client.user_search(\"builderman\", page_size=100).pages():\n print(f\"Page with {len(page)} items:\")\n for user in page:\n print(f\"\\t{user.name}\")\n
"},{"location":"tutorials/pagination/#flattening-into-a-list","title":"Flattening into a list","text":"If we want to turn all of this data into one list, we can use flatten()
. Be careful, as this isn't ideal for large sets of data and may use more memory. Because we turn this iterator into a list, we can use a normal for loop now:
for user in await client.user_search(\"boatbomber\").flatten():\n print(user.name)\n
We can limit the amount of items in this list using the max_items
argument: for user in await client.user_search(\"builderman\", max_items=10).flatten():\n print(user.name)\n
We can also pass the value directly to .flatten()
: for user in await client.user_search(\"builderman\").flatten(10):\n print(user.name)\n
As the result is just a normal list, we can store it in a variable: users = await client.user_search(\"builderman\").flatten(10)\nprint(f\"{len(users)} items:\")\nfor user in users:\n print(f\"\\t{user.name}\")\n
"},{"location":"tutorials/pagination/#but-what-about-other-things","title":"But what about other things?","text":"Iterators aren't just used for searching for users. There are also various other things that use this same concept, including group wall posts. In this example, we get the first 10 posts on the \"Official Group of Roblox\" group:
group = await client.get_group(1200769)\nasync for post in group.get_wall_posts(max_items=10):\n print(post)\n
If instead we want the last 10 posts (as in the most recent posts) we can use the sort_order
argument: group = await client.get_group(1200769)\nasync for post in group.get_wall_posts(sort_order=SortOrder.Descending, max_items=10):\n print(post)\n
The SortOrder
object can be imported like this: from roblox.utilities.iterators import SortOrder\n
"},{"location":"tutorials/roblosecurity/","title":"ROBLOSECURITY","text":"When you log in on the Roblox website, you create a new session with a special identifier linked to it, and that token is stored on your computer as a cookie. Every single time your computer asks Roblox to do anything - for example, \"give me the name of this user\" - your computer also gives this token to Roblox, and it can look and see if that token is valid.
Let's say you're asking Roblox to give you a list of your friends. It'll look at that token and know who you are, and can use that to give you your friends list. When you log out, that token is invalidated. Even if the client holds on to the token, it won't be valid after logging out.
This token is called the .ROBLOSECURITY
token and you will need one to do anything that you need to be logged in to do on Roblox, including: - getting information about yourself (name, description, ID, etc) - changing avatar - getting friends list - playing games
Danger
You may have heard of this token before and have been told that you should never, under any circumstances, share this token with anyone - and this is true! This token does give an attacker access to your Roblox account. However, this doesn't mean they gain access to everything - over time, more and more things are being locked behind other verification methods, like 2-step verification. We recommend using an alternate account with only the permissions it needs to limit the destruction an attacker can do. Always enable 2-step verification!
The best way to authenticate your ro.py application is to log in to Roblox on the website and then taking the .ROBLOSECURITY token from there.
Warning
Pressing the \"Log out\" button on the Roblox website invalidates your token, so you should not press this button after grabbing your token. Instead, consider using a private or incognito window and closing it when you are done.
To grab your .ROBLOSECURITY cookie, log into your account on the Roblox website and follow the instructions below.
Chrome/Chromium-basedFirefoxYou can access the cookie by going to https://www.roblox.com/, pressing the padlock icon next to the URL in your browser, clicking the arrow next to roblox.com
, opening up the \"Cookies\" folder, clicking \".ROBLOSECURITY\", clicking on the \"Content\" text once, pressing Ctrl+A, and then pressing Ctrl+C (make sure not to double-click this field as you won't select the entire value!)
Alternatively, you can access the cookie by going to https://www.roblox.com/, pressing Ctrl+Shift+I to access the Developer Tools, navigating to the \"Application\" tab, opening up the arrow next to \"Cookies\" on the sidebar on the left, clicking the https://www.roblox.com
item underneath the Cookies button, and then copying the .ROBLOSECURITY token by double-clicking on the value and then hitting Ctrl+C.
You can access the cookie by going to https://www.roblox.com/ and pressing Shift+F9, pressing the \"Storage\" tab button on the top, opening up the \"Cookies\" section in the sidebar on the left, clicking the https://www.roblox.com
item underneath it, and then copying the .ROBLOSECURITY token by double-clicking on the value and then hitting Ctrl+C.
The client.thumbnails
attribute is a ThumbnailProvider
object which you can use to generate thumbnails. Below is a list of item types on Roblox and methods you can use to generate their thumbnails.
To generate avatar thumbnails, use the get_user_avatar_thumbnails()
method. The type
parameter is an AvatarThumbnailType
object, which you can import from roblox
or from roblox.thumbnails
. Do note that the size
parameter only allows certain sizes - see the docs for more details.
user = await client.get_user(2067807455)\nuser_thumbnails = await client.thumbnails.get_user_avatar_thumbnails(\n users=[user],\n type=AvatarThumbnailType.full_body,\n size=(420, 420)\n)\n\nif len(user_thumbnails) > 0:\n user_thumbnail = user_thumbnails[0]\n print(user_thumbnail.image_url)\n
thumbnails
is a list of Thumbnail
objects. We can read the first thumbnail (if it exists) and print out its URL.
To generate 3D avatar thumbnails, use the get_user_avatar_thumbnail_3d()
method and call get_3d_data()
on the resulting thumbnail.
user = await client.get_user(1)\nuser_3d_thumbnail = await client.thumbnails.get_user_avatar_thumbnail_3d(user)\nuser_3d_data = await user_3d_thumbnail.get_3d_data()\nprint(\"OBJ:\", user_3d_data.obj.get_url())\nprint(\"MTL:\", user_3d_data.mtl.get_url())\nprint(\"Textures:\")\nfor texture in user_3d_data.textures:\n print(texture.get_url())\n
threed_data
is a ThreeDThumbnail
object."},{"location":"tutorials/thumbnails/#groups","title":"Groups","text":"To generate group icons, use the get_group_icons()
method.
group = await client.get_group(9695397)\ngroup_icons = await client.thumbnails.get_group_icons(\n groups=[group],\n size=(150, 150)\n)\nif len(group_icons) > 0:\n group_icon = group_icons[0]\n print(group_icon.image_url)\n
"},{"location":"tutorials/thumbnails/#assets","title":"Assets","text":"To generate asset thumbnails, use the get_asset_thumbnails()
method.
asset = await client.get_asset(8100249026)\nasset_thumbnails = await client.thumbnails.get_asset_thumbnails(\n assets=[asset],\n size=(420, 420)\n)\nif len(asset_thumbnails) > 0:\n asset_thumbnail = asset_thumbnails[0]\n print(asset_thumbnail.image_url)\n
"},{"location":"tutorials/thumbnails/#3d-thumbnails_1","title":"3D thumbnails","text":"Note
Not all assets support 3D thumbnails. Most \"catalog\" assets do, excluding \"classic faces\", which have no 3D representation.
To generate 3D asset thumbnails, use the get_asset_thumbnail_3d()
method and call get_3d_data()
on the resulting thumbnail.
asset = await client.get_asset(151784320)\nasset_3d_thumbnail = await client.thumbnails.get_asset_thumbnail_3d(asset)\nasset_3d_data = await asset_3d_thumbnail.get_3d_data()\nprint(\"OBJ:\", asset_3d_data.obj.get_url())\nprint(\"MTL:\", asset_3d_data.mtl.get_url())\nprint(\"Textures:\")\nfor texture in asset_3d_data.textures:\n print(texture.get_url())\n
"},{"location":"tutorials/thumbnails/#places","title":"Places","text":"To generate place icons, use the get_place_icons()
method.
place = await client.get_place(8100260845)\nplace_thumbnails = await client.thumbnails.get_place_icons(\n places=[place],\n size=(512, 512)\n)\nif len(place_thumbnails) > 0:\n place_thumbnail = place_thumbnails[0]\n print(place_thumbnail.image_url)\n
"},{"location":"tutorials/thumbnails/#universes","title":"Universes","text":""},{"location":"tutorials/thumbnails/#icons","title":"Icons","text":"To generate universe icons, use theget_universe_icons()
method.
universe = await client.get_universe(3118067569)\nuniverse_icons = await client.thumbnails.get_universe_icons(\n universes=[universe],\n size=(512, 512)\n)\nif len(universe_icons) > 0:\n universe_icon = universe_icons[0]\n print(universe_icon.image_url)\n
"},{"location":"tutorials/thumbnails/#thumbnails_1","title":"Thumbnails","text":"To generate universe thumbnails, use the get_universe_thumbnails()
method. Because each universe can have multiple thumbnails, this method behaves differently.
universe = await client.get_universe(3118067569)\nuniverses_thumbnails = await client.thumbnails.get_universe_thumbnails(\n universes=[universe],\n size=(768, 432)\n)\nif len(universes_thumbnails) > 0:\n universe_thumbnails = universes_thumbnails[0]\n for universe_thumbnail in universe_thumbnails.thumbnails:\n print(universe_thumbnail.image_url)\n
"},{"location":"tutorials/thumbnails/#badges","title":"Badges","text":"To generate badge icons, use the get_badge_icons()
method.
badge = await client.get_badge(2124867793)\nbadge_icons = await client.thumbnails.get_badge_icons(\n badges=[badge],\n size=(150, 150)\n)\nif len(badge_icons) > 0:\n icon = badge_icons[0]\n print(icon.image_url)\n
"},{"location":"tutorials/thumbnails/#gamepasses","title":"Gamepasses","text":"To generate gamepass icons, use the get_gamepass_icons()
method. This example uses get_base_gamepass()
because there is no get_gamepass
method.
gamepass = client.get_base_gamepass(25421830)\ngamepass_icons = await client.thumbnails.get_gamepass_icons(\n gamepasses=[gamepass],\n size=(150, 150)\n)\nif len(gamepass_icons) > 0:\n icon = gamepass_icons[0]\n print(icon.image_url)\n
"}]}
\ No newline at end of file
+{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"","title":"Overview","text":"ro.py is an asynchronous, object-oriented wrapper for the Roblox web API.
"},{"location":"#features","title":"Features","text":"To install the latest stable version of ro.py, run the following command:
python3 -m pip install roblox\n
To install the latest unstable version of ro.py, install git-scm and run the following:
python3 -m pip install git+https://github.com/ro-py/ro.py.git\n
"},{"location":"#support","title":"Support","text":"The RoAPI Discord server provides support for ro.py in the #ro.py-support
channel.
Contains classes and functions related to the authenticated Roblox account. Not to be confused with users.py or the Account system.
"},{"location":"reference/account/#roblox.account.AccountProvider","title":"AccountProvider
","text":"Provides methods that control the authenticated user's account.
Source code inroblox/account.py
class AccountProvider:\n \"\"\"\n Provides methods that control the authenticated user's account.\n \"\"\"\n\n def __init__(self, client: Client):\n \"\"\"\n Arguments:\n client: The Client to be used when getting information on an account.\n \"\"\"\n self._client: Client = client\n\n async def get_birthday(self) -> date:\n \"\"\"\n Gets the authenticated user's birthday.\n\n Returns: \n The authenticated user's birthday.\n \"\"\"\n birthday_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"accountinformation\", \"v1/birthdate\")\n )\n birthday_data = birthday_response.json()\n return date(\n month=birthday_data[\"birthMonth\"],\n day=birthday_data[\"birthDay\"],\n year=birthday_data[\"birthYear\"]\n )\n\n async def set_birthday(\n self,\n birthday: date,\n password: str = None\n ):\n \"\"\"\n Changes the authenticated user's birthday.\n This endpoint *may* require your password, and requires an unlocked PIN.\n\n Arguments:\n birthday: A date object that represents the birthday to update the Client's account to.\n password: The password to the Client's account, this is required when changing the birthday.\n \"\"\"\n await self._client.requests.post(\n url=self._client.url_generator.get_url(\"accountinformation\", \"v1/birthdate\"),\n json={\n \"birthMonth\": birthday.month,\n \"birthDay\": birthday.day,\n \"birthYear\": birthday.year,\n \"password\": password\n }\n )\n\n async def get_description(self) -> string:\n \"\"\"\n Gets the authenticated user's description.\n\n Returns: \n The authenticated user's description.\n \"\"\"\n description_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"accountinformation\", \"v1/description\")\n )\n description_data = description_response.json()\n return description_data[\"description\"]\n\n async def set_description(\n self,\n description: string,\n ):\n \"\"\"\n Updates the authenticated user's description.\n This endpoint *may* require your token, and requires an unlocked PIN.\n\n Arguments:\n description: A string object that represents the description to update the Client's account to.\n \"\"\"\n await self._client.requests.post(\n url=self._client.url_generator.get_url(\"accountinformation\", \"v1/description\"),\n json={\n \"description\": description\n }\n )\n
"},{"location":"reference/account/#roblox.account.AccountProvider.__init__","title":"__init__(client)
","text":"Parameters:
Name Type Description Defaultclient
Client
The Client to be used when getting information on an account.
required Source code inroblox/account.py
def __init__(self, client: Client):\n \"\"\"\n Arguments:\n client: The Client to be used when getting information on an account.\n \"\"\"\n self._client: Client = client\n
"},{"location":"reference/account/#roblox.account.AccountProvider.get_birthday","title":"get_birthday()
async
","text":"Gets the authenticated user's birthday.
Returns:
Type Descriptiondate
The authenticated user's birthday.
Source code inroblox/account.py
async def get_birthday(self) -> date:\n \"\"\"\n Gets the authenticated user's birthday.\n\n Returns: \n The authenticated user's birthday.\n \"\"\"\n birthday_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"accountinformation\", \"v1/birthdate\")\n )\n birthday_data = birthday_response.json()\n return date(\n month=birthday_data[\"birthMonth\"],\n day=birthday_data[\"birthDay\"],\n year=birthday_data[\"birthYear\"]\n )\n
"},{"location":"reference/account/#roblox.account.AccountProvider.get_description","title":"get_description()
async
","text":"Gets the authenticated user's description.
Returns:
Type Descriptionstring
The authenticated user's description.
Source code inroblox/account.py
async def get_description(self) -> string:\n \"\"\"\n Gets the authenticated user's description.\n\n Returns: \n The authenticated user's description.\n \"\"\"\n description_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"accountinformation\", \"v1/description\")\n )\n description_data = description_response.json()\n return description_data[\"description\"]\n
"},{"location":"reference/account/#roblox.account.AccountProvider.set_birthday","title":"set_birthday(birthday, password=None)
async
","text":"Changes the authenticated user's birthday. This endpoint may require your password, and requires an unlocked PIN.
Parameters:
Name Type Description Defaultbirthday
date
A date object that represents the birthday to update the Client's account to.
requiredpassword
str
The password to the Client's account, this is required when changing the birthday.
None
Source code in roblox/account.py
async def set_birthday(\n self,\n birthday: date,\n password: str = None\n):\n \"\"\"\n Changes the authenticated user's birthday.\n This endpoint *may* require your password, and requires an unlocked PIN.\n\n Arguments:\n birthday: A date object that represents the birthday to update the Client's account to.\n password: The password to the Client's account, this is required when changing the birthday.\n \"\"\"\n await self._client.requests.post(\n url=self._client.url_generator.get_url(\"accountinformation\", \"v1/birthdate\"),\n json={\n \"birthMonth\": birthday.month,\n \"birthDay\": birthday.day,\n \"birthYear\": birthday.year,\n \"password\": password\n }\n )\n
"},{"location":"reference/account/#roblox.account.AccountProvider.set_description","title":"set_description(description)
async
","text":"Updates the authenticated user's description. This endpoint may require your token, and requires an unlocked PIN.
Parameters:
Name Type Description Defaultdescription
string
A string object that represents the description to update the Client's account to.
required Source code inroblox/account.py
async def set_description(\n self,\n description: string,\n):\n \"\"\"\n Updates the authenticated user's description.\n This endpoint *may* require your token, and requires an unlocked PIN.\n\n Arguments:\n description: A string object that represents the description to update the Client's account to.\n \"\"\"\n await self._client.requests.post(\n url=self._client.url_generator.get_url(\"accountinformation\", \"v1/description\"),\n json={\n \"description\": description\n }\n )\n
"},{"location":"reference/assets/","title":"assets","text":"This module contains classes intended to parse and deal with data from Roblox asset information endpoints.
"},{"location":"reference/assets/#roblox.assets.AssetType","title":"AssetType
","text":"Represents a Roblox asset type.
Attributes:
Name Type Descriptionid
int
Id of the Asset
name
Optional[str]
Name of the Asset
Source code inroblox/assets.py
class AssetType:\n \"\"\"\n Represents a Roblox asset type.\n\n Attributes:\n id: Id of the Asset\n name: Name of the Asset\n \"\"\"\n\n def __init__(self, type_id: int):\n \"\"\"\n Arguments:\n type_id: The AssetTypeID to instantiate this AssetType object with.\n This is used to determine the name of the AssetType.\n \"\"\"\n\n self.id: int = type_id\n self.name: Optional[str] = asset_type_names.get(type_id)\n\n def __repr__(self):\n return f\"<{self.__class__.__name__} id={self.id} name={self.name!r}>\"\n
"},{"location":"reference/assets/#roblox.assets.AssetType.__init__","title":"__init__(type_id)
","text":"Parameters:
Name Type Description Defaulttype_id
int
The AssetTypeID to instantiate this AssetType object with. This is used to determine the name of the AssetType.
required Source code inroblox/assets.py
def __init__(self, type_id: int):\n \"\"\"\n Arguments:\n type_id: The AssetTypeID to instantiate this AssetType object with.\n This is used to determine the name of the AssetType.\n \"\"\"\n\n self.id: int = type_id\n self.name: Optional[str] = asset_type_names.get(type_id)\n
"},{"location":"reference/assets/#roblox.assets.EconomyAsset","title":"EconomyAsset
","text":" Bases: BaseAsset
Represents a Roblox asset. It is intended to parse data from https://economy.roblox.com/v2/assets/ASSETID/details.
Attributes:
Name Type Descriptionid
int
Id of the Asset
product_id
int
Product id of the asset
name
str
Name of the Asset
description
str
Description of the Asset
type
AssetType
Type of the Asset
creator_type
CreatorType
Type of creator can be user or group see enum
creator
Union[PartialUser, AssetPartialGroup]
creator can be a user or group object
icon_image
BaseAsset
BaseAsset
created
datetime
When the asset was created
updated
datetime
When the asset was updated for the las time
price
Optional[int]
price of the asset
sales
int
amount of sales of the asset
is_new
bool
if the asset it new
is_for_sale
bool
if the asset is for sale
is_public_domain
bool
if the asset is public domain
is_limited
bool
if the asset is a limited item
is_limited_unique
bool
if the asset is a unique limited item
remaining
Optional[int]
How many items there are remaining if it is limited
minimum_membership_level
int
Minimum membership level required to buy item
content_rating_type_id
int
Unknown
sale_availability_locations
Unknown
Source code inroblox/assets.py
class EconomyAsset(BaseAsset):\n \"\"\"\n Represents a Roblox asset.\n It is intended to parse data from https://economy.roblox.com/v2/assets/ASSETID/details.\n\n Attributes:\n id: Id of the Asset\n product_id: Product id of the asset\n name: Name of the Asset\n description: Description of the Asset\n type: Type of the Asset\n creator_type: Type of creator can be user or group see enum\n creator: creator can be a user or group object\n icon_image: BaseAsset\n created: When the asset was created\n updated: When the asset was updated for the las time\n price: price of the asset\n sales: amount of sales of the asset\n is_new: if the asset it new\n is_for_sale: if the asset is for sale\n is_public_domain: if the asset is public domain\n is_limited: if the asset is a limited item\n is_limited_unique: if the asset is a unique limited item\n remaining: How many items there are remaining if it is limited\n minimum_membership_level: Minimum membership level required to buy item\n content_rating_type_id: Unknown\n sale_availability_locations: Unknown\n \"\"\"\n\n def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: The Client to be used when getting information on assets.\n data: The data from the request.\n \"\"\"\n super().__init__(client=client, asset_id=data[\"AssetId\"])\n\n self.product_type: Optional[str] = data[\"ProductType\"]\n self.id: int = data[\"AssetId\"]\n self.product_id: int = data[\"ProductId\"] # TODO: make this a BaseProduct\n self.name: str = data[\"Name\"]\n self.description: str = data[\"Description\"]\n self.type: AssetType = AssetType(type_id=data[\"AssetTypeId\"])\n\n self.creator_type: CreatorType = CreatorType(data[\"Creator\"][\"CreatorType\"])\n self.creator: Union[PartialUser, AssetPartialGroup]\n\n if self.creator_type == CreatorType.user:\n self.creator: PartialUser = PartialUser(client=client, data=data[\"Creator\"])\n elif self.creator_type == CreatorType.group:\n self.creator: AssetPartialGroup = AssetPartialGroup(client=client, data=data[\"Creator\"])\n\n self.icon_image: BaseAsset = BaseAsset(client=client, asset_id=data[\"IconImageAssetId\"])\n\n self.created: datetime = parse(data[\"Created\"])\n self.updated: datetime = parse(data[\"Updated\"])\n\n self.price: Optional[int] = data[\"PriceInRobux\"]\n self.sales: int = data[\"Sales\"]\n\n self.is_new: bool = data[\"IsNew\"]\n self.is_for_sale: bool = data[\"IsForSale\"]\n self.is_public_domain: bool = data[\"IsPublicDomain\"]\n self.is_limited: bool = data[\"IsLimited\"]\n self.is_limited_unique: bool = data[\"IsLimitedUnique\"]\n\n self.remaining: Optional[int] = data[\"Remaining\"]\n\n self.minimum_membership_level: int = data[\"MinimumMembershipLevel\"]\n self.content_rating_type_id: int = data[\"ContentRatingTypeId\"]\n self.sale_availability_locations = data[\"SaleAvailabilityLocations\"]\n
"},{"location":"reference/assets/#roblox.assets.EconomyAsset.__init__","title":"__init__(client, data)
","text":"Parameters:
Name Type Description Defaultclient
Client
The Client to be used when getting information on assets.
requireddata
dict
The data from the request.
required Source code inroblox/assets.py
def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: The Client to be used when getting information on assets.\n data: The data from the request.\n \"\"\"\n super().__init__(client=client, asset_id=data[\"AssetId\"])\n\n self.product_type: Optional[str] = data[\"ProductType\"]\n self.id: int = data[\"AssetId\"]\n self.product_id: int = data[\"ProductId\"] # TODO: make this a BaseProduct\n self.name: str = data[\"Name\"]\n self.description: str = data[\"Description\"]\n self.type: AssetType = AssetType(type_id=data[\"AssetTypeId\"])\n\n self.creator_type: CreatorType = CreatorType(data[\"Creator\"][\"CreatorType\"])\n self.creator: Union[PartialUser, AssetPartialGroup]\n\n if self.creator_type == CreatorType.user:\n self.creator: PartialUser = PartialUser(client=client, data=data[\"Creator\"])\n elif self.creator_type == CreatorType.group:\n self.creator: AssetPartialGroup = AssetPartialGroup(client=client, data=data[\"Creator\"])\n\n self.icon_image: BaseAsset = BaseAsset(client=client, asset_id=data[\"IconImageAssetId\"])\n\n self.created: datetime = parse(data[\"Created\"])\n self.updated: datetime = parse(data[\"Updated\"])\n\n self.price: Optional[int] = data[\"PriceInRobux\"]\n self.sales: int = data[\"Sales\"]\n\n self.is_new: bool = data[\"IsNew\"]\n self.is_for_sale: bool = data[\"IsForSale\"]\n self.is_public_domain: bool = data[\"IsPublicDomain\"]\n self.is_limited: bool = data[\"IsLimited\"]\n self.is_limited_unique: bool = data[\"IsLimitedUnique\"]\n\n self.remaining: Optional[int] = data[\"Remaining\"]\n\n self.minimum_membership_level: int = data[\"MinimumMembershipLevel\"]\n self.content_rating_type_id: int = data[\"ContentRatingTypeId\"]\n self.sale_availability_locations = data[\"SaleAvailabilityLocations\"]\n
"},{"location":"reference/badges/","title":"badges","text":"This module contains classes intended to parse and deal with data from Roblox badge information endpoints.
"},{"location":"reference/badges/#roblox.badges.Badge","title":"Badge
","text":" Bases: BaseBadge
Represents a badge from the API.
Attributes:
Name Type Descriptionid
int
The badge Id.
name
str
The name of the badge.
description
str
The badge description.
display_name
str
The localized name of the badge.
display_description
str
The localized badge description.
enabled
bool
Whether or not the badge is enabled.
icon
BaseAsset
The badge icon.
display_icon
BaseAsset
The localized badge icon.
created
datetime
When the badge was created.
updated
datetime
When the badge was updated.
statistics
BadgeStatistics
Badge award statistics.
awarding_universe
PartialUniverse
The universe the badge is being awarded from.
Source code inroblox/badges.py
class Badge(BaseBadge):\n \"\"\"\n Represents a badge from the API.\n\n Attributes:\n id: The badge Id.\n name: The name of the badge.\n description: The badge description.\n display_name: The localized name of the badge.\n display_description: The localized badge description.\n enabled: Whether or not the badge is enabled.\n icon: The badge icon.\n display_icon: The localized badge icon.\n created: When the badge was created.\n updated: When the badge was updated.\n statistics: Badge award statistics.\n awarding_universe: The universe the badge is being awarded from.\n \"\"\"\n\n def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: The Client to be used when getting information on badges.\n data: The data from the endpoint.\n \"\"\"\n self.id: int = data[\"id\"]\n\n super().__init__(client=client, badge_id=self.id)\n\n self.name: str = data[\"name\"]\n self.description: str = data[\"description\"]\n self.display_name: str = data[\"displayName\"]\n self.display_description: str = data[\"displayDescription\"]\n self.enabled: bool = data[\"enabled\"]\n self.icon: BaseAsset = BaseAsset(client=client, asset_id=data[\"iconImageId\"])\n self.display_icon: BaseAsset = BaseAsset(client=client, asset_id=data[\"displayIconImageId\"])\n self.created: datetime = parse(data[\"created\"])\n self.updated: datetime = parse(data[\"updated\"])\n\n self.statistics: BadgeStatistics = BadgeStatistics(data=data[\"statistics\"])\n self.awarding_universe: PartialUniverse = PartialUniverse(client=client, data=data[\"awardingUniverse\"])\n
"},{"location":"reference/badges/#roblox.badges.Badge.__init__","title":"__init__(client, data)
","text":"Parameters:
Name Type Description Defaultclient
Client
The Client to be used when getting information on badges.
requireddata
dict
The data from the endpoint.
required Source code inroblox/badges.py
def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: The Client to be used when getting information on badges.\n data: The data from the endpoint.\n \"\"\"\n self.id: int = data[\"id\"]\n\n super().__init__(client=client, badge_id=self.id)\n\n self.name: str = data[\"name\"]\n self.description: str = data[\"description\"]\n self.display_name: str = data[\"displayName\"]\n self.display_description: str = data[\"displayDescription\"]\n self.enabled: bool = data[\"enabled\"]\n self.icon: BaseAsset = BaseAsset(client=client, asset_id=data[\"iconImageId\"])\n self.display_icon: BaseAsset = BaseAsset(client=client, asset_id=data[\"displayIconImageId\"])\n self.created: datetime = parse(data[\"created\"])\n self.updated: datetime = parse(data[\"updated\"])\n\n self.statistics: BadgeStatistics = BadgeStatistics(data=data[\"statistics\"])\n self.awarding_universe: PartialUniverse = PartialUniverse(client=client, data=data[\"awardingUniverse\"])\n
"},{"location":"reference/badges/#roblox.badges.BadgeStatistics","title":"BadgeStatistics
","text":"Attributes:
Name Type Descriptionpast_day_awarded_count
int
How many instances of this badge were awarded in the last day.
awarded_count
int
How many instances of this badge have been awarded.
win_rate_percentage
int
Percentage of players who have joined the parent universe have been awarded this badge.
Source code inroblox/badges.py
class BadgeStatistics:\n \"\"\"\n Attributes:\n past_day_awarded_count: How many instances of this badge were awarded in the last day.\n awarded_count: How many instances of this badge have been awarded.\n win_rate_percentage: Percentage of players who have joined the parent universe have been awarded this badge.\n \"\"\"\n\n def __init__(self, data: dict):\n \"\"\"\n Arguments:\n data: The raw input data.\n \"\"\"\n self.past_day_awarded_count: int = data[\"pastDayAwardedCount\"]\n self.awarded_count: int = data[\"awardedCount\"]\n self.win_rate_percentage: int = data[\"winRatePercentage\"]\n\n def __repr__(self):\n return f\"<{self.__class__.__name__} past_day_awarded_count={self.past_day_awarded_count} awarded_count={self.awarded_count} win_rate_percentage={self.win_rate_percentage}>\"\n
"},{"location":"reference/badges/#roblox.badges.BadgeStatistics.__init__","title":"__init__(data)
","text":"Parameters:
Name Type Description Defaultdata
dict
The raw input data.
required Source code inroblox/badges.py
def __init__(self, data: dict):\n \"\"\"\n Arguments:\n data: The raw input data.\n \"\"\"\n self.past_day_awarded_count: int = data[\"pastDayAwardedCount\"]\n self.awarded_count: int = data[\"awardedCount\"]\n self.win_rate_percentage: int = data[\"winRatePercentage\"]\n
"},{"location":"reference/chat/","title":"chat","text":"Contains classes relating to the Roblox chat.
"},{"location":"reference/chat/#roblox.chat.ChatProvider","title":"ChatProvider
","text":"Provides information and data related to the Roblox chat system.
Source code inroblox/chat.py
class ChatProvider:\n \"\"\"\n Provides information and data related to the Roblox chat system.\n \"\"\"\n\n def __init__(self, client: Client):\n \"\"\"\n Arguments:\n client: The Client for getting information about chat.\n \"\"\"\n self._client: Client = client\n\n def __repr__(self):\n return f\"<{self.__class__.__name__}>\"\n\n async def get_unread_conversation_count(self) -> int:\n \"\"\"\n Gets the authenticated user's unread conversation count.\n\n Returns: \n The user's unread conversation count.\n \"\"\"\n unread_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"chat\", \"v2/get-unread-conversation-count\")\n )\n unread_data = unread_response.json()\n return unread_data[\"count\"]\n\n async def get_settings(self) -> ChatSettings:\n \"\"\"\n Gets the authenticated user's chat settings.\n\n Returns: \n The user's chat settings.\n \"\"\"\n settings_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"chat\", \"v2/chat-settings\")\n )\n settings_data = settings_response.json()\n return ChatSettings(data=settings_data)\n\n def get_user_conversations(self) -> PageNumberIterator:\n \"\"\"\n Gets the user's conversations.\n\n Returns: \n The user's conversations as a PageNumberIterator.\n \"\"\"\n return PageNumberIterator(\n client=self._client,\n url=self._client.url_generator.get_url(\"chat\", \"v2/get-user-conversations\"),\n handler=lambda client, data: Conversation(client=client, data=data)\n )\n
"},{"location":"reference/chat/#roblox.chat.ChatProvider.__init__","title":"__init__(client)
","text":"Parameters:
Name Type Description Defaultclient
Client
The Client for getting information about chat.
required Source code inroblox/chat.py
def __init__(self, client: Client):\n \"\"\"\n Arguments:\n client: The Client for getting information about chat.\n \"\"\"\n self._client: Client = client\n
"},{"location":"reference/chat/#roblox.chat.ChatProvider.get_settings","title":"get_settings()
async
","text":"Gets the authenticated user's chat settings.
Returns:
Type DescriptionChatSettings
The user's chat settings.
Source code inroblox/chat.py
async def get_settings(self) -> ChatSettings:\n \"\"\"\n Gets the authenticated user's chat settings.\n\n Returns: \n The user's chat settings.\n \"\"\"\n settings_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"chat\", \"v2/chat-settings\")\n )\n settings_data = settings_response.json()\n return ChatSettings(data=settings_data)\n
"},{"location":"reference/chat/#roblox.chat.ChatProvider.get_unread_conversation_count","title":"get_unread_conversation_count()
async
","text":"Gets the authenticated user's unread conversation count.
Returns:
Type Descriptionint
The user's unread conversation count.
Source code inroblox/chat.py
async def get_unread_conversation_count(self) -> int:\n \"\"\"\n Gets the authenticated user's unread conversation count.\n\n Returns: \n The user's unread conversation count.\n \"\"\"\n unread_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"chat\", \"v2/get-unread-conversation-count\")\n )\n unread_data = unread_response.json()\n return unread_data[\"count\"]\n
"},{"location":"reference/chat/#roblox.chat.ChatProvider.get_user_conversations","title":"get_user_conversations()
","text":"Gets the user's conversations.
Returns:
Type DescriptionPageNumberIterator
The user's conversations as a PageNumberIterator.
Source code inroblox/chat.py
def get_user_conversations(self) -> PageNumberIterator:\n \"\"\"\n Gets the user's conversations.\n\n Returns: \n The user's conversations as a PageNumberIterator.\n \"\"\"\n return PageNumberIterator(\n client=self._client,\n url=self._client.url_generator.get_url(\"chat\", \"v2/get-user-conversations\"),\n handler=lambda client, data: Conversation(client=client, data=data)\n )\n
"},{"location":"reference/chat/#roblox.chat.ChatSettings","title":"ChatSettings
","text":"Represents the authenticated user's Roblox chat settings.
Attributes:
Name Type Descriptionchat_enabled
bool
Whether chat is enabled for the user.
is_active_chat_user
bool
Whether the user is an active chat user. New accounts are active by default and become inactive if they do not send any messages over a period of time.
is_connect_tab_enabled
bool
Whether the Connect tab is enabled for this user.
Source code inroblox/chat.py
class ChatSettings:\n \"\"\"\n Represents the authenticated user's Roblox chat settings.\n\n Attributes:\n chat_enabled: Whether chat is enabled for the user.\n is_active_chat_user: Whether the user is an active chat user. New accounts are active by default and become\n inactive if they do not send any messages over a period of time.\n is_connect_tab_enabled: Whether the Connect tab is enabled for this user.\n \"\"\"\n\n def __init__(self, data: dict):\n \"\"\"\n Arguments:\n data: The raw input data.\n \"\"\"\n self.chat_enabled: bool = data[\"chatEnabled\"]\n self.is_active_chat_user: bool = data[\"isActiveChatUser\"]\n self.is_connect_tab_enabled: bool = data[\"isConnectTabEnabled\"]\n\n def __repr__(self):\n return f\"<{self.__class__.__name__} chat_enabled={self.chat_enabled} is_active_chat_user={self.is_active_chat_user} is_connect_tab_enabled={self.is_connect_tab_enabled}>\"\n
"},{"location":"reference/chat/#roblox.chat.ChatSettings.__init__","title":"__init__(data)
","text":"Parameters:
Name Type Description Defaultdata
dict
The raw input data.
required Source code inroblox/chat.py
def __init__(self, data: dict):\n \"\"\"\n Arguments:\n data: The raw input data.\n \"\"\"\n self.chat_enabled: bool = data[\"chatEnabled\"]\n self.is_active_chat_user: bool = data[\"isActiveChatUser\"]\n self.is_connect_tab_enabled: bool = data[\"isConnectTabEnabled\"]\n
"},{"location":"reference/client/","title":"client","text":"Contains the Client, which is the core object at the center of all ro.py applications.
"},{"location":"reference/client/#roblox.client.Client","title":"Client
","text":"Represents a Roblox client.
Attributes:
Name Type Descriptionrequests
Requests
The requests object, which is used to send requests to Roblox endpoints.
url_generator
URLGenerator
The URL generator object, which is used to generate URLs to send requests to endpoints.
presence
PresenceProvider
The presence provider object.
thumbnails
ThumbnailProvider
The thumbnail provider object.
delivery
DeliveryProvider
The delivery provider object.
chat
ChatProvider
The chat provider object.
account
AccountProvider
The account provider object.
Source code inroblox/client.py
class Client:\n \"\"\"\n Represents a Roblox client.\n\n Attributes:\n requests: The requests object, which is used to send requests to Roblox endpoints.\n url_generator: The URL generator object, which is used to generate URLs to send requests to endpoints.\n presence: The presence provider object.\n thumbnails: The thumbnail provider object.\n delivery: The delivery provider object.\n chat: The chat provider object.\n account: The account provider object.\n \"\"\"\n\n def __init__(self, token: str = None, base_url: str = \"roblox.com\"):\n \"\"\"\n Arguments:\n token: A .ROBLOSECURITY token to authenticate the client with.\n base_url: The base URL to use when sending requests.\n \"\"\"\n self._url_generator: URLGenerator = URLGenerator(base_url=base_url)\n self._requests: Requests = Requests()\n\n self.url_generator: URLGenerator = self._url_generator\n self.requests: Requests = self._requests\n\n self.presence: PresenceProvider = PresenceProvider(client=self)\n self.thumbnails: ThumbnailProvider = ThumbnailProvider(client=self)\n self.delivery: DeliveryProvider = DeliveryProvider(client=self)\n self.chat: ChatProvider = ChatProvider(client=self)\n self.account: AccountProvider = AccountProvider(client=self)\n\n if token:\n self.set_token(token)\n\n def __repr__(self):\n return f\"<{self.__class__.__name__}>\"\n\n # Authentication\n def set_token(self, token: Optional[str] = None) -> None:\n \"\"\"\n Authenticates the client with the passed .ROBLOSECURITY token.\n This method does not send any requests and will not throw if the token is invalid.\n\n Arguments:\n token: A .ROBLOSECURITY token to authenticate the client with.\n\n \"\"\"\n self._requests.session.cookies[\".ROBLOSECURITY\"] = token\n\n # Users\n async def get_user(self, user_id: int) -> User:\n \"\"\"\n Gets a user with the specified user ID.\n\n Arguments:\n user_id: A Roblox user ID.\n\n Returns:\n A user object.\n \"\"\"\n try:\n user_response = await self._requests.get(\n url=self.url_generator.get_url(\"users\", f\"v1/users/{user_id}\")\n )\n except NotFound as exception:\n raise UserNotFound(\n message=\"Invalid user.\",\n response=exception.response\n ) from None\n user_data = user_response.json()\n return User(client=self, data=user_data)\n\n async def get_authenticated_user(\n self, expand: bool = True\n ) -> Union[User, PartialUser]:\n \"\"\"\n Grabs the authenticated user.\n\n Arguments:\n expand: Whether to return a User (2 requests) rather than a PartialUser (1 request)\n\n Returns:\n The authenticated user.\n \"\"\"\n authenticated_user_response = await self._requests.get(\n url=self._url_generator.get_url(\"users\", f\"v1/users/authenticated\")\n )\n authenticated_user_data = authenticated_user_response.json()\n\n if expand:\n return await self.get_user(authenticated_user_data[\"id\"])\n else:\n return PartialUser(client=self, data=authenticated_user_data)\n\n async def get_users(\n self,\n user_ids: List[int],\n exclude_banned_users: bool = False,\n expand: bool = False,\n ) -> Union[List[PartialUser], List[User]]:\n \"\"\"\n Grabs a list of users corresponding to each user ID in the list.\n\n Arguments:\n user_ids: A list of Roblox user IDs.\n exclude_banned_users: Whether to exclude banned users from the data.\n expand: Whether to return a list of Users (2 requests) rather than PartialUsers (1 request)\n\n Returns:\n A List of Users or partial users.\n \"\"\"\n users_response = await self._requests.post(\n url=self._url_generator.get_url(\"users\", f\"v1/users\"),\n json={\"userIds\": user_ids, \"excludeBannedUsers\": exclude_banned_users},\n )\n users_data = users_response.json()[\"data\"]\n\n if expand:\n return [await self.get_user(user_data[\"id\"]) for user_data in users_data]\n else:\n return [\n PartialUser(client=self, data=user_data)\n for user_data in users_data\n ]\n\n async def get_users_by_usernames(\n self,\n usernames: List[str],\n exclude_banned_users: bool = False,\n expand: bool = False,\n ) -> Union[List[RequestedUsernamePartialUser], List[User]]:\n \"\"\"\n Grabs a list of users corresponding to each username in the list.\n\n Arguments:\n usernames: A list of Roblox usernames.\n exclude_banned_users: Whether to exclude banned users from the data.\n expand: Whether to return a list of Users (2 requests) rather than RequestedUsernamePartialUsers (1 request)\n\n Returns:\n A list of User or RequestedUsernamePartialUser, depending on the expand argument.\n \"\"\"\n users_response = await self._requests.post(\n url=self._url_generator.get_url(\"users\", f\"v1/usernames/users\"),\n json={\"usernames\": usernames, \"excludeBannedUsers\": exclude_banned_users},\n )\n users_data = users_response.json()[\"data\"]\n\n if expand:\n return [await self.get_user(user_data[\"id\"]) for user_data in users_data]\n else:\n return [\n RequestedUsernamePartialUser(client=self, data=user_data)\n for user_data in users_data\n ]\n\n async def get_user_by_username(\n self, username: str, exclude_banned_users: bool = False, expand: bool = True\n ) -> Union[RequestedUsernamePartialUser, User]:\n \"\"\"\n Grabs a user corresponding to the passed username.\n\n Arguments:\n username: A Roblox username.\n exclude_banned_users: Whether to exclude banned users from the data.\n expand: Whether to return a User (2 requests) rather than a RequestedUsernamePartialUser (1 request)\n\n Returns:\n A User or RequestedUsernamePartialUser depending on the expand argument.\n \"\"\"\n users = await self.get_users_by_usernames(\n usernames=[username],\n exclude_banned_users=exclude_banned_users,\n expand=expand,\n )\n try:\n return users[0]\n except IndexError:\n raise UserNotFound(\"Invalid username.\") from None\n\n def get_base_user(self, user_id: int) -> BaseUser:\n \"\"\"\n Gets a base user.\n\n !!! note\n This method does not send any requests - it just generates an object.\n For more information on bases, please see [Bases](../tutorials/bases.md).\n\n Arguments:\n user_id: A Roblox user ID.\n\n Returns:\n A BaseUser.\n \"\"\"\n return BaseUser(client=self, user_id=user_id)\n\n def user_search(self, keyword: str, page_size: int = 10,\n max_items: int = None) -> PageIterator:\n \"\"\"\n Search for users with a keyword.\n\n Arguments:\n keyword: A keyword to search for.\n page_size: How many members should be returned for each page.\n max_items: The maximum items to return when looping through this object.\n\n Returns:\n A PageIterator containing RequestedUsernamePartialUser.\n \"\"\"\n return PageIterator(\n client=self,\n url=self._url_generator.get_url(\"users\", f\"v1/users/search\"),\n page_size=page_size,\n max_items=max_items,\n extra_parameters={\"keyword\": keyword},\n handler=lambda client, data: PreviousUsernamesPartialUser(client=client, data=data),\n )\n\n # Groups\n async def get_group(self, group_id: int) -> Group:\n \"\"\"\n Gets a group by its ID.\n\n Arguments:\n group_id: A Roblox group ID.\n\n Returns:\n A Group.\n \"\"\"\n try:\n group_response = await self._requests.get(\n url=self._url_generator.get_url(\"groups\", f\"v1/groups/{group_id}\")\n )\n except BadRequest as exception:\n raise GroupNotFound(\n message=\"Invalid group.\",\n response=exception.response\n ) from None\n group_data = group_response.json()\n return Group(client=self, data=group_data)\n\n def get_base_group(self, group_id: int) -> BaseGroup:\n \"\"\"\n Gets a base group.\n\n !!! note\n This method does not send any requests - it just generates an object.\n For more information on bases, please see [Bases](../tutorials/bases.md).\n\n Arguments:\n group_id: A Roblox group ID.\n\n Returns:\n A BaseGroup.\n \"\"\"\n return BaseGroup(client=self, group_id=group_id)\n\n # Universes\n async def get_universes(self, universe_ids: List[int]) -> List[Universe]:\n \"\"\"\n Grabs a list of universes corresponding to each ID in the list.\n\n Arguments:\n universe_ids: A list of Roblox universe IDs.\n\n Returns:\n A list of Universes.\n \"\"\"\n universes_response = await self._requests.get(\n url=self._url_generator.get_url(\"games\", \"v1/games\"),\n params={\"universeIds\": universe_ids},\n )\n universes_data = universes_response.json()[\"data\"]\n return [\n Universe(client=self, data=universe_data)\n for universe_data in universes_data\n ]\n\n async def get_universe(self, universe_id: int) -> Universe:\n \"\"\"\n Gets a universe with the passed ID.\n\n Arguments:\n universe_id: A Roblox universe ID.\n\n Returns:\n A Universe.\n \"\"\"\n universes = await self.get_universes(universe_ids=[universe_id])\n try:\n return universes[0]\n except IndexError:\n raise UniverseNotFound(\"Invalid universe.\") from None\n\n def get_base_universe(self, universe_id: int) -> BaseUniverse:\n \"\"\"\n Gets a base universe.\n\n !!! note\n This method does not send any requests - it just generates an object.\n For more information on bases, please see [Bases](../tutorials/bases.md).\n\n Arguments:\n universe_id: A Roblox universe ID.\n\n Returns:\n A BaseUniverse.\n \"\"\"\n return BaseUniverse(client=self, universe_id=universe_id)\n\n # Places\n async def get_places(self, place_ids: List[int]) -> List[Place]:\n \"\"\"\n Grabs a list of places corresponding to each ID in the list.\n\n Arguments:\n place_ids: A list of Roblox place IDs.\n\n Returns:\n A list of Places.\n \"\"\"\n places_response = await self._requests.get(\n url=self._url_generator.get_url(\n \"games\", f\"v1/games/multiget-place-details\"\n ),\n params={\"placeIds\": place_ids},\n )\n places_data = places_response.json()\n return [\n Place(client=self, data=place_data) for place_data in places_data\n ]\n\n async def get_place(self, place_id: int) -> Place:\n \"\"\"\n Gets a place with the passed ID.\n\n Arguments:\n place_id: A Roblox place ID.\n\n Returns:\n A Place.\n \"\"\"\n places = await self.get_places(place_ids=[place_id])\n try:\n return places[0]\n except IndexError:\n raise PlaceNotFound(\"Invalid place.\") from None\n\n def get_base_place(self, place_id: int) -> BasePlace:\n \"\"\"\n Gets a base place.\n\n !!! note\n This method does not send any requests - it just generates an object.\n For more information on bases, please see [Bases](../tutorials/bases.md).\n\n Arguments:\n place_id: A Roblox place ID.\n\n Returns:\n A BasePlace.\n \"\"\"\n return BasePlace(client=self, place_id=place_id)\n\n # Assets\n async def get_asset(self, asset_id: int) -> EconomyAsset:\n \"\"\"\n Gets an asset with the passed ID.\n\n Arguments:\n asset_id: A Roblox asset ID.\n\n Returns:\n An Asset.\n \"\"\"\n try:\n asset_response = await self._requests.get(\n url=self._url_generator.get_url(\n \"economy\", f\"v2/assets/{asset_id}/details\"\n )\n )\n except BadRequest as exception:\n raise AssetNotFound(\n message=\"Invalid asset.\",\n response=exception.response\n ) from None\n asset_data = asset_response.json()\n return EconomyAsset(client=self, data=asset_data)\n\n def get_base_asset(self, asset_id: int) -> BaseAsset:\n \"\"\"\n Gets a base asset.\n\n !!! note\n This method does not send any requests - it just generates an object.\n For more information on bases, please see [Bases](../tutorials/bases.md).\n\n Arguments:\n asset_id: A Roblox asset ID.\n\n Returns:\n A BaseAsset.\n \"\"\"\n return BaseAsset(client=self, asset_id=asset_id)\n\n # Plugins\n async def get_plugins(self, plugin_ids: List[int]) -> List[Plugin]:\n \"\"\"\n Grabs a list of plugins corresponding to each ID in the list.\n\n Arguments:\n plugin_ids: A list of Roblox plugin IDs.\n\n Returns:\n A list of Plugins.\n \"\"\"\n plugins_response = await self._requests.get(\n url=self._url_generator.get_url(\n \"develop\", \"v1/plugins\"\n ),\n params={\n \"pluginIds\": plugin_ids\n }\n )\n plugins_data = plugins_response.json()[\"data\"]\n return [Plugin(client=self, data=plugin_data) for plugin_data in plugins_data]\n\n async def get_plugin(self, plugin_id: int) -> Plugin:\n \"\"\"\n Grabs a plugin with the passed ID.\n\n Arguments:\n plugin_id: A Roblox plugin ID.\n\n Returns:\n A Plugin.\n \"\"\"\n plugins = await self.get_plugins([plugin_id])\n try:\n return plugins[0]\n except IndexError:\n raise PluginNotFound(\"Invalid plugin.\") from None\n\n def get_base_plugin(self, plugin_id: int) -> BasePlugin:\n \"\"\"\n Gets a base plugin.\n\n !!! note\n This method does not send any requests - it just generates an object.\n For more information on bases, please see [Bases](../tutorials/bases.md).\n\n Arguments:\n plugin_id: A Roblox plugin ID.\n\n Returns:\n A BasePlugin.\n \"\"\"\n return BasePlugin(client=self, plugin_id=plugin_id)\n\n # Badges\n async def get_badge(self, badge_id: int) -> Badge:\n \"\"\"\n Gets a badge with the passed ID.\n\n Arguments:\n badge_id: A Roblox badge ID.\n\n Returns:\n A Badge.\n \"\"\"\n try:\n badge_response = await self._requests.get(\n url=self._url_generator.get_url(\n \"badges\", f\"v1/badges/{badge_id}\"\n )\n )\n except NotFound as exception:\n raise BadgeNotFound(\n message=\"Invalid badge.\",\n response=exception.response\n ) from None\n badge_data = badge_response.json()\n return Badge(client=self, data=badge_data)\n\n def get_base_badge(self, badge_id: int) -> BaseBadge:\n \"\"\"\n Gets a base badge.\n\n !!! note\n This method does not send any requests - it just generates an object.\n For more information on bases, please see [Bases](../tutorials/bases.md).\n\n Arguments:\n badge_id: A Roblox badge ID.\n\n Returns:\n A BaseBadge.\n \"\"\"\n return BaseBadge(client=self, badge_id=badge_id)\n\n # Gamepasses\n def get_base_gamepass(self, gamepass_id: int) -> BaseGamePass:\n \"\"\"\n Gets a base gamepass.\n\n !!! note\n This method does not send any requests - it just generates an object.\n For more information on bases, please see [Bases](../tutorials/bases.md).\n\n Arguments:\n gamepass_id: A Roblox gamepass ID.\n\n Returns: A BaseGamePass.\n \"\"\"\n return BaseGamePass(client=self, gamepass_id=gamepass_id)\n
"},{"location":"reference/client/#roblox.client.Client.__init__","title":"__init__(token=None, base_url='roblox.com')
","text":"Parameters:
Name Type Description Defaulttoken
str
A .ROBLOSECURITY token to authenticate the client with.
None
base_url
str
The base URL to use when sending requests.
'roblox.com'
Source code in roblox/client.py
def __init__(self, token: str = None, base_url: str = \"roblox.com\"):\n \"\"\"\n Arguments:\n token: A .ROBLOSECURITY token to authenticate the client with.\n base_url: The base URL to use when sending requests.\n \"\"\"\n self._url_generator: URLGenerator = URLGenerator(base_url=base_url)\n self._requests: Requests = Requests()\n\n self.url_generator: URLGenerator = self._url_generator\n self.requests: Requests = self._requests\n\n self.presence: PresenceProvider = PresenceProvider(client=self)\n self.thumbnails: ThumbnailProvider = ThumbnailProvider(client=self)\n self.delivery: DeliveryProvider = DeliveryProvider(client=self)\n self.chat: ChatProvider = ChatProvider(client=self)\n self.account: AccountProvider = AccountProvider(client=self)\n\n if token:\n self.set_token(token)\n
"},{"location":"reference/client/#roblox.client.Client.get_asset","title":"get_asset(asset_id)
async
","text":"Gets an asset with the passed ID.
Parameters:
Name Type Description Defaultasset_id
int
A Roblox asset ID.
requiredReturns:
Type DescriptionEconomyAsset
An Asset.
Source code inroblox/client.py
async def get_asset(self, asset_id: int) -> EconomyAsset:\n \"\"\"\n Gets an asset with the passed ID.\n\n Arguments:\n asset_id: A Roblox asset ID.\n\n Returns:\n An Asset.\n \"\"\"\n try:\n asset_response = await self._requests.get(\n url=self._url_generator.get_url(\n \"economy\", f\"v2/assets/{asset_id}/details\"\n )\n )\n except BadRequest as exception:\n raise AssetNotFound(\n message=\"Invalid asset.\",\n response=exception.response\n ) from None\n asset_data = asset_response.json()\n return EconomyAsset(client=self, data=asset_data)\n
"},{"location":"reference/client/#roblox.client.Client.get_authenticated_user","title":"get_authenticated_user(expand=True)
async
","text":"Grabs the authenticated user.
Parameters:
Name Type Description Defaultexpand
bool
Whether to return a User (2 requests) rather than a PartialUser (1 request)
True
Returns:
Type DescriptionUnion[User, PartialUser]
The authenticated user.
Source code inroblox/client.py
async def get_authenticated_user(\n self, expand: bool = True\n) -> Union[User, PartialUser]:\n \"\"\"\n Grabs the authenticated user.\n\n Arguments:\n expand: Whether to return a User (2 requests) rather than a PartialUser (1 request)\n\n Returns:\n The authenticated user.\n \"\"\"\n authenticated_user_response = await self._requests.get(\n url=self._url_generator.get_url(\"users\", f\"v1/users/authenticated\")\n )\n authenticated_user_data = authenticated_user_response.json()\n\n if expand:\n return await self.get_user(authenticated_user_data[\"id\"])\n else:\n return PartialUser(client=self, data=authenticated_user_data)\n
"},{"location":"reference/client/#roblox.client.Client.get_badge","title":"get_badge(badge_id)
async
","text":"Gets a badge with the passed ID.
Parameters:
Name Type Description Defaultbadge_id
int
A Roblox badge ID.
requiredReturns:
Type DescriptionBadge
A Badge.
Source code inroblox/client.py
async def get_badge(self, badge_id: int) -> Badge:\n \"\"\"\n Gets a badge with the passed ID.\n\n Arguments:\n badge_id: A Roblox badge ID.\n\n Returns:\n A Badge.\n \"\"\"\n try:\n badge_response = await self._requests.get(\n url=self._url_generator.get_url(\n \"badges\", f\"v1/badges/{badge_id}\"\n )\n )\n except NotFound as exception:\n raise BadgeNotFound(\n message=\"Invalid badge.\",\n response=exception.response\n ) from None\n badge_data = badge_response.json()\n return Badge(client=self, data=badge_data)\n
"},{"location":"reference/client/#roblox.client.Client.get_base_asset","title":"get_base_asset(asset_id)
","text":"Gets a base asset.
Note
This method does not send any requests - it just generates an object. For more information on bases, please see Bases.
Parameters:
Name Type Description Defaultasset_id
int
A Roblox asset ID.
requiredReturns:
Type DescriptionBaseAsset
A BaseAsset.
Source code inroblox/client.py
def get_base_asset(self, asset_id: int) -> BaseAsset:\n \"\"\"\n Gets a base asset.\n\n !!! note\n This method does not send any requests - it just generates an object.\n For more information on bases, please see [Bases](../tutorials/bases.md).\n\n Arguments:\n asset_id: A Roblox asset ID.\n\n Returns:\n A BaseAsset.\n \"\"\"\n return BaseAsset(client=self, asset_id=asset_id)\n
"},{"location":"reference/client/#roblox.client.Client.get_base_badge","title":"get_base_badge(badge_id)
","text":"Gets a base badge.
Note
This method does not send any requests - it just generates an object. For more information on bases, please see Bases.
Parameters:
Name Type Description Defaultbadge_id
int
A Roblox badge ID.
requiredReturns:
Type DescriptionBaseBadge
A BaseBadge.
Source code inroblox/client.py
def get_base_badge(self, badge_id: int) -> BaseBadge:\n \"\"\"\n Gets a base badge.\n\n !!! note\n This method does not send any requests - it just generates an object.\n For more information on bases, please see [Bases](../tutorials/bases.md).\n\n Arguments:\n badge_id: A Roblox badge ID.\n\n Returns:\n A BaseBadge.\n \"\"\"\n return BaseBadge(client=self, badge_id=badge_id)\n
"},{"location":"reference/client/#roblox.client.Client.get_base_gamepass","title":"get_base_gamepass(gamepass_id)
","text":"Gets a base gamepass.
Note
This method does not send any requests - it just generates an object. For more information on bases, please see Bases.
Parameters:
Name Type Description Defaultgamepass_id
int
A Roblox gamepass ID.
required Source code inroblox/client.py
def get_base_gamepass(self, gamepass_id: int) -> BaseGamePass:\n \"\"\"\n Gets a base gamepass.\n\n !!! note\n This method does not send any requests - it just generates an object.\n For more information on bases, please see [Bases](../tutorials/bases.md).\n\n Arguments:\n gamepass_id: A Roblox gamepass ID.\n\n Returns: A BaseGamePass.\n \"\"\"\n return BaseGamePass(client=self, gamepass_id=gamepass_id)\n
"},{"location":"reference/client/#roblox.client.Client.get_base_group","title":"get_base_group(group_id)
","text":"Gets a base group.
Note
This method does not send any requests - it just generates an object. For more information on bases, please see Bases.
Parameters:
Name Type Description Defaultgroup_id
int
A Roblox group ID.
requiredReturns:
Type DescriptionBaseGroup
A BaseGroup.
Source code inroblox/client.py
def get_base_group(self, group_id: int) -> BaseGroup:\n \"\"\"\n Gets a base group.\n\n !!! note\n This method does not send any requests - it just generates an object.\n For more information on bases, please see [Bases](../tutorials/bases.md).\n\n Arguments:\n group_id: A Roblox group ID.\n\n Returns:\n A BaseGroup.\n \"\"\"\n return BaseGroup(client=self, group_id=group_id)\n
"},{"location":"reference/client/#roblox.client.Client.get_base_place","title":"get_base_place(place_id)
","text":"Gets a base place.
Note
This method does not send any requests - it just generates an object. For more information on bases, please see Bases.
Parameters:
Name Type Description Defaultplace_id
int
A Roblox place ID.
requiredReturns:
Type DescriptionBasePlace
A BasePlace.
Source code inroblox/client.py
def get_base_place(self, place_id: int) -> BasePlace:\n \"\"\"\n Gets a base place.\n\n !!! note\n This method does not send any requests - it just generates an object.\n For more information on bases, please see [Bases](../tutorials/bases.md).\n\n Arguments:\n place_id: A Roblox place ID.\n\n Returns:\n A BasePlace.\n \"\"\"\n return BasePlace(client=self, place_id=place_id)\n
"},{"location":"reference/client/#roblox.client.Client.get_base_plugin","title":"get_base_plugin(plugin_id)
","text":"Gets a base plugin.
Note
This method does not send any requests - it just generates an object. For more information on bases, please see Bases.
Parameters:
Name Type Description Defaultplugin_id
int
A Roblox plugin ID.
requiredReturns:
Type DescriptionBasePlugin
A BasePlugin.
Source code inroblox/client.py
def get_base_plugin(self, plugin_id: int) -> BasePlugin:\n \"\"\"\n Gets a base plugin.\n\n !!! note\n This method does not send any requests - it just generates an object.\n For more information on bases, please see [Bases](../tutorials/bases.md).\n\n Arguments:\n plugin_id: A Roblox plugin ID.\n\n Returns:\n A BasePlugin.\n \"\"\"\n return BasePlugin(client=self, plugin_id=plugin_id)\n
"},{"location":"reference/client/#roblox.client.Client.get_base_universe","title":"get_base_universe(universe_id)
","text":"Gets a base universe.
Note
This method does not send any requests - it just generates an object. For more information on bases, please see Bases.
Parameters:
Name Type Description Defaultuniverse_id
int
A Roblox universe ID.
requiredReturns:
Type DescriptionBaseUniverse
A BaseUniverse.
Source code inroblox/client.py
def get_base_universe(self, universe_id: int) -> BaseUniverse:\n \"\"\"\n Gets a base universe.\n\n !!! note\n This method does not send any requests - it just generates an object.\n For more information on bases, please see [Bases](../tutorials/bases.md).\n\n Arguments:\n universe_id: A Roblox universe ID.\n\n Returns:\n A BaseUniverse.\n \"\"\"\n return BaseUniverse(client=self, universe_id=universe_id)\n
"},{"location":"reference/client/#roblox.client.Client.get_base_user","title":"get_base_user(user_id)
","text":"Gets a base user.
Note
This method does not send any requests - it just generates an object. For more information on bases, please see Bases.
Parameters:
Name Type Description Defaultuser_id
int
A Roblox user ID.
requiredReturns:
Type DescriptionBaseUser
A BaseUser.
Source code inroblox/client.py
def get_base_user(self, user_id: int) -> BaseUser:\n \"\"\"\n Gets a base user.\n\n !!! note\n This method does not send any requests - it just generates an object.\n For more information on bases, please see [Bases](../tutorials/bases.md).\n\n Arguments:\n user_id: A Roblox user ID.\n\n Returns:\n A BaseUser.\n \"\"\"\n return BaseUser(client=self, user_id=user_id)\n
"},{"location":"reference/client/#roblox.client.Client.get_group","title":"get_group(group_id)
async
","text":"Gets a group by its ID.
Parameters:
Name Type Description Defaultgroup_id
int
A Roblox group ID.
requiredReturns:
Type DescriptionGroup
A Group.
Source code inroblox/client.py
async def get_group(self, group_id: int) -> Group:\n \"\"\"\n Gets a group by its ID.\n\n Arguments:\n group_id: A Roblox group ID.\n\n Returns:\n A Group.\n \"\"\"\n try:\n group_response = await self._requests.get(\n url=self._url_generator.get_url(\"groups\", f\"v1/groups/{group_id}\")\n )\n except BadRequest as exception:\n raise GroupNotFound(\n message=\"Invalid group.\",\n response=exception.response\n ) from None\n group_data = group_response.json()\n return Group(client=self, data=group_data)\n
"},{"location":"reference/client/#roblox.client.Client.get_place","title":"get_place(place_id)
async
","text":"Gets a place with the passed ID.
Parameters:
Name Type Description Defaultplace_id
int
A Roblox place ID.
requiredReturns:
Type DescriptionPlace
A Place.
Source code inroblox/client.py
async def get_place(self, place_id: int) -> Place:\n \"\"\"\n Gets a place with the passed ID.\n\n Arguments:\n place_id: A Roblox place ID.\n\n Returns:\n A Place.\n \"\"\"\n places = await self.get_places(place_ids=[place_id])\n try:\n return places[0]\n except IndexError:\n raise PlaceNotFound(\"Invalid place.\") from None\n
"},{"location":"reference/client/#roblox.client.Client.get_places","title":"get_places(place_ids)
async
","text":"Grabs a list of places corresponding to each ID in the list.
Parameters:
Name Type Description Defaultplace_ids
List[int]
A list of Roblox place IDs.
requiredReturns:
Type DescriptionList[Place]
A list of Places.
Source code inroblox/client.py
async def get_places(self, place_ids: List[int]) -> List[Place]:\n \"\"\"\n Grabs a list of places corresponding to each ID in the list.\n\n Arguments:\n place_ids: A list of Roblox place IDs.\n\n Returns:\n A list of Places.\n \"\"\"\n places_response = await self._requests.get(\n url=self._url_generator.get_url(\n \"games\", f\"v1/games/multiget-place-details\"\n ),\n params={\"placeIds\": place_ids},\n )\n places_data = places_response.json()\n return [\n Place(client=self, data=place_data) for place_data in places_data\n ]\n
"},{"location":"reference/client/#roblox.client.Client.get_plugin","title":"get_plugin(plugin_id)
async
","text":"Grabs a plugin with the passed ID.
Parameters:
Name Type Description Defaultplugin_id
int
A Roblox plugin ID.
requiredReturns:
Type DescriptionPlugin
A Plugin.
Source code inroblox/client.py
async def get_plugin(self, plugin_id: int) -> Plugin:\n \"\"\"\n Grabs a plugin with the passed ID.\n\n Arguments:\n plugin_id: A Roblox plugin ID.\n\n Returns:\n A Plugin.\n \"\"\"\n plugins = await self.get_plugins([plugin_id])\n try:\n return plugins[0]\n except IndexError:\n raise PluginNotFound(\"Invalid plugin.\") from None\n
"},{"location":"reference/client/#roblox.client.Client.get_plugins","title":"get_plugins(plugin_ids)
async
","text":"Grabs a list of plugins corresponding to each ID in the list.
Parameters:
Name Type Description Defaultplugin_ids
List[int]
A list of Roblox plugin IDs.
requiredReturns:
Type DescriptionList[Plugin]
A list of Plugins.
Source code inroblox/client.py
async def get_plugins(self, plugin_ids: List[int]) -> List[Plugin]:\n \"\"\"\n Grabs a list of plugins corresponding to each ID in the list.\n\n Arguments:\n plugin_ids: A list of Roblox plugin IDs.\n\n Returns:\n A list of Plugins.\n \"\"\"\n plugins_response = await self._requests.get(\n url=self._url_generator.get_url(\n \"develop\", \"v1/plugins\"\n ),\n params={\n \"pluginIds\": plugin_ids\n }\n )\n plugins_data = plugins_response.json()[\"data\"]\n return [Plugin(client=self, data=plugin_data) for plugin_data in plugins_data]\n
"},{"location":"reference/client/#roblox.client.Client.get_universe","title":"get_universe(universe_id)
async
","text":"Gets a universe with the passed ID.
Parameters:
Name Type Description Defaultuniverse_id
int
A Roblox universe ID.
requiredReturns:
Type DescriptionUniverse
A Universe.
Source code inroblox/client.py
async def get_universe(self, universe_id: int) -> Universe:\n \"\"\"\n Gets a universe with the passed ID.\n\n Arguments:\n universe_id: A Roblox universe ID.\n\n Returns:\n A Universe.\n \"\"\"\n universes = await self.get_universes(universe_ids=[universe_id])\n try:\n return universes[0]\n except IndexError:\n raise UniverseNotFound(\"Invalid universe.\") from None\n
"},{"location":"reference/client/#roblox.client.Client.get_universes","title":"get_universes(universe_ids)
async
","text":"Grabs a list of universes corresponding to each ID in the list.
Parameters:
Name Type Description Defaultuniverse_ids
List[int]
A list of Roblox universe IDs.
requiredReturns:
Type DescriptionList[Universe]
A list of Universes.
Source code inroblox/client.py
async def get_universes(self, universe_ids: List[int]) -> List[Universe]:\n \"\"\"\n Grabs a list of universes corresponding to each ID in the list.\n\n Arguments:\n universe_ids: A list of Roblox universe IDs.\n\n Returns:\n A list of Universes.\n \"\"\"\n universes_response = await self._requests.get(\n url=self._url_generator.get_url(\"games\", \"v1/games\"),\n params={\"universeIds\": universe_ids},\n )\n universes_data = universes_response.json()[\"data\"]\n return [\n Universe(client=self, data=universe_data)\n for universe_data in universes_data\n ]\n
"},{"location":"reference/client/#roblox.client.Client.get_user","title":"get_user(user_id)
async
","text":"Gets a user with the specified user ID.
Parameters:
Name Type Description Defaultuser_id
int
A Roblox user ID.
requiredReturns:
Type DescriptionUser
A user object.
Source code inroblox/client.py
async def get_user(self, user_id: int) -> User:\n \"\"\"\n Gets a user with the specified user ID.\n\n Arguments:\n user_id: A Roblox user ID.\n\n Returns:\n A user object.\n \"\"\"\n try:\n user_response = await self._requests.get(\n url=self.url_generator.get_url(\"users\", f\"v1/users/{user_id}\")\n )\n except NotFound as exception:\n raise UserNotFound(\n message=\"Invalid user.\",\n response=exception.response\n ) from None\n user_data = user_response.json()\n return User(client=self, data=user_data)\n
"},{"location":"reference/client/#roblox.client.Client.get_user_by_username","title":"get_user_by_username(username, exclude_banned_users=False, expand=True)
async
","text":"Grabs a user corresponding to the passed username.
Parameters:
Name Type Description Defaultusername
str
A Roblox username.
requiredexclude_banned_users
bool
Whether to exclude banned users from the data.
False
expand
bool
Whether to return a User (2 requests) rather than a RequestedUsernamePartialUser (1 request)
True
Returns:
Type DescriptionUnion[RequestedUsernamePartialUser, User]
A User or RequestedUsernamePartialUser depending on the expand argument.
Source code inroblox/client.py
async def get_user_by_username(\n self, username: str, exclude_banned_users: bool = False, expand: bool = True\n) -> Union[RequestedUsernamePartialUser, User]:\n \"\"\"\n Grabs a user corresponding to the passed username.\n\n Arguments:\n username: A Roblox username.\n exclude_banned_users: Whether to exclude banned users from the data.\n expand: Whether to return a User (2 requests) rather than a RequestedUsernamePartialUser (1 request)\n\n Returns:\n A User or RequestedUsernamePartialUser depending on the expand argument.\n \"\"\"\n users = await self.get_users_by_usernames(\n usernames=[username],\n exclude_banned_users=exclude_banned_users,\n expand=expand,\n )\n try:\n return users[0]\n except IndexError:\n raise UserNotFound(\"Invalid username.\") from None\n
"},{"location":"reference/client/#roblox.client.Client.get_users","title":"get_users(user_ids, exclude_banned_users=False, expand=False)
async
","text":"Grabs a list of users corresponding to each user ID in the list.
Parameters:
Name Type Description Defaultuser_ids
List[int]
A list of Roblox user IDs.
requiredexclude_banned_users
bool
Whether to exclude banned users from the data.
False
expand
bool
Whether to return a list of Users (2 requests) rather than PartialUsers (1 request)
False
Returns:
Type DescriptionUnion[List[PartialUser], List[User]]
A List of Users or partial users.
Source code inroblox/client.py
async def get_users(\n self,\n user_ids: List[int],\n exclude_banned_users: bool = False,\n expand: bool = False,\n) -> Union[List[PartialUser], List[User]]:\n \"\"\"\n Grabs a list of users corresponding to each user ID in the list.\n\n Arguments:\n user_ids: A list of Roblox user IDs.\n exclude_banned_users: Whether to exclude banned users from the data.\n expand: Whether to return a list of Users (2 requests) rather than PartialUsers (1 request)\n\n Returns:\n A List of Users or partial users.\n \"\"\"\n users_response = await self._requests.post(\n url=self._url_generator.get_url(\"users\", f\"v1/users\"),\n json={\"userIds\": user_ids, \"excludeBannedUsers\": exclude_banned_users},\n )\n users_data = users_response.json()[\"data\"]\n\n if expand:\n return [await self.get_user(user_data[\"id\"]) for user_data in users_data]\n else:\n return [\n PartialUser(client=self, data=user_data)\n for user_data in users_data\n ]\n
"},{"location":"reference/client/#roblox.client.Client.get_users_by_usernames","title":"get_users_by_usernames(usernames, exclude_banned_users=False, expand=False)
async
","text":"Grabs a list of users corresponding to each username in the list.
Parameters:
Name Type Description Defaultusernames
List[str]
A list of Roblox usernames.
requiredexclude_banned_users
bool
Whether to exclude banned users from the data.
False
expand
bool
Whether to return a list of Users (2 requests) rather than RequestedUsernamePartialUsers (1 request)
False
Returns:
Type DescriptionUnion[List[RequestedUsernamePartialUser], List[User]]
A list of User or RequestedUsernamePartialUser, depending on the expand argument.
Source code inroblox/client.py
async def get_users_by_usernames(\n self,\n usernames: List[str],\n exclude_banned_users: bool = False,\n expand: bool = False,\n) -> Union[List[RequestedUsernamePartialUser], List[User]]:\n \"\"\"\n Grabs a list of users corresponding to each username in the list.\n\n Arguments:\n usernames: A list of Roblox usernames.\n exclude_banned_users: Whether to exclude banned users from the data.\n expand: Whether to return a list of Users (2 requests) rather than RequestedUsernamePartialUsers (1 request)\n\n Returns:\n A list of User or RequestedUsernamePartialUser, depending on the expand argument.\n \"\"\"\n users_response = await self._requests.post(\n url=self._url_generator.get_url(\"users\", f\"v1/usernames/users\"),\n json={\"usernames\": usernames, \"excludeBannedUsers\": exclude_banned_users},\n )\n users_data = users_response.json()[\"data\"]\n\n if expand:\n return [await self.get_user(user_data[\"id\"]) for user_data in users_data]\n else:\n return [\n RequestedUsernamePartialUser(client=self, data=user_data)\n for user_data in users_data\n ]\n
"},{"location":"reference/client/#roblox.client.Client.set_token","title":"set_token(token=None)
","text":"Authenticates the client with the passed .ROBLOSECURITY token. This method does not send any requests and will not throw if the token is invalid.
Parameters:
Name Type Description Defaulttoken
Optional[str]
A .ROBLOSECURITY token to authenticate the client with.
None
Source code in roblox/client.py
def set_token(self, token: Optional[str] = None) -> None:\n \"\"\"\n Authenticates the client with the passed .ROBLOSECURITY token.\n This method does not send any requests and will not throw if the token is invalid.\n\n Arguments:\n token: A .ROBLOSECURITY token to authenticate the client with.\n\n \"\"\"\n self._requests.session.cookies[\".ROBLOSECURITY\"] = token\n
"},{"location":"reference/client/#roblox.client.Client.user_search","title":"user_search(keyword, page_size=10, max_items=None)
","text":"Search for users with a keyword.
Parameters:
Name Type Description Defaultkeyword
str
A keyword to search for.
requiredpage_size
int
How many members should be returned for each page.
10
max_items
int
The maximum items to return when looping through this object.
None
Returns:
Type DescriptionPageIterator
A PageIterator containing RequestedUsernamePartialUser.
Source code inroblox/client.py
def user_search(self, keyword: str, page_size: int = 10,\n max_items: int = None) -> PageIterator:\n \"\"\"\n Search for users with a keyword.\n\n Arguments:\n keyword: A keyword to search for.\n page_size: How many members should be returned for each page.\n max_items: The maximum items to return when looping through this object.\n\n Returns:\n A PageIterator containing RequestedUsernamePartialUser.\n \"\"\"\n return PageIterator(\n client=self,\n url=self._url_generator.get_url(\"users\", f\"v1/users/search\"),\n page_size=page_size,\n max_items=max_items,\n extra_parameters={\"keyword\": keyword},\n handler=lambda client, data: PreviousUsernamesPartialUser(client=client, data=data),\n )\n
"},{"location":"reference/conversations/","title":"conversations","text":"Contains objects related to Roblox chat conversations.
"},{"location":"reference/conversations/#roblox.conversations.Conversation","title":"Conversation
","text":" Bases: BaseConversation
Represents a Roblox chat conversation.
Attributes:
Name Type Descriptionid
int
Chat conversation ID.
title
str
Chat conversation title.
initiator
PartialUser
Conversation initiator entity.
has_unread_messages
bool
Whether the conversation have any unread messages.
participants
List[PartialUser]
Participants involved in the conversation.
conversation_type
ConversationType
Type of the conversation.
conversation_title
ConversationTitle
Specifies if the conversation title is generated by default.
last_updated
datetime
Specifies the datetime when the conversation was last updated.
conversation_universe
Optional[ChatPartialUniverse]
Specifies the universe associated with the conversation.
Source code inroblox/conversations.py
class Conversation(BaseConversation):\n \"\"\"\n Represents a Roblox chat conversation.\n\n Attributes:\n id: Chat conversation ID.\n title: Chat conversation title.\n initiator: Conversation initiator entity.\n has_unread_messages: Whether the conversation have any unread messages.\n participants: Participants involved in the conversation.\n conversation_type: Type of the conversation.\n conversation_title: Specifies if the conversation title is generated by default.\n last_updated: Specifies the datetime when the conversation was last updated.\n conversation_universe: Specifies the universe associated with the conversation.\n \"\"\"\n\n def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: The Client object.\n data: The conversation data.\n \"\"\"\n super().__init__(client=client, conversation_id=self.id)\n self.id: int = data[\"id\"]\n self.title: str = data[\"title\"]\n\n # Technically the initiator could be a group, but in practice that doesn't happen\n # so this is a partialuser\n # Nikita Petko: Well uhhh, the initiator is of the ChatParticipant model,\n # where it can either be from User or System.\n self.initiator: PartialUser = PartialUser(client, data[\"initiator\"])\n\n self.has_unread_messages: bool = data[\"hasUnreadMessages\"]\n self.participants: List[PartialUser] = [PartialUser(\n client=client,\n data=participant_data\n ) for participant_data in data[\"participants\"]]\n\n self.conversation_type: ConversationType = ConversationType(data[\"conversationType\"])\n self.conversation_title: ConversationTitle = ConversationTitle(\n data=data[\"conversationTitle\"]\n )\n self.last_updated: datetime = parse(data[\"lastUpdated\"])\n self.conversation_universe: Optional[ChatPartialUniverse] = data[\n \"conversationUniverse\"] and ChatPartialUniverse(\n client=client,\n data=data[\"conversationUniverse\"]\n )\n
"},{"location":"reference/conversations/#roblox.conversations.Conversation.__init__","title":"__init__(client, data)
","text":"Parameters:
Name Type Description Defaultclient
Client
The Client object.
requireddata
dict
The conversation data.
required Source code inroblox/conversations.py
def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: The Client object.\n data: The conversation data.\n \"\"\"\n super().__init__(client=client, conversation_id=self.id)\n self.id: int = data[\"id\"]\n self.title: str = data[\"title\"]\n\n # Technically the initiator could be a group, but in practice that doesn't happen\n # so this is a partialuser\n # Nikita Petko: Well uhhh, the initiator is of the ChatParticipant model,\n # where it can either be from User or System.\n self.initiator: PartialUser = PartialUser(client, data[\"initiator\"])\n\n self.has_unread_messages: bool = data[\"hasUnreadMessages\"]\n self.participants: List[PartialUser] = [PartialUser(\n client=client,\n data=participant_data\n ) for participant_data in data[\"participants\"]]\n\n self.conversation_type: ConversationType = ConversationType(data[\"conversationType\"])\n self.conversation_title: ConversationTitle = ConversationTitle(\n data=data[\"conversationTitle\"]\n )\n self.last_updated: datetime = parse(data[\"lastUpdated\"])\n self.conversation_universe: Optional[ChatPartialUniverse] = data[\n \"conversationUniverse\"] and ChatPartialUniverse(\n client=client,\n data=data[\"conversationUniverse\"]\n )\n
"},{"location":"reference/conversations/#roblox.conversations.ConversationTitle","title":"ConversationTitle
","text":"A chat conversation's title.
Attributes:
Name Type Descriptiontitle_for_viewer
str
Specifies the title for the conversation specific to the viewer.
is_default_title
bool
Specifies if the title displayed for the user is generated as a default title or was edited by the user.
Source code inroblox/conversations.py
class ConversationTitle:\n \"\"\"\n A chat conversation's title.\n\n Attributes:\n title_for_viewer: Specifies the title for the conversation specific to the viewer.\n is_default_title: Specifies if the title displayed for the user is generated as a default title or was edited by\n the user.\n \"\"\"\n\n def __init__(self, data: dict):\n \"\"\"\n Arguments:\n data: The raw input data.\n \"\"\"\n self.title_for_viewer: str = data[\"titleForViewer\"]\n self.is_default_title: bool = data[\"isDefaultTitle\"]\n\n def __repr__(self):\n return f\"<{self.__class__.__name__} title_for_viewer={self.title_for_viewer!r} is_default_title={self.is_default_title}>\"\n
"},{"location":"reference/conversations/#roblox.conversations.ConversationTitle.__init__","title":"__init__(data)
","text":"Parameters:
Name Type Description Defaultdata
dict
The raw input data.
required Source code inroblox/conversations.py
def __init__(self, data: dict):\n \"\"\"\n Arguments:\n data: The raw input data.\n \"\"\"\n self.title_for_viewer: str = data[\"titleForViewer\"]\n self.is_default_title: bool = data[\"isDefaultTitle\"]\n
"},{"location":"reference/conversations/#roblox.conversations.ConversationType","title":"ConversationType
","text":" Bases: Enum
A chat conversation's type.
Source code inroblox/conversations.py
class ConversationType(Enum):\n \"\"\"\n A chat conversation's type.\n \"\"\"\n\n multi_user_conversation = \"MultiUserConversation\"\n \"\"\"Represents a chat with multiples users on the website.\"\"\"\n one_to_one_conversation = \"OneToOneConversation\"\n \"\"\"Represents a one-to-one conversation with person A and B.\"\"\"\n cloud_edit_conversation = \"CloudEditConversation\"\n \"\"\"Represents a chat in a team-create session.\"\"\"\n
"},{"location":"reference/conversations/#roblox.conversations.ConversationType.cloud_edit_conversation","title":"cloud_edit_conversation = 'CloudEditConversation'
class-attribute
instance-attribute
","text":"Represents a chat in a team-create session.
"},{"location":"reference/conversations/#roblox.conversations.ConversationType.multi_user_conversation","title":"multi_user_conversation = 'MultiUserConversation'
class-attribute
instance-attribute
","text":"Represents a chat with multiples users on the website.
"},{"location":"reference/conversations/#roblox.conversations.ConversationType.one_to_one_conversation","title":"one_to_one_conversation = 'OneToOneConversation'
class-attribute
instance-attribute
","text":"Represents a one-to-one conversation with person A and B.
"},{"location":"reference/creatortype/","title":"creatortype","text":"Contains client enums. fixme: this should be deprecated!
"},{"location":"reference/creatortype/#roblox.creatortype.CreatorType","title":"CreatorType
","text":" Bases: Enum
Represents the type of creator for objects that can be owned by either a group or a user, like Assets.
Source code inroblox/creatortype.py
class CreatorType(Enum):\n \"\"\"\n Represents the type of creator for objects that can be owned by either a group or a user, like Assets.\n \"\"\"\n\n group = \"Group\"\n \"\"\"The creator is a group.\"\"\"\n user = \"User\"\n \"\"\"The creator is a user.\"\"\"\n
"},{"location":"reference/creatortype/#roblox.creatortype.CreatorType.group","title":"group = 'Group'
class-attribute
instance-attribute
","text":"The creator is a group.
"},{"location":"reference/creatortype/#roblox.creatortype.CreatorType.user","title":"user = 'User'
class-attribute
instance-attribute
","text":"The creator is a user.
"},{"location":"reference/delivery/","title":"delivery","text":"Contains classes and functions related to Roblox asset delivery.
"},{"location":"reference/delivery/#roblox.delivery.BaseCDNHash","title":"BaseCDNHash
","text":"Represents a cdn_hash on a Roblox content delivery network.
Attributes:
Name Type Descriptioncdn_hash
str
The CDN hash as a string.
Source code inroblox/delivery.py
class BaseCDNHash:\n \"\"\"\n Represents a cdn_hash on a Roblox content delivery network.\n\n Attributes:\n cdn_hash: The CDN hash as a string.\n \"\"\"\n\n def __init__(self, client: Client, cdn_hash: str):\n \"\"\"\n Arguments:\n client: The Client object.\n cdn_hash: The CDN hash as a string.\n \"\"\"\n\n self._client: Client = client\n self.cdn_hash: str = cdn_hash\n\n def __repr__(self):\n return f\"<{self.__class__.__name__} cdn_hash={self.cdn_hash}>\"\n\n def get_cdn_number(self) -> int:\n \"\"\"\n Returns the CDN number of this CDN hash.\n\n Returns:\n The computed number of the given cdn_hash\n \"\"\"\n\n return get_cdn_number(self.cdn_hash)\n\n def _get_url(self, prefix: str, site: str = cdn_site) -> str:\n cdn_number: int = self.get_cdn_number()\n return self._client.url_generator.get_url(f\"{prefix}{cdn_number}\", self.cdn_hash, site)\n\n def get_url(self, site: str = cdn_site) -> str:\n \"\"\"\n Gets the cdn_hash's URL. This should be implemented by subclasses.\n\n Arguments:\n site: Represents the URL for what site it should target, be it rbxcdn.com, or roblox.com etc.\n\n Returns:\n The computed URL from the given cdn_hash attribute.\n \"\"\"\n\n raise NotImplementedError\n
"},{"location":"reference/delivery/#roblox.delivery.BaseCDNHash.__init__","title":"__init__(client, cdn_hash)
","text":"Parameters:
Name Type Description Defaultclient
Client
The Client object.
requiredcdn_hash
str
The CDN hash as a string.
required Source code inroblox/delivery.py
def __init__(self, client: Client, cdn_hash: str):\n \"\"\"\n Arguments:\n client: The Client object.\n cdn_hash: The CDN hash as a string.\n \"\"\"\n\n self._client: Client = client\n self.cdn_hash: str = cdn_hash\n
"},{"location":"reference/delivery/#roblox.delivery.BaseCDNHash.get_cdn_number","title":"get_cdn_number()
","text":"Returns the CDN number of this CDN hash.
Returns:
Type Descriptionint
The computed number of the given cdn_hash
Source code inroblox/delivery.py
def get_cdn_number(self) -> int:\n \"\"\"\n Returns the CDN number of this CDN hash.\n\n Returns:\n The computed number of the given cdn_hash\n \"\"\"\n\n return get_cdn_number(self.cdn_hash)\n
"},{"location":"reference/delivery/#roblox.delivery.BaseCDNHash.get_url","title":"get_url(site=cdn_site)
","text":"Gets the cdn_hash's URL. This should be implemented by subclasses.
Parameters:
Name Type Description Defaultsite
str
Represents the URL for what site it should target, be it rbxcdn.com, or roblox.com etc.
cdn_site
Returns:
Type Descriptionstr
The computed URL from the given cdn_hash attribute.
Source code inroblox/delivery.py
def get_url(self, site: str = cdn_site) -> str:\n \"\"\"\n Gets the cdn_hash's URL. This should be implemented by subclasses.\n\n Arguments:\n site: Represents the URL for what site it should target, be it rbxcdn.com, or roblox.com etc.\n\n Returns:\n The computed URL from the given cdn_hash attribute.\n \"\"\"\n\n raise NotImplementedError\n
"},{"location":"reference/delivery/#roblox.delivery.ContentCDNHash","title":"ContentCDNHash
","text":" Bases: BaseCDNHash
Represents a CDN hash on cX.rbxcdn.com.
Source code inroblox/delivery.py
class ContentCDNHash(BaseCDNHash):\n \"\"\"\n Represents a CDN hash on cX.rbxcdn.com.\n \"\"\"\n\n def __init__(self, client: Client, cdn_hash: str):\n super().__init__(client=client, cdn_hash=cdn_hash)\n\n def get_url(self, site: str = cdn_site) -> str:\n \"\"\"\n Returns:\n This hash's URL.\n \"\"\"\n\n return self._get_url(\"c\", cdn_site)\n
"},{"location":"reference/delivery/#roblox.delivery.ContentCDNHash.get_url","title":"get_url(site=cdn_site)
","text":"Returns:
Type Descriptionstr
This hash's URL.
Source code inroblox/delivery.py
def get_url(self, site: str = cdn_site) -> str:\n \"\"\"\n Returns:\n This hash's URL.\n \"\"\"\n\n return self._get_url(\"c\", cdn_site)\n
"},{"location":"reference/delivery/#roblox.delivery.DeliveryProvider","title":"DeliveryProvider
","text":"Provides CDN hashes and other delivery-related objects.
Source code inroblox/delivery.py
class DeliveryProvider:\n \"\"\"\n Provides CDN hashes and other delivery-related objects.\n \"\"\"\n\n def __init__(self, client: Client):\n \"\"\"\n Arguments:\n client: The client object, which is passed to all objects this client generates.\n \"\"\"\n self._client: Client = client\n\n def get_cdn_hash(self, cdn_hash: str) -> BaseCDNHash:\n \"\"\"\n Gets a Roblox CDN cdn_hash.\n\n Arguments:\n cdn_hash: The cdn_hash.\n\n Returns:\n A BaseCDNHash.\n \"\"\"\n\n return BaseCDNHash(\n client=self._client,\n cdn_hash=cdn_hash\n )\n\n def get_cdn_hash_from_url(self, url: str, site: str = cdn_site) -> BaseCDNHash:\n \"\"\"\n todo: turn this into something that actually splits into path.\n\n Arguments:\n url: A CDN url.\n site: The site this cdn_hash is located at.\n\n Returns:\n The CDN cdn_hash for the supplied CDN URL.\n \"\"\"\n\n return self.get_cdn_hash(\n cdn_hash=url.split(f\".{site}/\")[1]\n )\n\n def get_thumbnail_cdn_hash(self, cdn_hash: str) -> ThumbnailCDNHash:\n \"\"\"\n Gets a Roblox CDN cdn_hash.\n\n Arguments:\n cdn_hash: The cdn_hash.\n\n Returns:\n A ThumbnailCDNHash.\n \"\"\"\n\n return ThumbnailCDNHash(\n client=self._client,\n cdn_hash=cdn_hash\n )\n\n def get_content_cdn_hash(self, cdn_hash: str) -> ContentCDNHash:\n \"\"\"\n Gets a Roblox CDN cdn_hash.\n\n Arguments:\n cdn_hash: The cdn_hash.\n\n Returns:\n A ContentCDNHash.\n \"\"\"\n\n return ContentCDNHash(\n client=self._client,\n cdn_hash=cdn_hash\n )\n
"},{"location":"reference/delivery/#roblox.delivery.DeliveryProvider.__init__","title":"__init__(client)
","text":"Parameters:
Name Type Description Defaultclient
Client
The client object, which is passed to all objects this client generates.
required Source code inroblox/delivery.py
def __init__(self, client: Client):\n \"\"\"\n Arguments:\n client: The client object, which is passed to all objects this client generates.\n \"\"\"\n self._client: Client = client\n
"},{"location":"reference/delivery/#roblox.delivery.DeliveryProvider.get_cdn_hash","title":"get_cdn_hash(cdn_hash)
","text":"Gets a Roblox CDN cdn_hash.
Parameters:
Name Type Description Defaultcdn_hash
str
The cdn_hash.
requiredReturns:
Type DescriptionBaseCDNHash
A BaseCDNHash.
Source code inroblox/delivery.py
def get_cdn_hash(self, cdn_hash: str) -> BaseCDNHash:\n \"\"\"\n Gets a Roblox CDN cdn_hash.\n\n Arguments:\n cdn_hash: The cdn_hash.\n\n Returns:\n A BaseCDNHash.\n \"\"\"\n\n return BaseCDNHash(\n client=self._client,\n cdn_hash=cdn_hash\n )\n
"},{"location":"reference/delivery/#roblox.delivery.DeliveryProvider.get_cdn_hash_from_url","title":"get_cdn_hash_from_url(url, site=cdn_site)
","text":"Parameters:
Name Type Description Defaulturl
str
A CDN url.
requiredsite
str
The site this cdn_hash is located at.
cdn_site
Returns:
Type DescriptionBaseCDNHash
The CDN cdn_hash for the supplied CDN URL.
Source code inroblox/delivery.py
def get_cdn_hash_from_url(self, url: str, site: str = cdn_site) -> BaseCDNHash:\n \"\"\"\n todo: turn this into something that actually splits into path.\n\n Arguments:\n url: A CDN url.\n site: The site this cdn_hash is located at.\n\n Returns:\n The CDN cdn_hash for the supplied CDN URL.\n \"\"\"\n\n return self.get_cdn_hash(\n cdn_hash=url.split(f\".{site}/\")[1]\n )\n
"},{"location":"reference/delivery/#roblox.delivery.DeliveryProvider.get_content_cdn_hash","title":"get_content_cdn_hash(cdn_hash)
","text":"Gets a Roblox CDN cdn_hash.
Parameters:
Name Type Description Defaultcdn_hash
str
The cdn_hash.
requiredReturns:
Type DescriptionContentCDNHash
A ContentCDNHash.
Source code inroblox/delivery.py
def get_content_cdn_hash(self, cdn_hash: str) -> ContentCDNHash:\n \"\"\"\n Gets a Roblox CDN cdn_hash.\n\n Arguments:\n cdn_hash: The cdn_hash.\n\n Returns:\n A ContentCDNHash.\n \"\"\"\n\n return ContentCDNHash(\n client=self._client,\n cdn_hash=cdn_hash\n )\n
"},{"location":"reference/delivery/#roblox.delivery.DeliveryProvider.get_thumbnail_cdn_hash","title":"get_thumbnail_cdn_hash(cdn_hash)
","text":"Gets a Roblox CDN cdn_hash.
Parameters:
Name Type Description Defaultcdn_hash
str
The cdn_hash.
requiredReturns:
Type DescriptionThumbnailCDNHash
A ThumbnailCDNHash.
Source code inroblox/delivery.py
def get_thumbnail_cdn_hash(self, cdn_hash: str) -> ThumbnailCDNHash:\n \"\"\"\n Gets a Roblox CDN cdn_hash.\n\n Arguments:\n cdn_hash: The cdn_hash.\n\n Returns:\n A ThumbnailCDNHash.\n \"\"\"\n\n return ThumbnailCDNHash(\n client=self._client,\n cdn_hash=cdn_hash\n )\n
"},{"location":"reference/delivery/#roblox.delivery.ThumbnailCDNHash","title":"ThumbnailCDNHash
","text":" Bases: BaseCDNHash
Represents a CDN hash on tX.rbxcdn.com.
Source code inroblox/delivery.py
class ThumbnailCDNHash(BaseCDNHash):\n \"\"\"\n Represents a CDN hash on tX.rbxcdn.com.\n \"\"\"\n\n def __init__(self, client: Client, cdn_hash: str):\n super().__init__(client=client, cdn_hash=cdn_hash)\n\n def get_url(self, site: str = cdn_site) -> str:\n \"\"\"\n Returns this CDN hash's URL.\n \"\"\"\n\n return self._get_url(\"t\", cdn_site)\n
"},{"location":"reference/delivery/#roblox.delivery.ThumbnailCDNHash.get_url","title":"get_url(site=cdn_site)
","text":"Returns this CDN hash's URL.
Source code inroblox/delivery.py
def get_url(self, site: str = cdn_site) -> str:\n \"\"\"\n Returns this CDN hash's URL.\n \"\"\"\n\n return self._get_url(\"t\", cdn_site)\n
"},{"location":"reference/delivery/#roblox.delivery.get_cdn_number","title":"get_cdn_number(cdn_hash)
","text":"Gets the number in the CDN where number represents X in tX.rbxcdn.com
Parameters:
Name Type Description Defaultcdn_hash
str
The CDN cdn_hash to generate a CDN number for.
requiredReturns:
Type Descriptionint
The CDN number for the supplied cdn_hash.
Source code inroblox/delivery.py
def get_cdn_number(cdn_hash: str) -> int:\n \"\"\"\n Gets the number in the CDN where number represents X in tX.rbxcdn.com\n\n Arguments:\n cdn_hash: The CDN cdn_hash to generate a CDN number for.\n\n Returns: \n The CDN number for the supplied cdn_hash.\n \"\"\"\n i = 31\n for char in cdn_hash[:32]:\n i ^= ord(char) # i ^= int(char, 16) also works\n return i % 8\n
"},{"location":"reference/friends/","title":"friends","text":"Contains classes related to Roblox friend data and parsing.
"},{"location":"reference/friends/#roblox.friends.Friend","title":"Friend
","text":" Bases: User
Represents a friend.
Attributes:
Name Type Descriptionis_online
Optional[bool]
Whether the user is currently online.
presence_type
Optional[int]
Their presence type. Don't use this.
is_deleted
bool
Whether the account is deleted.
friend_frequent_rank
int
Unknown
Source code inroblox/friends.py
class Friend(User):\n \"\"\"\n Represents a friend.\n\n Attributes:\n is_online: Whether the user is currently online.\n presence_type: Their presence type. Don't use this.\n is_deleted: Whether the account is deleted.\n friend_frequent_rank: Unknown\n \"\"\"\n\n def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n data: The data we get back from the endpoint.\n client: The Client object, which is passed to all objects this Client generates.\n \"\"\"\n super().__init__(client=client, data=data)\n\n self.is_online: Optional[bool] = data.get(\"isOnline\")\n self.presence_type: Optional[int] = data.get(\"presenceType\")\n self.is_deleted: bool = data[\"isDeleted\"]\n self.friend_frequent_rank: int = data[\"friendFrequentRank\"]\n
"},{"location":"reference/friends/#roblox.friends.Friend.__init__","title":"__init__(client, data)
","text":"Parameters:
Name Type Description Defaultdata
dict
The data we get back from the endpoint.
requiredclient
Client
The Client object, which is passed to all objects this Client generates.
required Source code inroblox/friends.py
def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n data: The data we get back from the endpoint.\n client: The Client object, which is passed to all objects this Client generates.\n \"\"\"\n super().__init__(client=client, data=data)\n\n self.is_online: Optional[bool] = data.get(\"isOnline\")\n self.presence_type: Optional[int] = data.get(\"presenceType\")\n self.is_deleted: bool = data[\"isDeleted\"]\n self.friend_frequent_rank: int = data[\"friendFrequentRank\"]\n
"},{"location":"reference/gamepasses/","title":"gamepasses","text":"Contains classes related to Roblox gamepass data and parsing.
"},{"location":"reference/gamepasses/#roblox.gamepasses.GamePass","title":"GamePass
","text":" Bases: BaseGamePass
Represents a Roblox gamepass.
Attributes:
Name Type Descriptionid
int
The gamepass ID.
name
str
The gamepass name.
display_name
str
The gamepass display name.
price
Optional[int]
The gamepass price.
Source code inroblox/gamepasses.py
class GamePass(BaseGamePass):\n \"\"\"\n Represents a Roblox gamepass.\n\n Attributes:\n id: The gamepass ID.\n name: The gamepass name.\n display_name: The gamepass display name.\n price: The gamepass price.\n \"\"\"\n\n def __init__(self, client: Client, data: dict):\n self._client: Client = client\n self.id: int = data[\"id\"]\n super().__init__(client=self._client, gamepass_id=self.id)\n self.name: str = data[\"name\"]\n self.display_name: str = data[\"displayName\"]\n # TODO: add product here\n self.price: Optional[int] = data[\"price\"]\n
"},{"location":"reference/groups/","title":"groups","text":"Contains classes related to Roblox group data and parsing.
"},{"location":"reference/groups/#roblox.groups.Group","title":"Group
","text":" Bases: BaseGroup
Represents a group.
Attributes:
Name Type Descriptionid
int
the id of the group.
name
str
name of the group.
description
str
description of the group.
owner
Optional[PartialUser]
player who owns the group.
shout
Optional[Shout]
the current group shout.
member_count
int
amount of members in the group.
is_builders_club_only
bool
can only people with builder club join.
public_entry_allowed
bool
can you join without your join request having to be accepted.
is_locked
bool
Is the group locked?
has_verified_badge
bool
If the group has a verified badge.
Source code inroblox/groups.py
class Group(BaseGroup):\n \"\"\"\n Represents a group.\n\n Attributes:\n id: the id of the group.\n name: name of the group.\n description: description of the group.\n owner: player who owns the group.\n shout: the current group shout.\n member_count: amount of members in the group.\n is_builders_club_only: can only people with builder club join.\n public_entry_allowed: can you join without your join request having to be accepted.\n is_locked: Is the group locked?\n has_verified_badge: If the group has a verified badge.\n \"\"\"\n\n def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n data: The data we get back from the endpoint.\n client: The Client object, which is passed to all objects this Client generates.\n \"\"\"\n super().__init__(client, data[\"id\"])\n\n self._client: Client = client\n\n self.id: int = data[\"id\"]\n self.name: str = data[\"name\"]\n self.description: str = data[\"description\"]\n self.owner: Optional[PartialUser] = PartialUser(client=client, data=data[\"owner\"]) if data.get(\"owner\") else \\\n None\n self.shout: Optional[Shout] = Shout(\n client=self._client,\n data=data[\"shout\"]\n ) if data.get(\"shout\") else None\n\n self.member_count: int = data[\"memberCount\"]\n self.is_builders_club_only: bool = data[\"isBuildersClubOnly\"]\n self.public_entry_allowed: bool = data[\"publicEntryAllowed\"]\n self.is_locked: bool = data.get(\"isLocked\") or False\n self.has_verified_badge: bool = data[\"hasVerifiedBadge\"]\n\n async def update_shout(self, message: str, update_self: bool = True) -> Tuple[Optional[Shout], Optional[Shout]]:\n \"\"\"\n Updates the shout.\n\n Arguments:\n message: The new shout message.\n update_self: Whether to update self.shout automatically.\n Returns: \n The old and new shout.\n \"\"\"\n shout_response = await self._client.requests.patch(\n url=self._client.url_generator.get_url(\"groups\", f\"v1/groups/{self.id}/status\"),\n json={\n \"message\": message\n }\n )\n\n shout_data = shout_response.json()\n\n old_shout: Optional[Shout] = self.shout\n new_shout: Optional[Shout] = shout_data and Shout(\n client=self._client,\n data=shout_data\n ) or None\n\n if update_self:\n self.shout = new_shout\n\n return old_shout, new_shout\n
"},{"location":"reference/groups/#roblox.groups.Group.__init__","title":"__init__(client, data)
","text":"Parameters:
Name Type Description Defaultdata
dict
The data we get back from the endpoint.
requiredclient
Client
The Client object, which is passed to all objects this Client generates.
required Source code inroblox/groups.py
def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n data: The data we get back from the endpoint.\n client: The Client object, which is passed to all objects this Client generates.\n \"\"\"\n super().__init__(client, data[\"id\"])\n\n self._client: Client = client\n\n self.id: int = data[\"id\"]\n self.name: str = data[\"name\"]\n self.description: str = data[\"description\"]\n self.owner: Optional[PartialUser] = PartialUser(client=client, data=data[\"owner\"]) if data.get(\"owner\") else \\\n None\n self.shout: Optional[Shout] = Shout(\n client=self._client,\n data=data[\"shout\"]\n ) if data.get(\"shout\") else None\n\n self.member_count: int = data[\"memberCount\"]\n self.is_builders_club_only: bool = data[\"isBuildersClubOnly\"]\n self.public_entry_allowed: bool = data[\"publicEntryAllowed\"]\n self.is_locked: bool = data.get(\"isLocked\") or False\n self.has_verified_badge: bool = data[\"hasVerifiedBadge\"]\n
"},{"location":"reference/groups/#roblox.groups.Group.update_shout","title":"update_shout(message, update_self=True)
async
","text":"Updates the shout.
Parameters:
Name Type Description Defaultmessage
str
The new shout message.
requiredupdate_self
bool
Whether to update self.shout automatically.
True
Source code in roblox/groups.py
async def update_shout(self, message: str, update_self: bool = True) -> Tuple[Optional[Shout], Optional[Shout]]:\n \"\"\"\n Updates the shout.\n\n Arguments:\n message: The new shout message.\n update_self: Whether to update self.shout automatically.\n Returns: \n The old and new shout.\n \"\"\"\n shout_response = await self._client.requests.patch(\n url=self._client.url_generator.get_url(\"groups\", f\"v1/groups/{self.id}/status\"),\n json={\n \"message\": message\n }\n )\n\n shout_data = shout_response.json()\n\n old_shout: Optional[Shout] = self.shout\n new_shout: Optional[Shout] = shout_data and Shout(\n client=self._client,\n data=shout_data\n ) or None\n\n if update_self:\n self.shout = new_shout\n\n return old_shout, new_shout\n
"},{"location":"reference/instances/","title":"instances","text":"This module contains classes intended to parse and deal with data from Roblox item instance information endpoints.
"},{"location":"reference/instances/#roblox.instances.AssetInstance","title":"AssetInstance
","text":" Bases: ItemInstance
Represents an instance of a Roblox asset.
Source code inroblox/instances.py
class AssetInstance(ItemInstance):\n \"\"\"\n Represents an instance of a Roblox asset.\n \"\"\"\n\n def __init__(self, client: Client, data: dict):\n self._client: Client = client\n super().__init__(client=self._client, data=data)\n\n self.asset: BaseAsset = BaseAsset(client=self._client, asset_id=data[\"id\"])\n
"},{"location":"reference/instances/#roblox.instances.BadgeInstance","title":"BadgeInstance
","text":" Bases: ItemInstance
Represents an instance of a Roblox badge.
Source code inroblox/instances.py
class BadgeInstance(ItemInstance):\n \"\"\"\n Represents an instance of a Roblox badge.\n \"\"\"\n\n def __init__(self, client: Client, data: dict):\n self._client: Client = client\n super().__init__(client=self._client, data=data)\n\n self.badge: BaseBadge = BaseBadge(client=self._client, badge_id=data[\"id\"])\n
"},{"location":"reference/instances/#roblox.instances.GamePassInstance","title":"GamePassInstance
","text":" Bases: ItemInstance
Represents an instance of a Roblox gamepass.
Source code inroblox/instances.py
class GamePassInstance(ItemInstance):\n \"\"\"\n Represents an instance of a Roblox gamepass.\n \"\"\"\n\n def __init__(self, client: Client, data: dict):\n self._client: Client = client\n super().__init__(client=self._client, data=data)\n\n self.gamepass: BaseGamePass = BaseGamePass(client=self._client, gamepass_id=data[\"id\"])\n
"},{"location":"reference/instances/#roblox.instances.InstanceType","title":"InstanceType
","text":" Bases: Enum
Represents an asset instance type.
Source code inroblox/instances.py
class InstanceType(Enum):\n \"\"\"\n Represents an asset instance type.\n \"\"\"\n asset = \"Asset\"\n gamepass = \"GamePass\"\n badge = \"Badge\"\n
"},{"location":"reference/instances/#roblox.instances.ItemInstance","title":"ItemInstance
","text":" Bases: BaseInstance
Represents an instance of a Roblox item of some kind.
Attributes:
Name Type Description_client
Client
The Client object, which is passed to all objects this Client generates.
Source code inroblox/instances.py
class ItemInstance(BaseInstance):\n \"\"\"\n Represents an instance of a Roblox item of some kind.\n\n Attributes:\n _client: The Client object, which is passed to all objects this Client generates.\n \"\"\"\n\n def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: The Client.\n data: The data from the endpoint.\n \"\"\"\n self._client: Client = client\n\n self.name: str = data[\"name\"]\n self.type: str = data[\"type\"] # fixme\n\n super().__init__(client=self._client, instance_id=data[\"instanceId\"])\n
"},{"location":"reference/instances/#roblox.instances.ItemInstance.__init__","title":"__init__(client, data)
","text":"Parameters:
Name Type Description Defaultclient
Client
The Client.
requireddata
dict
The data from the endpoint.
required Source code inroblox/instances.py
def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: The Client.\n data: The data from the endpoint.\n \"\"\"\n self._client: Client = client\n\n self.name: str = data[\"name\"]\n self.type: str = data[\"type\"] # fixme\n\n super().__init__(client=self._client, instance_id=data[\"instanceId\"])\n
"},{"location":"reference/jobs/","title":"jobs","text":"This module contains classes intended to parse and deal with data from Roblox server instance (or \"job\") endpoints.
"},{"location":"reference/jobs/#roblox.jobs.GameInstance","title":"GameInstance
","text":" Bases: BaseJob
Represents a game (or place) instance, or \"job\".
Attributes:
Name Type Descriptionid
str
The instance's job ID.
capacity
int
The server's capacity.
ping
int
The server's ping.
fps
float
The server's FPS.
show_slow_game_message
bool
Whether to show the \"slow game\" message.
place
BasePlace
The server's place.
current_players
List[GameInstancePlayer]
A list of the players in this server.
can_join
bool
Whether the authenticated user can join this server.
show_shutdown_button
bool
Whether to show the shutdown button on this server.
friends_description
str
What text should be shown if this server is a \"friends are in\" server.
friends_mouseover
What text should be shown on mouseover if this server is a \"friends are in\" server.
capacity_message
str
The server's capacity as a parsed message.
join_script
str
JavaScript code that, when evaluated on a /games page on the Roblox website, launches this game.
app_join_script
str
JavaScript code that, when evaluated on a /games page on the Roblox website, launches this game through the Roblox mobile app.
Source code inroblox/jobs.py
class GameInstance(BaseJob):\n \"\"\"\n Represents a game (or place) instance, or \"job\".\n\n Attributes:\n id: The instance's job ID.\n capacity: The server's capacity.\n ping: The server's ping.\n fps: The server's FPS.\n show_slow_game_message: Whether to show the \"slow game\" message.\n place: The server's place.\n current_players: A list of the players in this server.\n can_join: Whether the authenticated user can join this server.\n show_shutdown_button: Whether to show the shutdown button on this server.\n friends_description: What text should be shown if this server is a \"friends are in\" server.\n friends_mouseover: What text should be shown on mouseover if this server is a \"friends are in\" server.\n capacity_message: The server's capacity as a parsed message.\n join_script: JavaScript code that, when evaluated on a /games page on the Roblox website, launches this game.\n app_join_script: JavaScript code that, when evaluated on a /games page on the Roblox website, launches this game\n through the Roblox mobile app.\n \"\"\"\n\n def __init__(self, client: Client, data: dict):\n self._client: Client = client\n self.id: str = data[\"Guid\"]\n\n super().__init__(client=self._client, job_id=self.id)\n\n self.capacity: int = data[\"Capacity\"]\n self.ping: int = data[\"Ping\"]\n self.fps: float = data[\"Fps\"]\n self.show_slow_game_message: bool = data[\"ShowSlowGameMessage\"]\n self.place: BasePlace = BasePlace(client=self._client, place_id=data[\"PlaceId\"])\n\n self.current_players: List[GameInstancePlayer] = [\n GameInstancePlayer(\n client=self._client,\n data=player_data\n ) for player_data in data[\"CurrentPlayers\"]\n ]\n\n self.can_join: bool = data[\"UserCanJoin\"]\n self.show_shutdown_button: bool = data[\"ShowShutdownButton\"]\n self.friends_description: str = data[\"FriendsDescription\"]\n self.friends_mouseover = data[\"FriendsMouseover\"]\n self.capacity_message: str = data[\"PlayersCapacity\"] # TODO: reconsider\n\n self.join_script: str = data[\"JoinScript\"]\n self.app_join_script: str = data[\"RobloxAppJoinScript\"]\n
"},{"location":"reference/jobs/#roblox.jobs.GameInstancePlayer","title":"GameInstancePlayer
","text":" Bases: BaseUser
Represents a single player in a game instance. Data, like user ID and username, may be filled with placeholder data. Do not rely on this object containing proper data. If the id attribute is 0, this object should not be used.
Attributes:
Name Type Descriptionid
int
The player's user ID.
name
str
The player's username.
thumbnail
GameInstancePlayerThumbnail
The player's thumbnail.
Source code inroblox/jobs.py
class GameInstancePlayer(BaseUser):\n \"\"\"\n Represents a single player in a game instance.\n Data, like user ID and username, may be filled with placeholder data.\n Do not rely on this object containing proper data. If the id attribute is 0, this object should not be used.\n\n Attributes:\n id: The player's user ID.\n name: The player's username.\n thumbnail: The player's thumbnail.\n \"\"\"\n\n def __init__(self, client: Client, data: dict):\n self._client: Client = client\n self.id: int = data[\"Id\"]\n super().__init__(client=self._client, user_id=self.id)\n\n self.name: str = data[\"Username\"]\n self.thumbnail: GameInstancePlayerThumbnail = GameInstancePlayerThumbnail(\n client=self._client,\n data=data[\"Thumbnail\"]\n )\n
"},{"location":"reference/jobs/#roblox.jobs.GameInstancePlayerThumbnail","title":"GameInstancePlayerThumbnail
","text":"Represent a player in a game instance's thumbnail. As the asset part of these thumbnails is no longer in use, this endpoint does not attempt to implement asset information.
Attributes:
Name Type Descriptionurl
str
The thumbnail's URL.
final
bool
Whether the thumbnail is finalized or not.
Source code inroblox/jobs.py
class GameInstancePlayerThumbnail:\n \"\"\"\n Represent a player in a game instance's thumbnail.\n As the asset part of these thumbnails is no longer in use, this endpoint does not attempt to implement asset\n information.\n\n Attributes:\n url: The thumbnail's URL.\n final: Whether the thumbnail is finalized or not.\n \"\"\"\n\n def __init__(self, client: Client, data: dict):\n self._client: Client = client\n\n self.url: str = data[\"Url\"]\n self.final: bool = data[\"IsFinal\"]\n\n def __repr__(self):\n return f\"<{self.__class__.__name__} url={self.url!r} final={self.final}\"\n
"},{"location":"reference/jobs/#roblox.jobs.GameInstances","title":"GameInstances
","text":"Represents a game/place's active server instances.
Attributes:
Name Type Descriptionplace
BasePlace
The place.
show_shutdown_all_button
bool
Whether to show the \"Shutdown All\" button on the server list.
is_game_instance_list_unavailable
bool
Whether the list is unavailable.
collection
List[GameInstance]
A list of the game instances.
total_collection_size
int
How many active servers there are.
Source code inroblox/jobs.py
class GameInstances:\n \"\"\"\n Represents a game/place's active server instances.\n\n Attributes:\n place: The place.\n show_shutdown_all_button: Whether to show the \"Shutdown All\" button on the server list.\n is_game_instance_list_unavailable: Whether the list is unavailable.\n collection: A list of the game instances.\n total_collection_size: How many active servers there are.\n \"\"\"\n\n def __init__(self, client: Client, data: dict):\n self._client: Client = client\n\n self.place: BasePlace = BasePlace(client=self._client, place_id=data[\"PlaceId\"])\n self.show_shutdown_all_button: bool = data[\"ShowShutdownAllButton\"]\n self.is_game_instance_list_unavailable: bool = data[\"IsGameInstanceListUnavailable\"]\n self.collection: List[GameInstance] = [\n GameInstance(\n client=self._client,\n data=instance_data\n ) for instance_data in data[\"Collection\"]\n ]\n self.total_collection_size: int = data[\"TotalCollectionSize\"]\n
"},{"location":"reference/jobs/#roblox.jobs.PrivateServer","title":"PrivateServer
","text":" Bases: Server
Represents a private server.
Attributes:
Name Type Descriptionid
The private server's job id.
vip_server_id
int
The private server's vipServerId.
max_players
int
The maximum number of players that can be in the server at once.
playing
int
The amount of players in the server.
player_tokens
int
A list of thumbnail tokens for all the players in the server.
players
int
A list of ServerPlayer objects representing the players in the server. Only friends of the authenticated user will show up here.
fps
int
The server's fps.
ping
int
The server's ping.
name
str
The private server's name.
access_code
str
The private server's access code.
owner
PartialUser
A PartialUser object representing the owner of the private server.
Source code inroblox/jobs.py
class PrivateServer(Server):\n \"\"\"\n Represents a private server.\n\n Attributes:\n id: The private server's job id.\n vip_server_id: The private server's vipServerId.\n max_players: The maximum number of players that can be in the server at once.\n playing: The amount of players in the server.\n player_tokens: A list of thumbnail tokens for all the players in the server.\n players: A list of ServerPlayer objects representing the players in the server. Only friends of the authenticated user will show up here.\n fps: The server's fps.\n ping: The server's ping.\n name: The private server's name.\n access_code: The private server's access code.\n owner: A PartialUser object representing the owner of the private server.\n \"\"\"\n\n def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: The Client this object belongs to.\n data: A PrivateServerResponse object.\n \"\"\"\n\n super().__init__(client=client, data=data)\n\n self.name: str = data[\"name\"]\n self.vip_server_id: int = data[\"vipServerId\"]\n self.access_code: str = data[\"accessCode\"]\n self.owner: PartialUser = PartialUser(client=self._client, data=data[\"owner\"])\n
"},{"location":"reference/jobs/#roblox.jobs.PrivateServer.__init__","title":"__init__(client, data)
","text":"Parameters:
Name Type Description Defaultclient
Client
The Client this object belongs to.
requireddata
dict
A PrivateServerResponse object.
required Source code inroblox/jobs.py
def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: The Client this object belongs to.\n data: A PrivateServerResponse object.\n \"\"\"\n\n super().__init__(client=client, data=data)\n\n self.name: str = data[\"name\"]\n self.vip_server_id: int = data[\"vipServerId\"]\n self.access_code: str = data[\"accessCode\"]\n self.owner: PartialUser = PartialUser(client=self._client, data=data[\"owner\"])\n
"},{"location":"reference/jobs/#roblox.jobs.Server","title":"Server
","text":" Bases: BaseItem
Represents a public server.
Attributes:
Name Type Descriptionid
Optional[str]
The server's job id.
max_players
int
The maximum number of players that can be in the server at once.
playing
int
The amount of players in the server.
player_tokens
List[str]
A list of thumbnail tokens for all the players in the server.
players
List[ServerPlayer]
A list of ServerPlayer objects representing the players in the server. Only friends of the authenticated user will show up here.
fps
float
The server's fps.
ping
Optional[int]
The server's ping.
Source code inroblox/jobs.py
class Server(BaseItem):\n \"\"\"\n Represents a public server.\n\n Attributes:\n id: The server's job id.\n max_players: The maximum number of players that can be in the server at once.\n playing: The amount of players in the server.\n player_tokens: A list of thumbnail tokens for all the players in the server.\n players: A list of ServerPlayer objects representing the players in the server. Only friends of the authenticated user will show up here.\n fps: The server's fps.\n ping: The server's ping.\n \"\"\"\n\n def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: The Client this object belongs to.\n data: A GameServerResponse object.\n \"\"\"\n\n self._client: Client = client\n\n self.id: Optional[str] = data.get(\"id\")\n self.max_players: int = data[\"maxPlayers\"]\n self.playing: int = data.get(\"playing\", 0)\n self.player_tokens: List[str] = data[\"playerTokens\"]\n self.players: List[ServerPlayer] = [\n ServerPlayer(client=self._client, data=player_data) \n for player_data in data[\"players\"]\n ]\n\n self.fps: float = data.get(\"fps\")\n self.ping: Optional[int] = data.get(\"ping\")\n
"},{"location":"reference/jobs/#roblox.jobs.Server.__init__","title":"__init__(client, data)
","text":"Parameters:
Name Type Description Defaultclient
Client
The Client this object belongs to.
requireddata
dict
A GameServerResponse object.
required Source code inroblox/jobs.py
def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: The Client this object belongs to.\n data: A GameServerResponse object.\n \"\"\"\n\n self._client: Client = client\n\n self.id: Optional[str] = data.get(\"id\")\n self.max_players: int = data[\"maxPlayers\"]\n self.playing: int = data.get(\"playing\", 0)\n self.player_tokens: List[str] = data[\"playerTokens\"]\n self.players: List[ServerPlayer] = [\n ServerPlayer(client=self._client, data=player_data) \n for player_data in data[\"players\"]\n ]\n\n self.fps: float = data.get(\"fps\")\n self.ping: Optional[int] = data.get(\"ping\")\n
"},{"location":"reference/jobs/#roblox.jobs.ServerPlayer","title":"ServerPlayer
","text":" Bases: BaseUser
Represents a player in a server.
Attributes:
Name Type Descriptionid
The player's user id.
name
str
The player's username.
display_name
str
The player's display name.
player_token
str
The player's token.
Source code inroblox/jobs.py
class ServerPlayer(BaseUser):\n \"\"\"\n Represents a player in a server.\n\n Attributes:\n id: The player's user id.\n name: The player's username.\n display_name: The player's display name.\n player_token: The player's token.\n \"\"\"\n\n def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: The Client this object belongs to.\n data: A GameServerPlayerResponse object.\n \"\"\"\n\n super().__init__(client=client, user_id=data[\"id\"])\n\n self.player_token: str = data[\"playerToken\"]\n self.name: str = data[\"name\"]\n self.display_name: str = data[\"displayName\"]\n
"},{"location":"reference/jobs/#roblox.jobs.ServerPlayer.__init__","title":"__init__(client, data)
","text":"Parameters:
Name Type Description Defaultclient
Client
The Client this object belongs to.
requireddata
dict
A GameServerPlayerResponse object.
required Source code inroblox/jobs.py
def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: The Client this object belongs to.\n data: A GameServerPlayerResponse object.\n \"\"\"\n\n super().__init__(client=client, user_id=data[\"id\"])\n\n self.player_token: str = data[\"playerToken\"]\n self.name: str = data[\"name\"]\n self.display_name: str = data[\"displayName\"]\n
"},{"location":"reference/jobs/#roblox.jobs.ServerType","title":"ServerType
","text":" Bases: Enum
Represents the type of server.
Source code inroblox/jobs.py
class ServerType(Enum):\n \"\"\"\n Represents the type of server.\n \"\"\"\n\n public = \"Public\"\n friend = \"Friend\"\n
"},{"location":"reference/members/","title":"members","text":"This module contains classes intended to parse and deal with data from Roblox group member endpoints.
"},{"location":"reference/members/#roblox.members.Member","title":"Member
","text":" Bases: MemberRelationship
Represents a group member.
Attributes:
Name Type Descriptionid
int
The member's ID.
name
str
The member's name.
display_name
str
The member's display name.
role
PartialRole
The member's role.
group
BaseGroup
The member's group.
has_verified_badge
bool
If the member has a verified badge.
Source code inroblox/members.py
class Member(MemberRelationship):\n \"\"\"\n Represents a group member.\n\n Attributes:\n id: The member's ID.\n name: The member's name.\n display_name: The member's display name.\n role: The member's role.\n group: The member's group.\n has_verified_badge: If the member has a verified badge.\n \"\"\"\n\n def __init__(self, client: Client, data: dict, group: BaseGroup):\n self._client: Client = client\n\n self.id: int = data[\"user\"][\"userId\"]\n self.name: str = data[\"user\"][\"username\"]\n self.display_name: str = data[\"user\"][\"displayName\"]\n self.has_verified_badge: bool = data[\"user\"][\"hasVerifiedBadge\"]\n\n super().__init__(client=self._client, user=self.id, group=group)\n\n self.role: PartialRole = PartialRole(client=self._client, data=data[\"role\"])\n self.group: BaseGroup = group\n
"},{"location":"reference/members/#roblox.members.MemberRelationship","title":"MemberRelationship
","text":" Bases: BaseUser
Represents a relationship between a user and a group.
Attributes:
Name Type Descriptiongroup
BaseGroup
The corresponding group.
Source code inroblox/members.py
class MemberRelationship(BaseUser):\n \"\"\"\n Represents a relationship between a user and a group.\n\n Attributes:\n group: The corresponding group.\n \"\"\"\n\n def __init__(self, client: Client, user: Union[BaseUser, int], group: Union[BaseGroup, int]):\n self._client: Client = client\n super().__init__(client=self._client, user_id=int(user))\n\n self.group: BaseGroup\n\n if isinstance(group, int):\n self.group = BaseGroup(client=self._client, group_id=group)\n else:\n self.group = group\n\n async def set_role(self, role: RoleOrRoleId):\n \"\"\"\n Sets this member's role.\n\n Arguments:\n role: The new role this member should be assigned.\n \"\"\"\n await self.group.set_role(self, role)\n\n async def set_rank(self, rank: int):\n \"\"\"\n Sets this member's rank.\n\n Arguments:\n rank: The new rank this member should be assigned. Should be in the range of 0-255.\n \"\"\"\n await self.group.set_rank(self, rank)\n\n async def kick(self):\n \"\"\"\n Kicks this member from the group.\n \"\"\"\n await self.group.kick_user(self)\n\n async def delete_all_messages(self):\n \"\"\"\n Deletes all wall posts created by this member in the group.\n \"\"\"\n await self.group.delete_all_messages(self)\n
"},{"location":"reference/members/#roblox.members.MemberRelationship.delete_all_messages","title":"delete_all_messages()
async
","text":"Deletes all wall posts created by this member in the group.
Source code inroblox/members.py
async def delete_all_messages(self):\n \"\"\"\n Deletes all wall posts created by this member in the group.\n \"\"\"\n await self.group.delete_all_messages(self)\n
"},{"location":"reference/members/#roblox.members.MemberRelationship.kick","title":"kick()
async
","text":"Kicks this member from the group.
Source code inroblox/members.py
async def kick(self):\n \"\"\"\n Kicks this member from the group.\n \"\"\"\n await self.group.kick_user(self)\n
"},{"location":"reference/members/#roblox.members.MemberRelationship.set_rank","title":"set_rank(rank)
async
","text":"Sets this member's rank.
Parameters:
Name Type Description Defaultrank
int
The new rank this member should be assigned. Should be in the range of 0-255.
required Source code inroblox/members.py
async def set_rank(self, rank: int):\n \"\"\"\n Sets this member's rank.\n\n Arguments:\n rank: The new rank this member should be assigned. Should be in the range of 0-255.\n \"\"\"\n await self.group.set_rank(self, rank)\n
"},{"location":"reference/members/#roblox.members.MemberRelationship.set_role","title":"set_role(role)
async
","text":"Sets this member's role.
Parameters:
Name Type Description Defaultrole
RoleOrRoleId
The new role this member should be assigned.
required Source code inroblox/members.py
async def set_role(self, role: RoleOrRoleId):\n \"\"\"\n Sets this member's role.\n\n Arguments:\n role: The new role this member should be assigned.\n \"\"\"\n await self.group.set_role(self, role)\n
"},{"location":"reference/places/","title":"places","text":"This module contains classes intended to parse and deal with data from Roblox place information endpoints.
"},{"location":"reference/places/#roblox.places.Place","title":"Place
","text":" Bases: BasePlace
Represents a Roblox place.
Attributes:
Name Type Descriptionid
int
id of the place.
name
str
Name of the place.
description
str
Description of the place.
url
str
URL for the place.
builder
str
The name of the user or group who owns the place.
builder_id
int
The ID of the player or group who owns the place.
is_playable
bool
Whether the authenticated user can play this game.
reason_prohibited
str
If the place is not playable, contains the reason why the user cannot play the game.
universe
BaseUniverse
The BaseUniverse that contains this place.
universe_root_place
BasePlace
The root place that the universe contains.
price
int
How much it costs to play the game.
image_token
str
Can be used to generate thumbnails for this place.
has_verified_badge
bool
If the place has a verified badge.
Source code inroblox/places.py
class Place(BasePlace):\n \"\"\"\n Represents a Roblox place.\n\n Attributes:\n id: id of the place.\n name: Name of the place.\n description: Description of the place.\n url: URL for the place.\n builder: The name of the user or group who owns the place.\n builder_id: The ID of the player or group who owns the place.\n is_playable: Whether the authenticated user can play this game.\n reason_prohibited: If the place is not playable, contains the reason why the user cannot play the game.\n universe: The BaseUniverse that contains this place.\n universe_root_place: The root place that the universe contains.\n price: How much it costs to play the game.\n image_token: Can be used to generate thumbnails for this place.\n has_verified_badge: If the place has a verified badge.\n \"\"\"\n\n def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: The Client object, which is passed to all objects this Client generates.\n data: data to make the magic happen.\n \"\"\"\n super().__init__(client=client, place_id=data[\"placeId\"])\n\n self._client: Client = client\n\n self.id: int = data[\"placeId\"]\n self.name: str = data[\"name\"]\n self.description: str = data[\"description\"]\n self.url: str = data[\"url\"]\n\n self.builder: str = data[\"builder\"]\n self.builder_id: int = data[\"builderId\"]\n\n self.is_playable: bool = data[\"isPlayable\"]\n self.reason_prohibited: str = data[\"reasonProhibited\"]\n self.universe: BaseUniverse = BaseUniverse(client=self._client, universe_id=data[\"universeId\"])\n self.universe_root_place: BasePlace = BasePlace(client=self._client, place_id=data[\"universeRootPlaceId\"])\n\n self.price: int = data[\"price\"]\n self.image_token: str = data[\"imageToken\"]\n self.has_verified_badge: bool = data[\"hasVerifiedBadge\"]\n
"},{"location":"reference/places/#roblox.places.Place.__init__","title":"__init__(client, data)
","text":"Parameters:
Name Type Description Defaultclient
Client
The Client object, which is passed to all objects this Client generates.
requireddata
dict
data to make the magic happen.
required Source code inroblox/places.py
def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: The Client object, which is passed to all objects this Client generates.\n data: data to make the magic happen.\n \"\"\"\n super().__init__(client=client, place_id=data[\"placeId\"])\n\n self._client: Client = client\n\n self.id: int = data[\"placeId\"]\n self.name: str = data[\"name\"]\n self.description: str = data[\"description\"]\n self.url: str = data[\"url\"]\n\n self.builder: str = data[\"builder\"]\n self.builder_id: int = data[\"builderId\"]\n\n self.is_playable: bool = data[\"isPlayable\"]\n self.reason_prohibited: str = data[\"reasonProhibited\"]\n self.universe: BaseUniverse = BaseUniverse(client=self._client, universe_id=data[\"universeId\"])\n self.universe_root_place: BasePlace = BasePlace(client=self._client, place_id=data[\"universeRootPlaceId\"])\n\n self.price: int = data[\"price\"]\n self.image_token: str = data[\"imageToken\"]\n self.has_verified_badge: bool = data[\"hasVerifiedBadge\"]\n
"},{"location":"reference/plugins/","title":"plugins","text":"This module contains classes intended to parse and deal with data from Roblox plugin information endpoints.
"},{"location":"reference/plugins/#roblox.plugins.Plugin","title":"Plugin
","text":" Bases: BasePlugin
Represents a Roblox plugin. It is intended to parse data from https://develop.roblox.com/v1/plugins.
Attributes:
Name Type Descriptionid
int
The ID of the plugin.
name
str
The name of the plugin.
description
str
The plugin's description.
comments_enabled
bool
Whether comments are enabled or disabled.
version_id
int
The plugin's current version ID.
created
datetime
When the plugin was created.
updated
datetime
When the plugin was updated.
Source code inroblox/plugins.py
class Plugin(BasePlugin):\n \"\"\"\n Represents a Roblox plugin.\n It is intended to parse data from https://develop.roblox.com/v1/plugins.\n\n Attributes:\n id: The ID of the plugin.\n name: The name of the plugin.\n description: The plugin's description.\n comments_enabled: Whether comments are enabled or disabled.\n version_id: The plugin's current version ID.\n created: When the plugin was created.\n updated: When the plugin was updated.\n \"\"\"\n\n def __init__(self, client: Client, data: dict):\n \"\"\"\n Attributes:\n client: The Client object, which is passed to all objects this Client generates.\n data: data to make the magic happen.\n \"\"\"\n super().__init__(client=client, plugin_id=data[\"id\"])\n\n self.id: int = data[\"id\"]\n self.name: str = data[\"name\"]\n self.description: str = data[\"description\"]\n self.comments_enabled: bool = data[\"commentsEnabled\"]\n self.version_id: int = data[\"versionId\"]\n self.created: datetime = parse(data[\"created\"])\n self.updated: datetime = parse(data[\"updated\"])\n
"},{"location":"reference/plugins/#roblox.plugins.Plugin.__init__","title":"__init__(client, data)
","text":"Attributes:
Name Type Descriptionclient
The Client object, which is passed to all objects this Client generates.
data
data to make the magic happen.
Source code inroblox/plugins.py
def __init__(self, client: Client, data: dict):\n \"\"\"\n Attributes:\n client: The Client object, which is passed to all objects this Client generates.\n data: data to make the magic happen.\n \"\"\"\n super().__init__(client=client, plugin_id=data[\"id\"])\n\n self.id: int = data[\"id\"]\n self.name: str = data[\"name\"]\n self.description: str = data[\"description\"]\n self.comments_enabled: bool = data[\"commentsEnabled\"]\n self.version_id: int = data[\"versionId\"]\n self.created: datetime = parse(data[\"created\"])\n self.updated: datetime = parse(data[\"updated\"])\n
"},{"location":"reference/presence/","title":"presence","text":"This module contains classes intended to parse and deal with data from Roblox presence endpoints.
"},{"location":"reference/presence/#roblox.presence.Presence","title":"Presence
","text":"Represents a user's presence.
Attributes:
Name Type Descriptionuser_presence_type
PresenceType
The type of the presence.
last_location
str
A string representing the user's last location.
place
Optional[BasePlace]
The place the user is playing or editing.
root_place
Optional[BasePlace]
The root place of the parent universe of the last place the user is playing or editing.
job
Optional[BaseJob]
The job of the root place that the user is playing or editing.
universe
Optional[BaseUniverse]
The universe the user is playing or editing.
last_online
datetime
When the user was last online.
user
BaseUser
The user this presence belongs to.
Source code inroblox/presence.py
class Presence:\n \"\"\"\n Represents a user's presence.\n\n Attributes:\n user_presence_type: The type of the presence.\n last_location: A string representing the user's last location.\n place: The place the user is playing or editing.\n root_place: The root place of the parent universe of the last place the user is playing or editing.\n job: The job of the root place that the user is playing or editing.\n universe: The universe the user is playing or editing.\n last_online: When the user was last online.\n user: The user this presence belongs to.\n \"\"\"\n\n def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: Client object.\n data: The data from the request.\n \"\"\"\n self._client: Client = client\n\n self.user_presence_type: PresenceType = PresenceType(data[\"userPresenceType\"])\n self.last_location: str = data[\"lastLocation\"]\n\n self.place: Optional[BasePlace] = BasePlace(\n client=client,\n place_id=data[\"placeId\"]\n ) if data.get(\"placeId\") else None\n\n self.root_place: Optional[BasePlace] = BasePlace(\n client=client,\n place_id=data[\"rootPlaceId\"]\n ) if data.get(\"rootPlaceId\") else None\n\n self.job: Optional[BaseJob] = BaseJob(self._client, data[\"gameId\"]) if data.get(\"gameId\") else None\n\n self.universe: Optional[BaseUniverse] = BaseUniverse(\n client=client,\n universe_id=data[\"universeId\"]\n ) if data.get(\"universeId\") else None\n\n self.user: BaseUser = client.get_base_user(data[\"userId\"])\n self.last_online: datetime = parse(data[\"lastOnline\"])\n\n def __repr__(self):\n return f\"<{self.__class__.__name__} user_presence_type={self.user_presence_type}>\"\n
"},{"location":"reference/presence/#roblox.presence.Presence.__init__","title":"__init__(client, data)
","text":"Parameters:
Name Type Description Defaultclient
Client
Client object.
requireddata
dict
The data from the request.
required Source code inroblox/presence.py
def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: Client object.\n data: The data from the request.\n \"\"\"\n self._client: Client = client\n\n self.user_presence_type: PresenceType = PresenceType(data[\"userPresenceType\"])\n self.last_location: str = data[\"lastLocation\"]\n\n self.place: Optional[BasePlace] = BasePlace(\n client=client,\n place_id=data[\"placeId\"]\n ) if data.get(\"placeId\") else None\n\n self.root_place: Optional[BasePlace] = BasePlace(\n client=client,\n place_id=data[\"rootPlaceId\"]\n ) if data.get(\"rootPlaceId\") else None\n\n self.job: Optional[BaseJob] = BaseJob(self._client, data[\"gameId\"]) if data.get(\"gameId\") else None\n\n self.universe: Optional[BaseUniverse] = BaseUniverse(\n client=client,\n universe_id=data[\"universeId\"]\n ) if data.get(\"universeId\") else None\n\n self.user: BaseUser = client.get_base_user(data[\"userId\"])\n self.last_online: datetime = parse(data[\"lastOnline\"])\n
"},{"location":"reference/presence/#roblox.presence.PresenceProvider","title":"PresenceProvider
","text":"The PresenceProvider is an object that represents https://presence.roblox.com/ and provides multiple functions for fetching user presence information.
Source code inroblox/presence.py
class PresenceProvider:\n \"\"\"\n The PresenceProvider is an object that represents https://presence.roblox.com/ and provides multiple functions\n for fetching user presence information.\n \"\"\"\n\n def __init__(self, client: Client):\n self._client: Client = client\n\n async def get_user_presences(self, users: List[UserOrUserId]) -> List[Presence]:\n \"\"\"\n Grabs a list of Presence objects corresponding to each user in the list.\n\n Arguments:\n users: The list of users you want to get Presences from.\n\n Returns:\n A list of Presences.\n \"\"\"\n\n presences_response = await self._client.requests.post(\n url=self._client.url_generator.get_url(\"presence\", \"v1/presence/users\"),\n json={\n \"userIds\": list(map(int, users))\n }\n )\n presences_data = presences_response.json()[\"userPresences\"]\n return [Presence(client=self._client, data=presence_data) for presence_data in presences_data]\n
"},{"location":"reference/presence/#roblox.presence.PresenceProvider.get_user_presences","title":"get_user_presences(users)
async
","text":"Grabs a list of Presence objects corresponding to each user in the list.
Parameters:
Name Type Description Defaultusers
List[UserOrUserId]
The list of users you want to get Presences from.
requiredReturns:
Type DescriptionList[Presence]
A list of Presences.
Source code inroblox/presence.py
async def get_user_presences(self, users: List[UserOrUserId]) -> List[Presence]:\n \"\"\"\n Grabs a list of Presence objects corresponding to each user in the list.\n\n Arguments:\n users: The list of users you want to get Presences from.\n\n Returns:\n A list of Presences.\n \"\"\"\n\n presences_response = await self._client.requests.post(\n url=self._client.url_generator.get_url(\"presence\", \"v1/presence/users\"),\n json={\n \"userIds\": list(map(int, users))\n }\n )\n presences_data = presences_response.json()[\"userPresences\"]\n return [Presence(client=self._client, data=presence_data) for presence_data in presences_data]\n
"},{"location":"reference/presence/#roblox.presence.PresenceType","title":"PresenceType
","text":" Bases: IntEnum
Represents a user's presence type.
Source code inroblox/presence.py
class PresenceType(IntEnum):\n \"\"\"\n Represents a user's presence type.\n \"\"\"\n offline = 0\n online = 1\n in_game = 2\n in_studio = 3\n
"},{"location":"reference/promotionchannels/","title":"promotionchannels","text":"This module contains classes intended to parse and deal with data from Roblox promotion channel endpoints.
"},{"location":"reference/promotionchannels/#roblox.promotionchannels.UserPromotionChannels","title":"UserPromotionChannels
","text":"Represents a user's promotion channels.
Attributes:
Name Type Descriptionfacebook
Optional[str]
A link to the user's Facebook profile.
twitter
Optional[str]
A Twitter handle.
youtube
Optional[str]
A link to the user's YouTube channel.
twitch
Optional[str]
A link to the user's Twitch channel.
Source code inroblox/promotionchannels.py
class UserPromotionChannels:\n \"\"\"\n Represents a user's promotion channels.\n\n Attributes:\n facebook: A link to the user's Facebook profile.\n twitter: A Twitter handle.\n youtube: A link to the user's YouTube channel.\n twitch: A link to the user's Twitch channel.\n \"\"\"\n\n def __init__(self, data: dict):\n self.facebook: Optional[str] = data[\"facebook\"]\n self.twitter: Optional[str] = data[\"twitter\"]\n self.youtube: Optional[str] = data[\"youtube\"]\n self.twitch: Optional[str] = data[\"twitch\"]\n self.guilded: Optional[str] = data[\"guilded\"]\n\n def __repr__(self):\n return f\"<{self.__class__.__name__}>\"\n
"},{"location":"reference/resale/","title":"resale","text":"Contains classes related to Roblox resale.
"},{"location":"reference/resale/#roblox.resale.AssetResaleData","title":"AssetResaleData
","text":"Represents an asset's resale data.
Attributes:
Name Type Descriptionasset_stock
int
The asset's stock.
sales
int
The asset's sales.
number_remaining
int
On a Limited U item that hasn't ran out, this is the amount remaining.
recent_average_price
int
The item's recent average price.
original_price
int
What price this item was originally sold at.
price_data_points
List[dict]
A list of tuples containing a limited item's price points over time.
Source code inroblox/resale.py
class AssetResaleData:\n \"\"\"\n Represents an asset's resale data.\n\n Attributes:\n asset_stock: The asset's stock.\n sales: The asset's sales.\n number_remaining: On a Limited U item that hasn't ran out, this is the amount remaining.\n recent_average_price: The item's recent average price.\n original_price: What price this item was originally sold at.\n price_data_points: A list of tuples containing a limited item's price points over time.\n \"\"\"\n\n def __init__(self, data: dict):\n self.asset_stock: int = data[\"assetStock\"]\n self.sales: int = data[\"sales\"]\n self.number_remaining: int = data[\"numberRemaining\"]\n self.recent_average_price: int = data[\"recentAveragePrice\"]\n self.original_price: int = data[\"originalPrice\"]\n self.price_data_points: List[dict] = data[\"priceDataPoints\"]\n
"},{"location":"reference/robloxbadges/","title":"robloxbadges","text":"This module contains classes intended to parse and deal with data from Roblox badge endpoints.
"},{"location":"reference/robloxbadges/#roblox.robloxbadges.RobloxBadge","title":"RobloxBadge
","text":" Bases: BaseRobloxBadge
Represents a Roblox roblox badge.
Attributes:
Name Type Descriptionid
int
The badge's ID.
name
str
The badge's name.
description
str
The badge's description.
image_url
str
A link to the badge's image.
Source code inroblox/robloxbadges.py
class RobloxBadge(BaseRobloxBadge):\n \"\"\"\n Represents a Roblox roblox badge.\n\n Attributes:\n id: The badge's ID.\n name: The badge's name.\n description: The badge's description.\n image_url: A link to the badge's image.\n \"\"\"\n\n def __init__(self, client: Client, data: dict):\n self._client: Client = client\n self.id: int = data[\"id\"]\n super().__init__(client=self._client, roblox_badge_id=self.id)\n\n self.name: str = data[\"name\"]\n self.description: str = data[\"description\"]\n self.image_url: str = data[\"imageUrl\"]\n
"},{"location":"reference/roles/","title":"roles","text":"This module contains classes intended to parse and deal with data from Roblox group role endpoints.
"},{"location":"reference/roles/#roblox.roles.Role","title":"Role
","text":" Bases: BaseRole
Represents a Roblox group's role.
Attributes:
Name Type Descriptionid
int
The role's ID.
group
Optional[BaseGroup]
The group that this role is a part of.
name
str
The role's name.
description
Optional[str]
The role's description.
rank
int
The rank, from 0-255, of this role.
member_count
Optional[int]
How many members exist with this role.
Source code inroblox/roles.py
class Role(BaseRole):\n \"\"\"\n Represents a Roblox group's role.\n\n Attributes:\n id: The role's ID.\n group: The group that this role is a part of.\n name: The role's name.\n description: The role's description.\n rank: The rank, from 0-255, of this role.\n member_count: How many members exist with this role.\n \"\"\"\n\n def __init__(self, client: Client, data: dict, group: BaseGroup = None):\n \"\"\"\n Arguments:\n client: The Client object.\n data: The raw role data.\n group: The parent group.\n \"\"\"\n self._client: Client = client\n\n self.id: int = data[\"id\"]\n super().__init__(client=self._client, role_id=self.id)\n\n self.group: Optional[BaseGroup] = group\n self.name: str = data[\"name\"]\n self.description: Optional[str] = data.get(\"description\")\n self.rank: int = data[\"rank\"]\n self.member_count: Optional[int] = data.get(\"memberCount\")\n\n def get_members(self, page_size: int = 10, sort_order: SortOrder = SortOrder.Ascending,\n max_items: int = None) -> PageIterator:\n \"\"\"\n Gets all members with this role.\n\n Arguments:\n page_size: How many users should be returned for each page.\n sort_order: Order in which data should be grabbed.\n max_items: The maximum items to return when looping through this object.\n\n Returns:\n A PageIterator containing all members with this role.\n \"\"\"\n return PageIterator(\n client=self._client,\n url=self._client.url_generator.get_url(\"groups\", f\"v1/groups/{self.group.id}/roles/{self.id}/users\"),\n page_size=page_size,\n sort_order=sort_order,\n max_items=max_items,\n handler=lambda client, data: PartialUser(client=client, data=data)\n )\n
"},{"location":"reference/roles/#roblox.roles.Role.__init__","title":"__init__(client, data, group=None)
","text":"Parameters:
Name Type Description Defaultclient
Client
The Client object.
requireddata
dict
The raw role data.
requiredgroup
BaseGroup
The parent group.
None
Source code in roblox/roles.py
def __init__(self, client: Client, data: dict, group: BaseGroup = None):\n \"\"\"\n Arguments:\n client: The Client object.\n data: The raw role data.\n group: The parent group.\n \"\"\"\n self._client: Client = client\n\n self.id: int = data[\"id\"]\n super().__init__(client=self._client, role_id=self.id)\n\n self.group: Optional[BaseGroup] = group\n self.name: str = data[\"name\"]\n self.description: Optional[str] = data.get(\"description\")\n self.rank: int = data[\"rank\"]\n self.member_count: Optional[int] = data.get(\"memberCount\")\n
"},{"location":"reference/roles/#roblox.roles.Role.get_members","title":"get_members(page_size=10, sort_order=SortOrder.Ascending, max_items=None)
","text":"Gets all members with this role.
Parameters:
Name Type Description Defaultpage_size
int
How many users should be returned for each page.
10
sort_order
SortOrder
Order in which data should be grabbed.
Ascending
max_items
int
The maximum items to return when looping through this object.
None
Returns:
Type DescriptionPageIterator
A PageIterator containing all members with this role.
Source code inroblox/roles.py
def get_members(self, page_size: int = 10, sort_order: SortOrder = SortOrder.Ascending,\n max_items: int = None) -> PageIterator:\n \"\"\"\n Gets all members with this role.\n\n Arguments:\n page_size: How many users should be returned for each page.\n sort_order: Order in which data should be grabbed.\n max_items: The maximum items to return when looping through this object.\n\n Returns:\n A PageIterator containing all members with this role.\n \"\"\"\n return PageIterator(\n client=self._client,\n url=self._client.url_generator.get_url(\"groups\", f\"v1/groups/{self.group.id}/roles/{self.id}/users\"),\n page_size=page_size,\n sort_order=sort_order,\n max_items=max_items,\n handler=lambda client, data: PartialUser(client=client, data=data)\n )\n
"},{"location":"reference/shout/","title":"shout","text":"Contains the Shout object, which represents a group's shout.
"},{"location":"reference/shout/#roblox.shout.Shout","title":"Shout
","text":"Represents a Group Shout.
Attributes:
Name Type Descriptionbody
str
The text of the shout.
created
datetime
When the shout was created.
updated
datetime
When the shout was updated.
poster
PartialUser
Who posted the shout.
Source code inroblox/shout.py
class Shout:\n \"\"\"\n Represents a Group Shout.\n\n Attributes:\n body: The text of the shout.\n created: When the shout was created.\n updated: When the shout was updated.\n poster: Who posted the shout.\n \"\"\"\n\n def __init__(\n self,\n client: Client,\n data: dict\n ):\n \"\"\"\n Arguments:\n client: Client object.\n data: The data from the request.\n \"\"\"\n self._client: Client = client\n\n self.body: str = data[\"body\"]\n self.created: datetime = parse(data[\"created\"])\n self.updated: datetime = parse(data[\"updated\"])\n self.poster: PartialUser = PartialUser(\n client=self._client,\n data=data[\"poster\"]\n )\n\n def __repr__(self):\n return f\"<{self.__class__.__name__} created={self.created} updated={self.updated} body={self.body!r} \" \\\n f\"poster={self.poster!r}>\"\n
"},{"location":"reference/shout/#roblox.shout.Shout.__init__","title":"__init__(client, data)
","text":"Parameters:
Name Type Description Defaultclient
Client
Client object.
requireddata
dict
The data from the request.
required Source code inroblox/shout.py
def __init__(\n self,\n client: Client,\n data: dict\n):\n \"\"\"\n Arguments:\n client: Client object.\n data: The data from the request.\n \"\"\"\n self._client: Client = client\n\n self.body: str = data[\"body\"]\n self.created: datetime = parse(data[\"created\"])\n self.updated: datetime = parse(data[\"updated\"])\n self.poster: PartialUser = PartialUser(\n client=self._client,\n data=data[\"poster\"]\n )\n
"},{"location":"reference/sociallinks/","title":"sociallinks","text":"Contains objects related to Roblox social links.
"},{"location":"reference/sociallinks/#roblox.sociallinks.SocialLink","title":"SocialLink
","text":" Bases: BaseUniverseSocialLink
Represents a universe or group's social links.
Attributes:
Name Type Descriptionid
int
The social link's ID.
title
str
The social link's title.
url
str
The social link's URL.
type
SocialLinkType
The social link's type.
Source code inroblox/sociallinks.py
class SocialLink(BaseUniverseSocialLink):\n \"\"\"\n Represents a universe or group's social links.\n\n Attributes:\n id: The social link's ID.\n title: The social link's title.\n url: The social link's URL.\n type: The social link's type.\n \"\"\"\n\n def __init__(self, client: Client, data: dict):\n self._client: Client = client\n self.id: int = data[\"id\"]\n super().__init__(client=self._client, social_link_id=self.id)\n self.title: str = data[\"title\"]\n self.url: str = data[\"url\"]\n self.type: SocialLinkType = SocialLinkType(data[\"type\"])\n
"},{"location":"reference/sociallinks/#roblox.sociallinks.SocialLinkType","title":"SocialLinkType
","text":" Bases: Enum
Represents a type of social link.
Source code inroblox/sociallinks.py
class SocialLinkType(Enum):\n \"\"\"\n Represents a type of social link.\n \"\"\"\n\n facebook = \"Facebook\"\n twitter = \"Twitter\"\n youtube = \"YouTube\"\n twitch = \"Twitch\"\n discord = \"Discord\"\n roblox_group = \"RobloxGroup\"\n
"},{"location":"reference/threedthumbnails/","title":"threedthumbnails","text":"Contains classes related to 3D thumbnails.
"},{"location":"reference/threedthumbnails/#roblox.threedthumbnails.ThreeDThumbnail","title":"ThreeDThumbnail
","text":"Represents a user's 3D Thumbnail data. For more info, see https://robloxapi.wiki/wiki/3D_Thumbnails.
Attributes:
Name Type Descriptionmtl
ThumbnailCDNHash
A CDN hash pointing to the MTL data.
obj
ThumbnailCDNHash
A CDN hash pointing to the OBJ data.
textures
List[ThumbnailCDNHash]
A list of CDN hashes pointing to PNG texture data.
camera
ThreeDThumbnailCamera
The camera object.
aabb
ThreeDThumbnailAABB
The AABB object.
Source code inroblox/threedthumbnails.py
class ThreeDThumbnail:\n \"\"\"\n Represents a user's 3D Thumbnail data.\n For more info, see https://robloxapi.wiki/wiki/3D_Thumbnails.\n\n Attributes:\n mtl: A CDN hash pointing to the MTL data.\n obj: A CDN hash pointing to the OBJ data.\n textures: A list of CDN hashes pointing to PNG texture data.\n camera: The camera object.\n aabb: The AABB object.\n \"\"\"\n\n def __init__(self, client: Client, data: dict):\n self._client: Client = client\n\n self.mtl: ThumbnailCDNHash = self._client.delivery.get_thumbnail_cdn_hash(data[\"mtl\"])\n self.obj: ThumbnailCDNHash = self._client.delivery.get_thumbnail_cdn_hash(data[\"obj\"])\n self.textures: List[ThumbnailCDNHash] = [\n self._client.delivery.get_thumbnail_cdn_hash(cdn_hash) for cdn_hash in data[\"textures\"]\n ]\n self.camera: ThreeDThumbnailCamera = ThreeDThumbnailCamera(data[\"camera\"])\n self.aabb: ThreeDThumbnailAABB = ThreeDThumbnailAABB(data[\"aabb\"])\n
"},{"location":"reference/threedthumbnails/#roblox.threedthumbnails.ThreeDThumbnailAABB","title":"ThreeDThumbnailAABB
","text":"Represents AABB data in a 3D thumbnail. Roblox uses this data to calculate the maximum render distance used when rendering 3D thumbnails.
THREE.Vector3(json.aabb.max.x, json.aabb.max.y, json.aabb.max.z).length() * 4;\n
Attributes:
Name Type Descriptionmin
ThreeDThumbnailVector3
The minimum render position.
max
ThreeDThumbnailVector3
The maximum render position.
Source code inroblox/threedthumbnails.py
class ThreeDThumbnailAABB:\n \"\"\"\n Represents AABB data in a 3D thumbnail.\n Roblox uses this data to calculate the maximum render distance used when rendering 3D thumbnails.\n ```js\n THREE.Vector3(json.aabb.max.x, json.aabb.max.y, json.aabb.max.z).length() * 4;\n ```\n\n Attributes:\n min: The minimum render position.\n max: The maximum render position.\n \"\"\"\n\n def __init__(self, data: dict):\n self.min: ThreeDThumbnailVector3 = ThreeDThumbnailVector3(data[\"min\"])\n self.max: ThreeDThumbnailVector3 = ThreeDThumbnailVector3(data[\"max\"])\n
"},{"location":"reference/threedthumbnails/#roblox.threedthumbnails.ThreeDThumbnailCamera","title":"ThreeDThumbnailCamera
","text":"Represents a camera in a 3D thumbnail.
Attributes:
Name Type Descriptionfov
float
The camera's field of view.
position
ThreeDThumbnailVector3
The camera's position.
direction
ThreeDThumbnailVector3
The camera's direction.
Source code inroblox/threedthumbnails.py
class ThreeDThumbnailCamera:\n \"\"\"\n Represents a camera in a 3D thumbnail.\n\n Attributes:\n fov: The camera's field of view.\n position: The camera's position.\n direction: The camera's direction.\n \"\"\"\n\n def __init__(self, data: dict):\n self.fov: float = data[\"fov\"]\n self.position: ThreeDThumbnailVector3 = ThreeDThumbnailVector3(data[\"position\"])\n self.direction: ThreeDThumbnailVector3 = ThreeDThumbnailVector3(data[\"direction\"])\n
"},{"location":"reference/threedthumbnails/#roblox.threedthumbnails.ThreeDThumbnailVector3","title":"ThreeDThumbnailVector3
","text":"Represents a Vector3 used in a 3D thumbnail.
Attributes:
Name Type Descriptionx
float
The X component of the vector.
y
float
The Y component of the vector.
z
float
The Z component of the vector.
Source code inroblox/threedthumbnails.py
class ThreeDThumbnailVector3:\n \"\"\"\n Represents a Vector3 used in a 3D thumbnail.\n\n Attributes:\n x: The X component of the vector.\n y: The Y component of the vector.\n z: The Z component of the vector.\n \"\"\"\n\n def __init__(self, data: dict):\n self.x: float = data[\"x\"]\n self.y: float = data[\"y\"]\n self.z: float = data[\"z\"]\n
"},{"location":"reference/thumbnails/","title":"thumbnails","text":"Contains objects related to Roblox thumbnails.
"},{"location":"reference/thumbnails/#roblox.thumbnails.AvatarThumbnailType","title":"AvatarThumbnailType
","text":" Bases: Enum
Type of avatar thumbnail.
Source code inroblox/thumbnails.py
class AvatarThumbnailType(Enum):\n \"\"\"\n Type of avatar thumbnail.\n \"\"\"\n\n full_body = \"full_body\"\n headshot = \"headshot\"\n bust = \"bust\"\n
"},{"location":"reference/thumbnails/#roblox.thumbnails.Thumbnail","title":"Thumbnail
","text":"Represents a Roblox thumbnail as returned by almost all endpoints on https://thumbnails.roblox.com/.
Attributes:
Name Type Descriptiontarget_id
int
The id of the target of the image.
state
ThumbnailState
The current state of the image.
image_url
Optional[str]
Url of the image.
Source code inroblox/thumbnails.py
class Thumbnail:\n \"\"\"\n Represents a Roblox thumbnail as returned by almost all endpoints on https://thumbnails.roblox.com/.\n\n Attributes:\n target_id: The id of the target of the image.\n state: The current state of the image.\n image_url: Url of the image.\n \"\"\"\n\n def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: Client object.\n data: The data from the request.\n \"\"\"\n self._client: Client = client\n\n self.target_id: int = data[\"targetId\"]\n self.state: ThumbnailState = ThumbnailState(data[\"state\"])\n self.image_url: Optional[str] = data[\"imageUrl\"]\n\n def __repr__(self):\n return f\"<{self.__class__.__name__} target_id={self.target_id} name={self.state!r} \" \\\n f\"image_url={self.image_url!r}>\"\n\n async def get_3d_data(self) -> ThreeDThumbnail:\n \"\"\"\n Generates 3D thumbnail data for this endpoint.\n\n Returns:\n A ThreeDThumbnail.\n \"\"\"\n threed_response = await self._client.requests.get(\n url=self.image_url\n )\n threed_data = threed_response.json()\n return ThreeDThumbnail(\n client=self._client,\n data=threed_data\n )\n
"},{"location":"reference/thumbnails/#roblox.thumbnails.Thumbnail.__init__","title":"__init__(client, data)
","text":"Parameters:
Name Type Description Defaultclient
Client
Client object.
requireddata
dict
The data from the request.
required Source code inroblox/thumbnails.py
def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: Client object.\n data: The data from the request.\n \"\"\"\n self._client: Client = client\n\n self.target_id: int = data[\"targetId\"]\n self.state: ThumbnailState = ThumbnailState(data[\"state\"])\n self.image_url: Optional[str] = data[\"imageUrl\"]\n
"},{"location":"reference/thumbnails/#roblox.thumbnails.Thumbnail.get_3d_data","title":"get_3d_data()
async
","text":"Generates 3D thumbnail data for this endpoint.
Returns:
Type DescriptionThreeDThumbnail
A ThreeDThumbnail.
Source code inroblox/thumbnails.py
async def get_3d_data(self) -> ThreeDThumbnail:\n \"\"\"\n Generates 3D thumbnail data for this endpoint.\n\n Returns:\n A ThreeDThumbnail.\n \"\"\"\n threed_response = await self._client.requests.get(\n url=self.image_url\n )\n threed_data = threed_response.json()\n return ThreeDThumbnail(\n client=self._client,\n data=threed_data\n )\n
"},{"location":"reference/thumbnails/#roblox.thumbnails.ThumbnailFormat","title":"ThumbnailFormat
","text":" Bases: Enum
Format returned by the endpoint.
Source code inroblox/thumbnails.py
class ThumbnailFormat(Enum):\n \"\"\"\n Format returned by the endpoint.\n \"\"\"\n\n png = \"Png\"\n jpeg = \"Jpeg\"\n
"},{"location":"reference/thumbnails/#roblox.thumbnails.ThumbnailProvider","title":"ThumbnailProvider
","text":"The ThumbnailProvider that provides multiple functions for generating user thumbnails.
Source code inroblox/thumbnails.py
class ThumbnailProvider:\n \"\"\"\n The ThumbnailProvider that provides multiple functions for generating user thumbnails.\n \"\"\"\n\n def __init__(self, client: Client):\n \"\"\"\n Arguments:\n client: Client object.\n \"\"\"\n self._client: Client = client\n\n async def get_asset_thumbnails(\n self,\n assets: List[AssetOrAssetId],\n return_policy: ThumbnailReturnPolicy = ThumbnailReturnPolicy.place_holder,\n size: SizeTupleOrString = (30, 30),\n image_format: ThumbnailFormat = ThumbnailFormat.png,\n is_circular: bool = False,\n ) -> List[Thumbnail]:\n \"\"\"\n Returns asset thumbnails for the asset ID passed.\n Supported sizes: \n - 30x30 \n - 42x42 \n - 50x50 \n - 60x62 \n - 75x75 \n - 110x110 \n - 140x140 \n - 150x150 \n - 160x100 \n - 160x600 \n - 250x250 \n - 256x144 \n - 300x250 \n - 304x166 \n - 384x216 \n - 396x216 \n - 420x420 \n - 480x270 \n - 512x512 \n - 576x324 \n - 700x700 \n - 728x90 \n - 768x432 \n\n Arguments:\n assets: Assets you want the thumbnails of.\n return_policy: How you want it returns look at enum.\n size: size of the image.\n image_format: Format of the image.\n is_circular: if the image is a circle yes or no.\n\n Returns:\n A list of Thumbnails.\n \"\"\"\n thumbnails_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"thumbnails\", \"v1/assets\"),\n params={\n \"assetIds\": list(map(int, assets)),\n \"returnPolicy\": return_policy.value,\n \"size\": _to_size_string(size),\n \"format\": image_format.value,\n \"isCircular\": is_circular,\n },\n )\n thumbnails_data = thumbnails_response.json()[\"data\"]\n return [\n Thumbnail(client=self._client, data=thumbnail_data)\n for thumbnail_data in thumbnails_data\n ]\n\n async def get_asset_thumbnail_3d(self, asset: AssetOrAssetId) -> Thumbnail:\n \"\"\"\n Returns a 3D asset thumbnail for the user ID passed.\n\n Arguments:\n asset: Asset you want the thumbnails of.\n\n Returns:\n A Thumbnail.\n \"\"\"\n thumbnail_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\n \"thumbnails\", \"v1/assets-thumbnail-3d\"\n ),\n params={\"assetId\": int(asset)},\n )\n thumbnail_data = thumbnail_response.json()\n return Thumbnail(client=self._client, data=thumbnail_data)\n\n async def get_badge_icons(\n self,\n badges: List[BadgeOrBadgeId],\n size: SizeTupleOrString = (150, 150),\n image_format: ThumbnailFormat = ThumbnailFormat.png,\n is_circular: bool = False,\n ) -> List[Thumbnail]:\n \"\"\"\n Returns badge icons for each badge ID passed.\n Supported sizes: \n - 150x150 \n\n Arguments:\n badges: Badges you want the thumbnails of.\n size: size of the image.\n image_format: Format of the image.\n is_circular: if the image is a circle yes or no.\n\n Returns:\n A list of Thumbnails.\n \"\"\"\n thumbnails_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"thumbnails\", \"v1/badges/icons\"),\n params={\n \"badgeIds\": list(map(int, badges)),\n \"size\": _to_size_string(size),\n \"format\": image_format.value,\n \"isCircular\": is_circular,\n },\n )\n thumbnails_data = thumbnails_response.json()[\"data\"]\n return [\n Thumbnail(client=self._client, data=thumbnail_data)\n for thumbnail_data in thumbnails_data\n ]\n\n async def get_gamepass_icons(\n self,\n gamepasses: List[GamePassOrGamePassId],\n # TODO Make size enum\n size: SizeTupleOrString = (150, 150),\n image_format: ThumbnailFormat = ThumbnailFormat.png,\n is_circular: bool = False,\n ) -> List[Thumbnail]:\n \"\"\"\n Returns gamepass icons for each gamepass ID passed.\n Supported sizes: \n - 150x150 \n\n Arguments:\n gamepasses: Gamepasses you want the thumbnails of.\n size: size of the image.\n image_format: Format of the image.\n is_circular: If the image is a circle yes or no.\n\n Returns:\n A list of Thumbnails.\n \"\"\"\n thumbnails_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"thumbnails\", \"v1/game-passes\"),\n params={\n \"gamePassIds\": list(map(int, gamepasses)),\n \"size\": _to_size_string(size),\n \"format\": image_format.value,\n \"isCircular\": is_circular,\n },\n )\n thumbnails_data = thumbnails_response.json()[\"data\"]\n return [\n Thumbnail(client=self._client, data=thumbnail_data)\n for thumbnail_data in thumbnails_data\n ]\n\n async def get_universe_icons(\n self,\n universes: List[UniverseOrUniverseId],\n return_policy: ThumbnailReturnPolicy = ThumbnailReturnPolicy.place_holder,\n size: SizeTupleOrString = (50, 50),\n image_format: ThumbnailFormat = ThumbnailFormat.png,\n is_circular: bool = False,\n ) -> List[Thumbnail]:\n \"\"\"\n Returns universe icons for each universe ID passed.\n Supported sizes: \n - 50x50 \n - 128x128 \n - 150x150 \n - 256x256 \n - 512x512 \n - 768x432 \n\n Arguments:\n universes: Universes you want the thumbnails of.\n return_policy: How you want it returns look at enum.\n size: size of the image.\n image_format: Format of the image.\n is_circular: If the image is a circle yes or no.\n\n Returns:\n A list of Thumbnails.\n \"\"\"\n thumbnails_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"thumbnails\", \"v1/games/icons\"),\n params={\n \"universeIds\": list(map(int, universes)),\n \"returnPolicy\": return_policy.value,\n \"size\": _to_size_string(size),\n \"format\": image_format.value,\n \"isCircular\": is_circular,\n },\n )\n thumbnails_data = thumbnails_response.json()[\"data\"]\n return [\n Thumbnail(client=self._client, data=thumbnail_data)\n for thumbnail_data in thumbnails_data\n ]\n\n async def get_universe_thumbnails(\n self,\n universes: List[UniverseOrUniverseId],\n size: SizeTupleOrString = (768, 432),\n image_format: ThumbnailFormat = ThumbnailFormat.png,\n is_circular: bool = False,\n count_per_universe: int = None,\n defaults: bool = None,\n ) -> List[UniverseThumbnails]:\n \"\"\"\n Returns universe thumbnails for each universe ID passed.\n Supported sizes: \n - 768x432 \n - 576x324 \n - 480x270 \n - 384x216 \n - 256x144 \n\n Arguments:\n universes: Universes you want the thumbnails of.\n size: size of the image.\n image_format: Format of the image.\n count_per_universe: Unknown.\n is_circular: If the image is a circle yes or no.\n defaults: Whether to return default thumbnails.\n\n Returns:\n A list of Thumbnails.\n \"\"\"\n thumbnails_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\n \"thumbnails\", \"v1/games/multiget/thumbnails\"\n ),\n params={\n \"universeIds\": list(map(int, universes)),\n \"countPerUniverse\": count_per_universe,\n \"defaults\": defaults,\n \"size\": _to_size_string(size),\n \"format\": image_format.value,\n \"isCircular\": is_circular,\n },\n )\n thumbnails_data = thumbnails_response.json()[\"data\"]\n return [\n UniverseThumbnails(client=self._client, data=thumbnail_data)\n for thumbnail_data in thumbnails_data\n ]\n\n async def get_group_icons(\n self,\n groups: List[GroupOrGroupId],\n size: SizeTupleOrString = (150, 150),\n image_format: ThumbnailFormat = ThumbnailFormat.png,\n is_circular: bool = False,\n ) -> List[Thumbnail]:\n \"\"\"\n Returns icons for each group ID passed.\n Supported sizes: \n - 150x150 \n - 420x420 \n\n Arguments:\n groups: Groups you want the thumbnails of.\n size: size of the image.\n image_format: Format of the image.\n is_circular: If the image is a circle yes or no.\n\n Returns:\n A list of Thumbnails.\n \"\"\"\n thumbnails_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"thumbnails\", \"v1/groups/icons\"),\n params={\n \"groupIds\": list(map(int, groups)),\n \"size\": _to_size_string(size),\n \"format\": image_format.value,\n \"isCircular\": is_circular,\n },\n )\n thumbnails_data = thumbnails_response.json()[\"data\"]\n return [\n Thumbnail(client=self._client, data=thumbnail_data)\n for thumbnail_data in thumbnails_data\n ]\n\n async def get_place_icons(\n self,\n places: List[PlaceOrPlaceId],\n return_policy: ThumbnailReturnPolicy = ThumbnailReturnPolicy.place_holder,\n size: SizeTupleOrString = (50, 50),\n image_format: ThumbnailFormat = ThumbnailFormat.png,\n is_circular: bool = False,\n ) -> List[Thumbnail]:\n \"\"\"\n Returns icons for each place ID passed.\n Supported sizes: \n - 50x50 \n - 128x128 \n - 150x150 \n - 256x256 \n - 512x512 \n - 768x432 \n\n Arguments:\n places: Places you want the thumbnails of.\n return_policy: How you want it returns look at enum.\n size: size of the image.\n image_format: Format of the image.\n is_circular: if the image is a circle yes or no.\n Returns:\n A List of Thumbnails.\n \"\"\"\n thumbnails_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"thumbnails\", \"v1/places/gameicons\"),\n params={\n \"placeIds\": list(map(int, places)),\n \"returnPolicy\": return_policy.value,\n \"size\": _to_size_string(size),\n \"format\": image_format.value,\n \"isCircular\": is_circular,\n },\n )\n thumbnails_data = thumbnails_response.json()[\"data\"]\n return [\n Thumbnail(client=self._client, data=thumbnail_data)\n for thumbnail_data in thumbnails_data\n ]\n\n async def get_user_avatar_thumbnails(\n self,\n users: List[UserOrUserId],\n type: AvatarThumbnailType = AvatarThumbnailType.full_body,\n size: SizeTupleOrString = None,\n image_format: ThumbnailFormat = ThumbnailFormat.png,\n is_circular: bool = False,\n ) -> List[Thumbnail]:\n \"\"\"\n Returns avatar thumbnails for each user ID passed.\n The valid sizes depend on the `type` parameter.\n\n | Size | full_body | headshot | bust |\n |---|---|---|---|\n | 30x30 | \u2714\ufe0f | \u274c | \u274c |\n | 48x48 | \u2714\ufe0f | \u2714\ufe0f | \u2714\ufe0f |\n | 50x50 | \u274c | \u2714\ufe0f | \u2714\ufe0f |\n | 60x60 | \u2714\ufe0f | \u2714\ufe0f | \u2714\ufe0f |\n | 75x75 | \u2714\ufe0f | \u2714\ufe0f | \u2714\ufe0f |\n | 100x100 | \u2714\ufe0f | \u2714\ufe0f | \u2714\ufe0f |\n | 110x110 | \u2714\ufe0f | \u2714\ufe0f | \u274c |\n | 140x140 | \u2714\ufe0f | \u274c | \u274c |\n | 150x150 | \u2714\ufe0f | \u2714\ufe0f | \u2714\ufe0f |\n | 150x200 | \u2714\ufe0f | \u274c | \u274c |\n | 180x180 | \u2714\ufe0f | \u2714\ufe0f | \u2714\ufe0f |\n | 250x250 | \u2714\ufe0f | \u274c | \u274c |\n | 352x352 | \u2714\ufe0f | \u2714\ufe0f | \u2714\ufe0f |\n | 420x420 | \u2714\ufe0f | \u2714\ufe0f | \u2714\ufe0f |\n | 720x720 | \u2714\ufe0f | \u274c | \u274c |\n\n Arguments:\n users: Id of the users you want the thumbnails of.\n type: Type of avatar thumbnail you want look at enum.\n size: size of the image.\n image_format: Format of the image.\n is_circular: If the image is a circle yes or no.\n\n Returns:\n A list of Thumbnails.\n \"\"\"\n uri: str\n if type == AvatarThumbnailType.full_body:\n uri = \"avatar\"\n size = size or (30, 30)\n elif type == AvatarThumbnailType.bust:\n uri = \"avatar-bust\"\n size = size or (48, 48)\n elif type == AvatarThumbnailType.headshot:\n uri = \"avatar-headshot\"\n size = size or (48, 48)\n else:\n raise ValueError(\"Avatar type is invalid.\")\n\n thumbnails_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"thumbnails\", f\"v1/users/{uri}\"),\n params={\n \"userIds\": list(map(int, users)),\n \"size\": _to_size_string(size),\n \"format\": image_format.value,\n \"isCircular\": is_circular,\n },\n )\n\n thumbnails_data = thumbnails_response.json()[\"data\"]\n return [\n Thumbnail(client=self._client, data=thumbnail_data)\n for thumbnail_data in thumbnails_data\n ]\n\n async def get_user_avatar_thumbnail_3d(self, user: UserOrUserId) -> Thumbnail:\n \"\"\"\n Returns the user's thumbnail in 3d.\n\n Arguments:\n user: User you want the 3d thumbnail of.\n\n Returns:\n A Thumbnail.\n \"\"\"\n thumbnail_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"thumbnails\", \"v1/users/avatar-3d\"),\n params={\n \"userId\": int(user)\n },\n )\n thumbnail_data = thumbnail_response.json()\n return Thumbnail(client=self._client, data=thumbnail_data)\n
"},{"location":"reference/thumbnails/#roblox.thumbnails.ThumbnailProvider.__init__","title":"__init__(client)
","text":"Parameters:
Name Type Description Defaultclient
Client
Client object.
required Source code inroblox/thumbnails.py
def __init__(self, client: Client):\n \"\"\"\n Arguments:\n client: Client object.\n \"\"\"\n self._client: Client = client\n
"},{"location":"reference/thumbnails/#roblox.thumbnails.ThumbnailProvider.get_asset_thumbnail_3d","title":"get_asset_thumbnail_3d(asset)
async
","text":"Returns a 3D asset thumbnail for the user ID passed.
Parameters:
Name Type Description Defaultasset
AssetOrAssetId
Asset you want the thumbnails of.
requiredReturns:
Type DescriptionThumbnail
A Thumbnail.
Source code inroblox/thumbnails.py
async def get_asset_thumbnail_3d(self, asset: AssetOrAssetId) -> Thumbnail:\n \"\"\"\n Returns a 3D asset thumbnail for the user ID passed.\n\n Arguments:\n asset: Asset you want the thumbnails of.\n\n Returns:\n A Thumbnail.\n \"\"\"\n thumbnail_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\n \"thumbnails\", \"v1/assets-thumbnail-3d\"\n ),\n params={\"assetId\": int(asset)},\n )\n thumbnail_data = thumbnail_response.json()\n return Thumbnail(client=self._client, data=thumbnail_data)\n
"},{"location":"reference/thumbnails/#roblox.thumbnails.ThumbnailProvider.get_asset_thumbnails","title":"get_asset_thumbnails(assets, return_policy=ThumbnailReturnPolicy.place_holder, size=(30, 30), image_format=ThumbnailFormat.png, is_circular=False)
async
","text":"Returns asset thumbnails for the asset ID passed. Supported sizes: - 30x30 - 42x42 - 50x50 - 60x62 - 75x75 - 110x110 - 140x140 - 150x150 - 160x100 - 160x600 - 250x250 - 256x144 - 300x250 - 304x166 - 384x216 - 396x216 - 420x420 - 480x270 - 512x512 - 576x324 - 700x700 - 728x90 - 768x432
Parameters:
Name Type Description Defaultassets
List[AssetOrAssetId]
Assets you want the thumbnails of.
requiredreturn_policy
ThumbnailReturnPolicy
How you want it returns look at enum.
place_holder
size
SizeTupleOrString
size of the image.
(30, 30)
image_format
ThumbnailFormat
Format of the image.
png
is_circular
bool
if the image is a circle yes or no.
False
Returns:
Type DescriptionList[Thumbnail]
A list of Thumbnails.
Source code inroblox/thumbnails.py
async def get_asset_thumbnails(\n self,\n assets: List[AssetOrAssetId],\n return_policy: ThumbnailReturnPolicy = ThumbnailReturnPolicy.place_holder,\n size: SizeTupleOrString = (30, 30),\n image_format: ThumbnailFormat = ThumbnailFormat.png,\n is_circular: bool = False,\n) -> List[Thumbnail]:\n \"\"\"\n Returns asset thumbnails for the asset ID passed.\n Supported sizes: \n - 30x30 \n - 42x42 \n - 50x50 \n - 60x62 \n - 75x75 \n - 110x110 \n - 140x140 \n - 150x150 \n - 160x100 \n - 160x600 \n - 250x250 \n - 256x144 \n - 300x250 \n - 304x166 \n - 384x216 \n - 396x216 \n - 420x420 \n - 480x270 \n - 512x512 \n - 576x324 \n - 700x700 \n - 728x90 \n - 768x432 \n\n Arguments:\n assets: Assets you want the thumbnails of.\n return_policy: How you want it returns look at enum.\n size: size of the image.\n image_format: Format of the image.\n is_circular: if the image is a circle yes or no.\n\n Returns:\n A list of Thumbnails.\n \"\"\"\n thumbnails_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"thumbnails\", \"v1/assets\"),\n params={\n \"assetIds\": list(map(int, assets)),\n \"returnPolicy\": return_policy.value,\n \"size\": _to_size_string(size),\n \"format\": image_format.value,\n \"isCircular\": is_circular,\n },\n )\n thumbnails_data = thumbnails_response.json()[\"data\"]\n return [\n Thumbnail(client=self._client, data=thumbnail_data)\n for thumbnail_data in thumbnails_data\n ]\n
"},{"location":"reference/thumbnails/#roblox.thumbnails.ThumbnailProvider.get_badge_icons","title":"get_badge_icons(badges, size=(150, 150), image_format=ThumbnailFormat.png, is_circular=False)
async
","text":"Returns badge icons for each badge ID passed. Supported sizes: - 150x150
Parameters:
Name Type Description Defaultbadges
List[BadgeOrBadgeId]
Badges you want the thumbnails of.
requiredsize
SizeTupleOrString
size of the image.
(150, 150)
image_format
ThumbnailFormat
Format of the image.
png
is_circular
bool
if the image is a circle yes or no.
False
Returns:
Type DescriptionList[Thumbnail]
A list of Thumbnails.
Source code inroblox/thumbnails.py
async def get_badge_icons(\n self,\n badges: List[BadgeOrBadgeId],\n size: SizeTupleOrString = (150, 150),\n image_format: ThumbnailFormat = ThumbnailFormat.png,\n is_circular: bool = False,\n) -> List[Thumbnail]:\n \"\"\"\n Returns badge icons for each badge ID passed.\n Supported sizes: \n - 150x150 \n\n Arguments:\n badges: Badges you want the thumbnails of.\n size: size of the image.\n image_format: Format of the image.\n is_circular: if the image is a circle yes or no.\n\n Returns:\n A list of Thumbnails.\n \"\"\"\n thumbnails_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"thumbnails\", \"v1/badges/icons\"),\n params={\n \"badgeIds\": list(map(int, badges)),\n \"size\": _to_size_string(size),\n \"format\": image_format.value,\n \"isCircular\": is_circular,\n },\n )\n thumbnails_data = thumbnails_response.json()[\"data\"]\n return [\n Thumbnail(client=self._client, data=thumbnail_data)\n for thumbnail_data in thumbnails_data\n ]\n
"},{"location":"reference/thumbnails/#roblox.thumbnails.ThumbnailProvider.get_gamepass_icons","title":"get_gamepass_icons(gamepasses, size=(150, 150), image_format=ThumbnailFormat.png, is_circular=False)
async
","text":"Returns gamepass icons for each gamepass ID passed. Supported sizes: - 150x150
Parameters:
Name Type Description Defaultgamepasses
List[GamePassOrGamePassId]
Gamepasses you want the thumbnails of.
requiredsize
SizeTupleOrString
size of the image.
(150, 150)
image_format
ThumbnailFormat
Format of the image.
png
is_circular
bool
If the image is a circle yes or no.
False
Returns:
Type DescriptionList[Thumbnail]
A list of Thumbnails.
Source code inroblox/thumbnails.py
async def get_gamepass_icons(\n self,\n gamepasses: List[GamePassOrGamePassId],\n # TODO Make size enum\n size: SizeTupleOrString = (150, 150),\n image_format: ThumbnailFormat = ThumbnailFormat.png,\n is_circular: bool = False,\n) -> List[Thumbnail]:\n \"\"\"\n Returns gamepass icons for each gamepass ID passed.\n Supported sizes: \n - 150x150 \n\n Arguments:\n gamepasses: Gamepasses you want the thumbnails of.\n size: size of the image.\n image_format: Format of the image.\n is_circular: If the image is a circle yes or no.\n\n Returns:\n A list of Thumbnails.\n \"\"\"\n thumbnails_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"thumbnails\", \"v1/game-passes\"),\n params={\n \"gamePassIds\": list(map(int, gamepasses)),\n \"size\": _to_size_string(size),\n \"format\": image_format.value,\n \"isCircular\": is_circular,\n },\n )\n thumbnails_data = thumbnails_response.json()[\"data\"]\n return [\n Thumbnail(client=self._client, data=thumbnail_data)\n for thumbnail_data in thumbnails_data\n ]\n
"},{"location":"reference/thumbnails/#roblox.thumbnails.ThumbnailProvider.get_group_icons","title":"get_group_icons(groups, size=(150, 150), image_format=ThumbnailFormat.png, is_circular=False)
async
","text":"Returns icons for each group ID passed. Supported sizes: - 150x150 - 420x420
Parameters:
Name Type Description Defaultgroups
List[GroupOrGroupId]
Groups you want the thumbnails of.
requiredsize
SizeTupleOrString
size of the image.
(150, 150)
image_format
ThumbnailFormat
Format of the image.
png
is_circular
bool
If the image is a circle yes or no.
False
Returns:
Type DescriptionList[Thumbnail]
A list of Thumbnails.
Source code inroblox/thumbnails.py
async def get_group_icons(\n self,\n groups: List[GroupOrGroupId],\n size: SizeTupleOrString = (150, 150),\n image_format: ThumbnailFormat = ThumbnailFormat.png,\n is_circular: bool = False,\n) -> List[Thumbnail]:\n \"\"\"\n Returns icons for each group ID passed.\n Supported sizes: \n - 150x150 \n - 420x420 \n\n Arguments:\n groups: Groups you want the thumbnails of.\n size: size of the image.\n image_format: Format of the image.\n is_circular: If the image is a circle yes or no.\n\n Returns:\n A list of Thumbnails.\n \"\"\"\n thumbnails_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"thumbnails\", \"v1/groups/icons\"),\n params={\n \"groupIds\": list(map(int, groups)),\n \"size\": _to_size_string(size),\n \"format\": image_format.value,\n \"isCircular\": is_circular,\n },\n )\n thumbnails_data = thumbnails_response.json()[\"data\"]\n return [\n Thumbnail(client=self._client, data=thumbnail_data)\n for thumbnail_data in thumbnails_data\n ]\n
"},{"location":"reference/thumbnails/#roblox.thumbnails.ThumbnailProvider.get_place_icons","title":"get_place_icons(places, return_policy=ThumbnailReturnPolicy.place_holder, size=(50, 50), image_format=ThumbnailFormat.png, is_circular=False)
async
","text":"Returns icons for each place ID passed. Supported sizes: - 50x50 - 128x128 - 150x150 - 256x256 - 512x512 - 768x432
Parameters:
Name Type Description Defaultplaces
List[PlaceOrPlaceId]
Places you want the thumbnails of.
requiredreturn_policy
ThumbnailReturnPolicy
How you want it returns look at enum.
place_holder
size
SizeTupleOrString
size of the image.
(50, 50)
image_format
ThumbnailFormat
Format of the image.
png
is_circular
bool
if the image is a circle yes or no.
False
Source code in roblox/thumbnails.py
async def get_place_icons(\n self,\n places: List[PlaceOrPlaceId],\n return_policy: ThumbnailReturnPolicy = ThumbnailReturnPolicy.place_holder,\n size: SizeTupleOrString = (50, 50),\n image_format: ThumbnailFormat = ThumbnailFormat.png,\n is_circular: bool = False,\n) -> List[Thumbnail]:\n \"\"\"\n Returns icons for each place ID passed.\n Supported sizes: \n - 50x50 \n - 128x128 \n - 150x150 \n - 256x256 \n - 512x512 \n - 768x432 \n\n Arguments:\n places: Places you want the thumbnails of.\n return_policy: How you want it returns look at enum.\n size: size of the image.\n image_format: Format of the image.\n is_circular: if the image is a circle yes or no.\n Returns:\n A List of Thumbnails.\n \"\"\"\n thumbnails_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"thumbnails\", \"v1/places/gameicons\"),\n params={\n \"placeIds\": list(map(int, places)),\n \"returnPolicy\": return_policy.value,\n \"size\": _to_size_string(size),\n \"format\": image_format.value,\n \"isCircular\": is_circular,\n },\n )\n thumbnails_data = thumbnails_response.json()[\"data\"]\n return [\n Thumbnail(client=self._client, data=thumbnail_data)\n for thumbnail_data in thumbnails_data\n ]\n
"},{"location":"reference/thumbnails/#roblox.thumbnails.ThumbnailProvider.get_universe_icons","title":"get_universe_icons(universes, return_policy=ThumbnailReturnPolicy.place_holder, size=(50, 50), image_format=ThumbnailFormat.png, is_circular=False)
async
","text":"Returns universe icons for each universe ID passed. Supported sizes: - 50x50 - 128x128 - 150x150 - 256x256 - 512x512 - 768x432
Parameters:
Name Type Description Defaultuniverses
List[UniverseOrUniverseId]
Universes you want the thumbnails of.
requiredreturn_policy
ThumbnailReturnPolicy
How you want it returns look at enum.
place_holder
size
SizeTupleOrString
size of the image.
(50, 50)
image_format
ThumbnailFormat
Format of the image.
png
is_circular
bool
If the image is a circle yes or no.
False
Returns:
Type DescriptionList[Thumbnail]
A list of Thumbnails.
Source code inroblox/thumbnails.py
async def get_universe_icons(\n self,\n universes: List[UniverseOrUniverseId],\n return_policy: ThumbnailReturnPolicy = ThumbnailReturnPolicy.place_holder,\n size: SizeTupleOrString = (50, 50),\n image_format: ThumbnailFormat = ThumbnailFormat.png,\n is_circular: bool = False,\n) -> List[Thumbnail]:\n \"\"\"\n Returns universe icons for each universe ID passed.\n Supported sizes: \n - 50x50 \n - 128x128 \n - 150x150 \n - 256x256 \n - 512x512 \n - 768x432 \n\n Arguments:\n universes: Universes you want the thumbnails of.\n return_policy: How you want it returns look at enum.\n size: size of the image.\n image_format: Format of the image.\n is_circular: If the image is a circle yes or no.\n\n Returns:\n A list of Thumbnails.\n \"\"\"\n thumbnails_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"thumbnails\", \"v1/games/icons\"),\n params={\n \"universeIds\": list(map(int, universes)),\n \"returnPolicy\": return_policy.value,\n \"size\": _to_size_string(size),\n \"format\": image_format.value,\n \"isCircular\": is_circular,\n },\n )\n thumbnails_data = thumbnails_response.json()[\"data\"]\n return [\n Thumbnail(client=self._client, data=thumbnail_data)\n for thumbnail_data in thumbnails_data\n ]\n
"},{"location":"reference/thumbnails/#roblox.thumbnails.ThumbnailProvider.get_universe_thumbnails","title":"get_universe_thumbnails(universes, size=(768, 432), image_format=ThumbnailFormat.png, is_circular=False, count_per_universe=None, defaults=None)
async
","text":"Returns universe thumbnails for each universe ID passed. Supported sizes: - 768x432 - 576x324 - 480x270 - 384x216 - 256x144
Parameters:
Name Type Description Defaultuniverses
List[UniverseOrUniverseId]
Universes you want the thumbnails of.
requiredsize
SizeTupleOrString
size of the image.
(768, 432)
image_format
ThumbnailFormat
Format of the image.
png
count_per_universe
int
Unknown.
None
is_circular
bool
If the image is a circle yes or no.
False
defaults
bool
Whether to return default thumbnails.
None
Returns:
Type DescriptionList[UniverseThumbnails]
A list of Thumbnails.
Source code inroblox/thumbnails.py
async def get_universe_thumbnails(\n self,\n universes: List[UniverseOrUniverseId],\n size: SizeTupleOrString = (768, 432),\n image_format: ThumbnailFormat = ThumbnailFormat.png,\n is_circular: bool = False,\n count_per_universe: int = None,\n defaults: bool = None,\n) -> List[UniverseThumbnails]:\n \"\"\"\n Returns universe thumbnails for each universe ID passed.\n Supported sizes: \n - 768x432 \n - 576x324 \n - 480x270 \n - 384x216 \n - 256x144 \n\n Arguments:\n universes: Universes you want the thumbnails of.\n size: size of the image.\n image_format: Format of the image.\n count_per_universe: Unknown.\n is_circular: If the image is a circle yes or no.\n defaults: Whether to return default thumbnails.\n\n Returns:\n A list of Thumbnails.\n \"\"\"\n thumbnails_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\n \"thumbnails\", \"v1/games/multiget/thumbnails\"\n ),\n params={\n \"universeIds\": list(map(int, universes)),\n \"countPerUniverse\": count_per_universe,\n \"defaults\": defaults,\n \"size\": _to_size_string(size),\n \"format\": image_format.value,\n \"isCircular\": is_circular,\n },\n )\n thumbnails_data = thumbnails_response.json()[\"data\"]\n return [\n UniverseThumbnails(client=self._client, data=thumbnail_data)\n for thumbnail_data in thumbnails_data\n ]\n
"},{"location":"reference/thumbnails/#roblox.thumbnails.ThumbnailProvider.get_user_avatar_thumbnail_3d","title":"get_user_avatar_thumbnail_3d(user)
async
","text":"Returns the user's thumbnail in 3d.
Parameters:
Name Type Description Defaultuser
UserOrUserId
User you want the 3d thumbnail of.
requiredReturns:
Type DescriptionThumbnail
A Thumbnail.
Source code inroblox/thumbnails.py
async def get_user_avatar_thumbnail_3d(self, user: UserOrUserId) -> Thumbnail:\n \"\"\"\n Returns the user's thumbnail in 3d.\n\n Arguments:\n user: User you want the 3d thumbnail of.\n\n Returns:\n A Thumbnail.\n \"\"\"\n thumbnail_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"thumbnails\", \"v1/users/avatar-3d\"),\n params={\n \"userId\": int(user)\n },\n )\n thumbnail_data = thumbnail_response.json()\n return Thumbnail(client=self._client, data=thumbnail_data)\n
"},{"location":"reference/thumbnails/#roblox.thumbnails.ThumbnailProvider.get_user_avatar_thumbnails","title":"get_user_avatar_thumbnails(users, type=AvatarThumbnailType.full_body, size=None, image_format=ThumbnailFormat.png, is_circular=False)
async
","text":"Returns avatar thumbnails for each user ID passed. The valid sizes depend on the type
parameter.
Parameters:
Name Type Description Defaultusers
List[UserOrUserId]
Id of the users you want the thumbnails of.
requiredtype
AvatarThumbnailType
Type of avatar thumbnail you want look at enum.
full_body
size
SizeTupleOrString
size of the image.
None
image_format
ThumbnailFormat
Format of the image.
png
is_circular
bool
If the image is a circle yes or no.
False
Returns:
Type DescriptionList[Thumbnail]
A list of Thumbnails.
Source code inroblox/thumbnails.py
async def get_user_avatar_thumbnails(\n self,\n users: List[UserOrUserId],\n type: AvatarThumbnailType = AvatarThumbnailType.full_body,\n size: SizeTupleOrString = None,\n image_format: ThumbnailFormat = ThumbnailFormat.png,\n is_circular: bool = False,\n) -> List[Thumbnail]:\n \"\"\"\n Returns avatar thumbnails for each user ID passed.\n The valid sizes depend on the `type` parameter.\n\n | Size | full_body | headshot | bust |\n |---|---|---|---|\n | 30x30 | \u2714\ufe0f | \u274c | \u274c |\n | 48x48 | \u2714\ufe0f | \u2714\ufe0f | \u2714\ufe0f |\n | 50x50 | \u274c | \u2714\ufe0f | \u2714\ufe0f |\n | 60x60 | \u2714\ufe0f | \u2714\ufe0f | \u2714\ufe0f |\n | 75x75 | \u2714\ufe0f | \u2714\ufe0f | \u2714\ufe0f |\n | 100x100 | \u2714\ufe0f | \u2714\ufe0f | \u2714\ufe0f |\n | 110x110 | \u2714\ufe0f | \u2714\ufe0f | \u274c |\n | 140x140 | \u2714\ufe0f | \u274c | \u274c |\n | 150x150 | \u2714\ufe0f | \u2714\ufe0f | \u2714\ufe0f |\n | 150x200 | \u2714\ufe0f | \u274c | \u274c |\n | 180x180 | \u2714\ufe0f | \u2714\ufe0f | \u2714\ufe0f |\n | 250x250 | \u2714\ufe0f | \u274c | \u274c |\n | 352x352 | \u2714\ufe0f | \u2714\ufe0f | \u2714\ufe0f |\n | 420x420 | \u2714\ufe0f | \u2714\ufe0f | \u2714\ufe0f |\n | 720x720 | \u2714\ufe0f | \u274c | \u274c |\n\n Arguments:\n users: Id of the users you want the thumbnails of.\n type: Type of avatar thumbnail you want look at enum.\n size: size of the image.\n image_format: Format of the image.\n is_circular: If the image is a circle yes or no.\n\n Returns:\n A list of Thumbnails.\n \"\"\"\n uri: str\n if type == AvatarThumbnailType.full_body:\n uri = \"avatar\"\n size = size or (30, 30)\n elif type == AvatarThumbnailType.bust:\n uri = \"avatar-bust\"\n size = size or (48, 48)\n elif type == AvatarThumbnailType.headshot:\n uri = \"avatar-headshot\"\n size = size or (48, 48)\n else:\n raise ValueError(\"Avatar type is invalid.\")\n\n thumbnails_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"thumbnails\", f\"v1/users/{uri}\"),\n params={\n \"userIds\": list(map(int, users)),\n \"size\": _to_size_string(size),\n \"format\": image_format.value,\n \"isCircular\": is_circular,\n },\n )\n\n thumbnails_data = thumbnails_response.json()[\"data\"]\n return [\n Thumbnail(client=self._client, data=thumbnail_data)\n for thumbnail_data in thumbnails_data\n ]\n
"},{"location":"reference/thumbnails/#roblox.thumbnails.ThumbnailReturnPolicy","title":"ThumbnailReturnPolicy
","text":" Bases: Enum
The return policy for place/universe thumbnails.
Source code inroblox/thumbnails.py
class ThumbnailReturnPolicy(Enum):\n \"\"\"\n The return policy for place/universe thumbnails.\n \"\"\"\n\n place_holder = \"PlaceHolder\"\n auto_generated = \"AutoGenerated\"\n force_auto_generated = \"ForceAutoGenerated\"\n
"},{"location":"reference/thumbnails/#roblox.thumbnails.ThumbnailState","title":"ThumbnailState
","text":" Bases: Enum
The current state of the thumbnail.
Source code inroblox/thumbnails.py
class ThumbnailState(Enum):\n \"\"\"\n The current state of the thumbnail.\n \"\"\"\n\n completed = \"Completed\"\n in_review = \"InReview\"\n pending = \"Pending\"\n error = \"Error\"\n moderated = \"Moderated\"\n blocked = \"Blocked\"\n
"},{"location":"reference/thumbnails/#roblox.thumbnails.UniverseThumbnails","title":"UniverseThumbnails
","text":"Represents a universe's thumbnails as returned by https://thumbnails.roblox.com/v1/games/multiget/thumbnails.
Attributes:
Name Type Descriptionuniverse_id
int
The id of the target of the image.
error
Optional[str]
The errors you got.
thumbnails
List[Thumbnail]
List of thumbnails.
Source code inroblox/thumbnails.py
class UniverseThumbnails:\n \"\"\"\n Represents a universe's thumbnails as returned by https://thumbnails.roblox.com/v1/games/multiget/thumbnails.\n\n Attributes:\n universe_id: The id of the target of the image.\n error: The errors you got.\n thumbnails: List of thumbnails.\n \"\"\"\n\n def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: Shared object.\n data: The data from the request.\n \"\"\"\n self._client: Client = client\n # todo add base universe maby\n self.universe_id: int = data[\"universeId\"]\n self.error: Optional[str] = data[\"error\"]\n self.thumbnails: List[Thumbnail] = [\n Thumbnail(client=self._client, data=thumbnail_data)\n for thumbnail_data in data[\"thumbnails\"]\n ]\n
"},{"location":"reference/thumbnails/#roblox.thumbnails.UniverseThumbnails.__init__","title":"__init__(client, data)
","text":"Parameters:
Name Type Description Defaultclient
Client
Shared object.
requireddata
dict
The data from the request.
required Source code inroblox/thumbnails.py
def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: Shared object.\n data: The data from the request.\n \"\"\"\n self._client: Client = client\n # todo add base universe maby\n self.universe_id: int = data[\"universeId\"]\n self.error: Optional[str] = data[\"error\"]\n self.thumbnails: List[Thumbnail] = [\n Thumbnail(client=self._client, data=thumbnail_data)\n for thumbnail_data in data[\"thumbnails\"]\n ]\n
"},{"location":"reference/universes/","title":"universes","text":"This module contains classes intended to parse and deal with data from Roblox universe information endpoints.
"},{"location":"reference/universes/#roblox.universes.Universe","title":"Universe
","text":" Bases: BaseUniverse
Represents the response data of https://games.roblox.com/v1/games.
Attributes:
Name Type Descriptionid
int
The ID of this specific universe
root_place
BasePlace
The thumbnail provider object.
name
str
The delivery provider object.
description
str
The description of the game.
creator_type
Enum
Is the creator a group or a user.
creator
Union[PartialUser, UniversePartialGroup]
creator information.
price
Optional[int]
how much you need to pay to play the game.
allowed_gear_genres
List[str]
Unknown
allowed_gear_categories
List[str]
Unknown
is_genre_enforced
bool
Unknown
copying_allowed
bool
are you allowed to copy the game.
playing
int
amount of people currently playing the game.
visits
int
amount of visits to the game.
max_players
int
the maximum amount of players ber server.
created
datetime
when the game was created.
updated
datetime
when the game as been updated for the last time.
studio_access_to_apis_allowed
bool
does studio have access to the apis.
create_vip_servers_allowed
bool
can you create a vip server?
universe_avatar_type
UniverseAvatarType
type of avatars in the game.
genre
UniverseGenre
what genre the game is.
is_all_genre
bool
if it is all genres?
is_favorited_by_user
bool
if the authenticated user has it favorited.
favorited_count
int
the total amount of people who favorited the game.
Source code inroblox/universes.py
class Universe(BaseUniverse):\n \"\"\"\n Represents the response data of https://games.roblox.com/v1/games.\n\n Attributes:\n id: The ID of this specific universe\n root_place: The thumbnail provider object.\n name: The delivery provider object.\n description: The description of the game.\n creator_type: Is the creator a group or a user.\n creator: creator information.\n price: how much you need to pay to play the game.\n allowed_gear_genres: Unknown\n allowed_gear_categories: Unknown\n is_genre_enforced: Unknown\n copying_allowed: are you allowed to copy the game.\n playing: amount of people currently playing the game.\n visits: amount of visits to the game.\n max_players: the maximum amount of players ber server.\n created: when the game was created.\n updated: when the game as been updated for the last time.\n studio_access_to_apis_allowed: does studio have access to the apis.\n create_vip_servers_allowed: can you create a vip server?\n universe_avatar_type: type of avatars in the game.\n genre: what genre the game is.\n is_all_genre: if it is all genres?\n is_favorited_by_user: if the authenticated user has it favorited.\n favorited_count: the total amount of people who favorited the game.\n \"\"\"\n\n def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: The Client.\n data: The universe data.\n \"\"\"\n\n self._client: Client = client\n\n self.id: int = data[\"id\"]\n super().__init__(client=client, universe_id=self.id)\n self.root_place: BasePlace = BasePlace(client=client, place_id=data[\"rootPlaceId\"])\n self.name: str = data[\"name\"]\n self.description: str = data[\"description\"]\n self.creator_type: Enum = CreatorType(data[\"creator\"][\"type\"])\n # isRNVAccount is not part of PartialUser, UniversePartialGroup\n self.creator: Union[PartialUser, UniversePartialGroup]\n if self.creator_type == CreatorType.group:\n self.creator = UniversePartialGroup(client, data[\"creator\"])\n elif self.creator_type == CreatorType.user:\n self.creator = PartialUser(client, data[\"creator\"])\n self.price: Optional[int] = data[\"price\"]\n self.allowed_gear_genres: List[str] = data[\"allowedGearGenres\"]\n self.allowed_gear_categories: List[str] = data[\"allowedGearCategories\"]\n self.is_genre_enforced: bool = data[\"isGenreEnforced\"]\n self.copying_allowed: bool = data[\"copyingAllowed\"]\n self.playing: int = data[\"playing\"]\n self.visits: int = data[\"visits\"]\n self.max_players: int = data[\"maxPlayers\"]\n self.created: datetime = parse(data[\"created\"])\n self.updated: datetime = parse(data[\"updated\"])\n self.studio_access_to_apis_allowed: bool = data[\"studioAccessToApisAllowed\"]\n self.create_vip_servers_allowed: bool = data[\"createVipServersAllowed\"]\n self.universe_avatar_type: UniverseAvatarType = UniverseAvatarType(data[\"universeAvatarType\"])\n self.genre: UniverseGenre = UniverseGenre(data[\"genre\"])\n self.is_all_genre: bool = data[\"isAllGenre\"]\n # gameRating seems to be null across all games, so I omitted it from this class.\n self.is_favorited_by_user: bool = data[\"isFavoritedByUser\"]\n self.favorited_count: int = data[\"favoritedCount\"]\n
"},{"location":"reference/universes/#roblox.universes.Universe.__init__","title":"__init__(client, data)
","text":"Parameters:
Name Type Description Defaultclient
Client
The Client.
requireddata
dict
The universe data.
required Source code inroblox/universes.py
def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: The Client.\n data: The universe data.\n \"\"\"\n\n self._client: Client = client\n\n self.id: int = data[\"id\"]\n super().__init__(client=client, universe_id=self.id)\n self.root_place: BasePlace = BasePlace(client=client, place_id=data[\"rootPlaceId\"])\n self.name: str = data[\"name\"]\n self.description: str = data[\"description\"]\n self.creator_type: Enum = CreatorType(data[\"creator\"][\"type\"])\n # isRNVAccount is not part of PartialUser, UniversePartialGroup\n self.creator: Union[PartialUser, UniversePartialGroup]\n if self.creator_type == CreatorType.group:\n self.creator = UniversePartialGroup(client, data[\"creator\"])\n elif self.creator_type == CreatorType.user:\n self.creator = PartialUser(client, data[\"creator\"])\n self.price: Optional[int] = data[\"price\"]\n self.allowed_gear_genres: List[str] = data[\"allowedGearGenres\"]\n self.allowed_gear_categories: List[str] = data[\"allowedGearCategories\"]\n self.is_genre_enforced: bool = data[\"isGenreEnforced\"]\n self.copying_allowed: bool = data[\"copyingAllowed\"]\n self.playing: int = data[\"playing\"]\n self.visits: int = data[\"visits\"]\n self.max_players: int = data[\"maxPlayers\"]\n self.created: datetime = parse(data[\"created\"])\n self.updated: datetime = parse(data[\"updated\"])\n self.studio_access_to_apis_allowed: bool = data[\"studioAccessToApisAllowed\"]\n self.create_vip_servers_allowed: bool = data[\"createVipServersAllowed\"]\n self.universe_avatar_type: UniverseAvatarType = UniverseAvatarType(data[\"universeAvatarType\"])\n self.genre: UniverseGenre = UniverseGenre(data[\"genre\"])\n self.is_all_genre: bool = data[\"isAllGenre\"]\n # gameRating seems to be null across all games, so I omitted it from this class.\n self.is_favorited_by_user: bool = data[\"isFavoritedByUser\"]\n self.favorited_count: int = data[\"favoritedCount\"]\n
"},{"location":"reference/universes/#roblox.universes.UniverseAvatarType","title":"UniverseAvatarType
","text":" Bases: Enum
The current avatar type of the universe.
Source code inroblox/universes.py
class UniverseAvatarType(Enum):\n \"\"\"\n The current avatar type of the universe.\n \"\"\"\n\n R6 = \"MorphToR6\"\n R15 = \"MorphToR15\"\n player_choice = \"PlayerChoice\"\n
"},{"location":"reference/universes/#roblox.universes.UniverseGenre","title":"UniverseGenre
","text":" Bases: Enum
The universe's genre.
Source code inroblox/universes.py
class UniverseGenre(Enum):\n \"\"\"\n The universe's genre.\n \"\"\"\n\n all = \"All\"\n building = \"Building\"\n horror = \"Horror\"\n town_and_city = \"Town and City\"\n military = \"Military\"\n comedy = \"Comedy\"\n medieval = \"Medieval\"\n adventure = \"Adventure\"\n sci_fi = \"Sci-Fi\"\n naval = \"Naval\"\n fps = \"FPS\"\n rpg = \"RPG\"\n sports = \"Sports\"\n fighting = \"Fighting\"\n western = \"Western\"\n
"},{"location":"reference/users/","title":"users","text":"This module contains classes intended to parse and deal with data from Roblox user information endpoints.
"},{"location":"reference/users/#roblox.users.User","title":"User
","text":" Bases: BaseUser
Represents a single conversation.
Attributes:
Name Type Descriptionid
int
The id of the current user.
name
str
The name of the current user.
display_name
str
The display name of the current user.
external_app_display_name
Optional[str]
The external app display name of the current user.
is_banned
bool
If the user is banned.
description
str
The description the current user wrote for themself.
created
datetime
When the user created their account.
has_verified_badge
bool
If the user has a verified badge.
Source code inroblox/users.py
class User(BaseUser):\n \"\"\"\n Represents a single conversation.\n\n Attributes:\n id: The id of the current user.\n name: The name of the current user.\n display_name: The display name of the current user.\n external_app_display_name: The external app display name of the current user.\n is_banned: If the user is banned.\n description: The description the current user wrote for themself.\n created: When the user created their account.\n has_verified_badge: If the user has a verified badge.\n \"\"\"\n\n def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: Client object.\n data: The data from the request.\n \"\"\"\n super().__init__(client=client, user_id=data[\"id\"])\n\n self._client: Client = client\n\n self.name: str = data[\"name\"]\n self.display_name: str = data[\"displayName\"]\n self.external_app_display_name: Optional[str] = data[\"externalAppDisplayName\"]\n self.id: int = data[\"id\"]\n self.is_banned: bool = data[\"isBanned\"]\n self.description: str = data[\"description\"]\n self.created: datetime = parse(data[\"created\"])\n self.has_verified_badge: bool = data[\"hasVerifiedBadge\"]\n
"},{"location":"reference/users/#roblox.users.User.__init__","title":"__init__(client, data)
","text":"Parameters:
Name Type Description Defaultclient
Client
Client object.
requireddata
dict
The data from the request.
required Source code inroblox/users.py
def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: Client object.\n data: The data from the request.\n \"\"\"\n super().__init__(client=client, user_id=data[\"id\"])\n\n self._client: Client = client\n\n self.name: str = data[\"name\"]\n self.display_name: str = data[\"displayName\"]\n self.external_app_display_name: Optional[str] = data[\"externalAppDisplayName\"]\n self.id: int = data[\"id\"]\n self.is_banned: bool = data[\"isBanned\"]\n self.description: str = data[\"description\"]\n self.created: datetime = parse(data[\"created\"])\n self.has_verified_badge: bool = data[\"hasVerifiedBadge\"]\n
"},{"location":"reference/wall/","title":"wall","text":"Contains objects related to Roblox group walls.
"},{"location":"reference/wall/#roblox.wall.WallPost","title":"WallPost
","text":" Bases: WallPostRelationship
Represents a post on a Roblox group wall.
Attributes:
Name Type Descriptionid
int
The post ID.
poster
Optional[Member]
The member who made the post.
body
str
Body of the post.
created
datetime
Creation date of the post.
updated
datetime
Last updated date of the post.
Source code inroblox/wall.py
class WallPost(WallPostRelationship):\n \"\"\"\n Represents a post on a Roblox group wall.\n\n Attributes:\n id: The post ID.\n poster: The member who made the post.\n body: Body of the post.\n created: Creation date of the post.\n updated: Last updated date of the post.\n \"\"\"\n\n def __init__(self, client: Client, data: dict, group: BaseGroup):\n self._client: Client = client\n\n self.id: int = data[\"id\"]\n\n super().__init__(\n client=self._client,\n post_id=self.id,\n group=group\n )\n\n self.poster: Optional[Member] = data[\"poster\"] and Member(\n client=self._client,\n data=data[\"poster\"],\n group=self.group\n ) or None\n self.body: str = data[\"body\"]\n self.created: datetime = parse(data[\"created\"])\n self.updated: datetime = parse(data[\"updated\"])\n\n def __repr__(self):\n return f\"<{self.__class__.__name__} id={self.id} body={self.body!r} group={self.group}>\"\n
"},{"location":"reference/wall/#roblox.wall.WallPostRelationship","title":"WallPostRelationship
","text":"Represents a Roblox wall post ID.
Attributes:
Name Type Descriptionid
int
The post ID.
group
BaseGroup
The group whose wall this post exists on.
Source code inroblox/wall.py
class WallPostRelationship:\n \"\"\"\n Represents a Roblox wall post ID.\n\n Attributes:\n id: The post ID.\n group: The group whose wall this post exists on.\n \"\"\"\n\n def __init__(self, client: Client, post_id: int, group: Union[BaseGroup, int]):\n \"\"\"\n Arguments:\n client: The Client.\n post_id: The post ID.\n \"\"\"\n\n self._client: Client = client\n self.id: int = post_id\n\n self.group: BaseGroup\n\n if isinstance(group, int):\n self.group = BaseGroup(client=self._client, group_id=group)\n else:\n self.group = group\n\n async def delete(self):\n \"\"\"\n Deletes this wall post.\n \"\"\"\n await self._client.requests.delete(\n url=self._client.url_generator.get_url(\"groups\", f\"v1/groups/{self.group.id}/wall/posts/{self.id}\")\n )\n\n def __repr__(self):\n return f\"<{self.__class__.__name__} id={self.id} group={self.group}>\"\n
"},{"location":"reference/wall/#roblox.wall.WallPostRelationship.__init__","title":"__init__(client, post_id, group)
","text":"Parameters:
Name Type Description Defaultclient
Client
The Client.
requiredpost_id
int
The post ID.
required Source code inroblox/wall.py
def __init__(self, client: Client, post_id: int, group: Union[BaseGroup, int]):\n \"\"\"\n Arguments:\n client: The Client.\n post_id: The post ID.\n \"\"\"\n\n self._client: Client = client\n self.id: int = post_id\n\n self.group: BaseGroup\n\n if isinstance(group, int):\n self.group = BaseGroup(client=self._client, group_id=group)\n else:\n self.group = group\n
"},{"location":"reference/wall/#roblox.wall.WallPostRelationship.delete","title":"delete()
async
","text":"Deletes this wall post.
Source code inroblox/wall.py
async def delete(self):\n \"\"\"\n Deletes this wall post.\n \"\"\"\n await self._client.requests.delete(\n url=self._client.url_generator.get_url(\"groups\", f\"v1/groups/{self.group.id}/wall/posts/{self.id}\")\n )\n
"},{"location":"reference/bases/","title":"bases","text":"Contains base objects representing IDs on Roblox. As IDs represent objects on Roblox, you only need the ID of something to send requests for them. These bases represent one of those IDs.
"},{"location":"reference/bases/baseasset/","title":"baseasset","text":"This file contains the BaseAsset object, which represents a Roblox asset ID.
"},{"location":"reference/bases/baseasset/#roblox.bases.baseasset.BaseAsset","title":"BaseAsset
","text":" Bases: BaseItem
Represents a Roblox asset ID.
Attributes:
Name Type Descriptionid
int
The asset ID.
Source code inroblox/bases/baseasset.py
class BaseAsset(BaseItem):\n \"\"\"\n Represents a Roblox asset ID.\n\n Attributes:\n id: The asset ID.\n \"\"\"\n\n def __init__(self, client: Client, asset_id: int):\n \"\"\"\n Arguments:\n client: The Client this object belongs to.\n asset_id: The asset ID.\n \"\"\"\n\n self._client: Client = client\n self.id: int = asset_id\n\n async def get_resale_data(self) -> AssetResaleData:\n \"\"\"\n Gets the asset's limited resale data.\n The asset must be a limited item for this information to be present.\n\n Returns:\n The asset's limited resale data.\n \"\"\"\n resale_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"economy\", f\"v1/assets/{self.id}/resale-data\")\n )\n resale_data = resale_response.json()\n return AssetResaleData(data=resale_data)\n
"},{"location":"reference/bases/baseasset/#roblox.bases.baseasset.BaseAsset.__init__","title":"__init__(client, asset_id)
","text":"Parameters:
Name Type Description Defaultclient
Client
The Client this object belongs to.
requiredasset_id
int
The asset ID.
required Source code inroblox/bases/baseasset.py
def __init__(self, client: Client, asset_id: int):\n \"\"\"\n Arguments:\n client: The Client this object belongs to.\n asset_id: The asset ID.\n \"\"\"\n\n self._client: Client = client\n self.id: int = asset_id\n
"},{"location":"reference/bases/baseasset/#roblox.bases.baseasset.BaseAsset.get_resale_data","title":"get_resale_data()
async
","text":"Gets the asset's limited resale data. The asset must be a limited item for this information to be present.
Returns:
Type DescriptionAssetResaleData
The asset's limited resale data.
Source code inroblox/bases/baseasset.py
async def get_resale_data(self) -> AssetResaleData:\n \"\"\"\n Gets the asset's limited resale data.\n The asset must be a limited item for this information to be present.\n\n Returns:\n The asset's limited resale data.\n \"\"\"\n resale_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"economy\", f\"v1/assets/{self.id}/resale-data\")\n )\n resale_data = resale_response.json()\n return AssetResaleData(data=resale_data)\n
"},{"location":"reference/bases/basebadge/","title":"basebadge","text":"This file contains the BaseBadge object, which represents a Roblox badge ID.
"},{"location":"reference/bases/basebadge/#roblox.bases.basebadge.BaseBadge","title":"BaseBadge
","text":" Bases: BaseItem
Represents a Roblox badge ID.
Attributes:
Name Type Descriptionid
int
The badge ID.
Source code inroblox/bases/basebadge.py
class BaseBadge(BaseItem):\n \"\"\"\n Represents a Roblox badge ID.\n\n Attributes:\n id: The badge ID.\n \"\"\"\n\n def __init__(self, client: Client, badge_id: int):\n \"\"\"\n Arguments:\n client: The Client this object belongs to.\n badge_id: The badge ID.\n \"\"\"\n\n self._client: Client = client\n self.id: int = badge_id\n
"},{"location":"reference/bases/basebadge/#roblox.bases.basebadge.BaseBadge.__init__","title":"__init__(client, badge_id)
","text":"Parameters:
Name Type Description Defaultclient
Client
The Client this object belongs to.
requiredbadge_id
int
The badge ID.
required Source code inroblox/bases/basebadge.py
def __init__(self, client: Client, badge_id: int):\n \"\"\"\n Arguments:\n client: The Client this object belongs to.\n badge_id: The badge ID.\n \"\"\"\n\n self._client: Client = client\n self.id: int = badge_id\n
"},{"location":"reference/bases/baseconversation/","title":"baseconversation","text":"This file contains the BaseConversation object, which represents a Roblox conversation ID.
"},{"location":"reference/bases/baseconversation/#roblox.bases.baseconversation.BaseConversation","title":"BaseConversation
","text":" Bases: BaseItem
Represents a Roblox chat conversation ID.
Attributes:
Name Type Descriptionid
int
The conversation ID.
Source code inroblox/bases/baseconversation.py
class BaseConversation(BaseItem):\n \"\"\"\n Represents a Roblox chat conversation ID.\n\n Attributes:\n id: The conversation ID.\n \"\"\"\n\n def __init__(self, client: Client, conversation_id: int):\n \"\"\"\n Arguments:\n client: The Client this object belongs to.\n conversation_id: The conversation ID.\n \"\"\"\n\n self._client: Client = client\n self.id: int = conversation_id\n
"},{"location":"reference/bases/baseconversation/#roblox.bases.baseconversation.BaseConversation.__init__","title":"__init__(client, conversation_id)
","text":"Parameters:
Name Type Description Defaultclient
Client
The Client this object belongs to.
requiredconversation_id
int
The conversation ID.
required Source code inroblox/bases/baseconversation.py
def __init__(self, client: Client, conversation_id: int):\n \"\"\"\n Arguments:\n client: The Client this object belongs to.\n conversation_id: The conversation ID.\n \"\"\"\n\n self._client: Client = client\n self.id: int = conversation_id\n
"},{"location":"reference/bases/basegamepass/","title":"basegamepass","text":"This file contains the BaseGamePass object, which represents a Roblox gamepass ID.
"},{"location":"reference/bases/basegamepass/#roblox.bases.basegamepass.BaseGamePass","title":"BaseGamePass
","text":" Bases: BaseItem
Represents a Roblox gamepass ID.
Attributes:
Name Type Descriptionid
int
The gamepass ID.
Source code inroblox/bases/basegamepass.py
class BaseGamePass(BaseItem):\n \"\"\"\n Represents a Roblox gamepass ID.\n\n Attributes:\n id: The gamepass ID.\n \"\"\"\n\n def __init__(self, client: Client, gamepass_id: int):\n \"\"\"\n Arguments:\n client: The Client this object belongs to.\n gamepass_id: The gamepass ID.\n \"\"\"\n\n self._client: Client = client\n self.id: int = gamepass_id\n
"},{"location":"reference/bases/basegamepass/#roblox.bases.basegamepass.BaseGamePass.__init__","title":"__init__(client, gamepass_id)
","text":"Parameters:
Name Type Description Defaultclient
Client
The Client this object belongs to.
requiredgamepass_id
int
The gamepass ID.
required Source code inroblox/bases/basegamepass.py
def __init__(self, client: Client, gamepass_id: int):\n \"\"\"\n Arguments:\n client: The Client this object belongs to.\n gamepass_id: The gamepass ID.\n \"\"\"\n\n self._client: Client = client\n self.id: int = gamepass_id\n
"},{"location":"reference/bases/basegroup/","title":"basegroup","text":"This file contains the BaseGroup object, which represents a Roblox group ID. It also contains the GroupSettings object, which represents a group's settings.
"},{"location":"reference/bases/basegroup/#roblox.bases.basegroup.BaseGroup","title":"BaseGroup
","text":" Bases: BaseItem
Represents a Roblox group ID.
Attributes:
Name Type Descriptionid
int
The group's ID.
Source code inroblox/bases/basegroup.py
class BaseGroup(BaseItem):\n \"\"\"\n Represents a Roblox group ID.\n\n Attributes:\n id: The group's ID.\n \"\"\"\n\n def __init__(self, client: Client, group_id: int):\n \"\"\"\n Parameters:\n client: The Client this object belongs to.\n group_id: The group's ID.\n \"\"\"\n self._client: Client = client\n self.id: int = group_id\n\n async def get_settings(self) -> GroupSettings:\n \"\"\"\n Gets all the settings of the selected group\n\n Returns:\n The group's settings.\n \"\"\"\n settings_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"groups\", f\"v1/groups/{self.id}/settings\"),\n )\n settings_data = settings_response.json()\n return GroupSettings(\n client=self._client,\n data=settings_data\n )\n\n async def update_settings(\n self,\n is_approval_required: Optional[bool] = None,\n is_builders_club_required: Optional[bool] = None,\n are_enemies_allowed: Optional[bool] = None,\n are_group_funds_visible: Optional[bool] = None,\n are_group_games_visible: Optional[bool] = None,\n ) -> None:\n \"\"\"\n Updates this group's settings. Passing `None` will default this setting to the value already present in the\n\n Arguments:\n is_approval_required: Whether approval is required via a join request before joining this group.\n is_builders_club_required: Whether users are required to have a Premium subscription to join this group.\n are_enemies_allowed: Whether this group can send and recieve enemy requests.\n are_group_funds_visible: Whether the group fund balance is visible to external users.\n are_group_games_visible: Whether group games are visible to external users.\n \"\"\"\n await self._client.requests.patch(\n url=self._client.url_generator.get_url(\"groups\", f\"v1/groups/{self.id}/settings\"),\n json={\n \"isApprovalRequired\": is_approval_required,\n \"isBuildersClubRequired\": is_builders_club_required,\n \"areEnemiesAllowed\": are_enemies_allowed,\n \"areGroupFundsVisible\": are_group_funds_visible,\n \"areGroupGamesVisible\": are_group_games_visible,\n }\n )\n\n def get_members(self, page_size: int = 10, sort_order: SortOrder = SortOrder.Ascending,\n max_items: int = None) -> PageIterator:\n \"\"\"\n Gets all members of a group.\n\n Arguments:\n page_size: How many members should be returned for each page.\n sort_order: Order in which data should be grabbed.\n max_items: The maximum items to return when looping through this object.\n\n Returns:\n A PageIterator containing the group's members.\n \"\"\"\n return PageIterator(\n client=self._client,\n url=self._client.url_generator.get_url(\"groups\", f\"v1/groups/{self.id}/users\"),\n page_size=page_size,\n sort_order=sort_order,\n max_items=max_items,\n handler=lambda client, data: Member(client=client, data=data, group=self)\n )\n\n def get_member(self, user: Union[int, BaseUser]) -> MemberRelationship:\n \"\"\"\n Gets a member of a group.\n\n Arguments:\n user: A BaseUser or a User ID.\n\n Returns:\n A member.\n \"\"\"\n return MemberRelationship(\n client=self._client,\n user=user,\n group=self\n )\n\n async def get_member_by_username(self, username: str, exclude_banned_users: bool = False) -> MemberRelationship:\n \"\"\"\n Gets a member of a group by username.\n\n Arguments:\n username: A Roblox username.\n exclude_banned_users: Whether to exclude banned users from the data.\n\n Returns:\n A member.\n \"\"\"\n\n user: RequestedUsernamePartialUser = await self._client.get_user_by_username(\n username=username,\n exclude_banned_users=exclude_banned_users,\n expand=False\n )\n\n return MemberRelationship(\n client=self._client,\n user=user,\n group=self\n )\n\n async def get_roles(self) -> List[Role]:\n \"\"\"\n Gets all roles of the group.\n\n Returns:\n A list of the group's roles.\n \"\"\"\n roles_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"groups\", f\"v1/groups/{self.id}/roles\")\n )\n roles_data = roles_response.json()\n return [Role(\n client=self._client,\n data=role_data,\n group=self\n ) for role_data in roles_data[\"roles\"]]\n\n async def set_role(self, user: UserOrUserId, role: RoleOrRoleId) -> None:\n \"\"\"\n Sets a users role.\n\n Arguments:\n user: The user who's rank will be changed.\n role: The new role.\n \"\"\"\n await self._client.requests.patch(\n url=self._client.url_generator.get_url(\"groups\", f\"v1/groups/{self.id}/users/{int(user)}\"),\n json={\n \"roleId\": int(role)\n }\n )\n\n async def set_rank(self, user: UserOrUserId, rank: int) -> None:\n \"\"\"\n Changes a member's role using a rank number.\n\n Arguments:\n user: The user who's rank will be changed.\n rank: The rank number to change to. (1-255)\n \"\"\"\n roles = await self.get_roles()\n\n role = next((role for role in roles if role.rank == rank), None)\n if not role:\n raise InvalidRole(f\"Role with rank number {rank} does not exist.\")\n\n await self.set_role(int(user), role)\n\n async def kick_user(self, user: UserOrUserId):\n \"\"\"\n Kicks a user from a group.\n\n Arguments:\n user: The user who will be kicked from the group.\n \"\"\"\n await self._client.requests.delete(\n url=self._client.url_generator.get_url(\"groups\", f\"v1/groups/{self.id}/users/{int(user)}\")\n )\n\n async def delete_all_messages(self, user: UserOrUserId):\n \"\"\"\n Deletes all messages from a user in a group.\n\n Arguments:\n user: The user who will have their messages deleted.\n \"\"\"\n await self._client.requests.delete(\n url=self._client.url_generator.get_url(\"groups\", f\"/v1/groups/{self.id}/wall/users/{int(user)}/posts\")\n )\n\n def get_wall_posts(self, page_size: int = 10, sort_order: SortOrder = SortOrder.Ascending,\n max_items: int = None) -> PageIterator:\n \"\"\"\n Gets wall posts of a group.\n\n Arguments:\n page_size: How many posts should be returned for each page.\n sort_order: Order in which data should be grabbed.\n max_items: The maximum items to return when looping through this object.\n\n Returns: A PageIterator.\n \"\"\"\n return PageIterator(\n client=self._client,\n url=self._client.url_generator.get_url(\"groups\", f\"v2/groups/{self.id}/wall/posts\"),\n page_size=page_size,\n sort_order=sort_order,\n max_items=max_items,\n handler=lambda client, data: WallPost(client=client, data=data, group=self)\n )\n\n def get_wall_post(self, post_id: int) -> WallPostRelationship:\n \"\"\"\n Gets a wall post from an ID.\n\n Arguments:\n post_id: A post ID.\n\n Returns:\n A basic wall post relationship.\n \"\"\"\n return WallPostRelationship(\n client=self._client,\n post_id=post_id,\n group=self\n )\n\n def get_join_requests(self, page_size: int = 10, sort_order: SortOrder = SortOrder.Ascending,\n max_items: int = None) -> PageIterator:\n \"\"\"\n Gets all of this group's join requests.\n\n Arguments:\n page_size: How many members should be returned for each page.\n sort_order: Order in which data should be grabbed.\n max_items: The maximum items to return when looping through this object.\n\n Returns:\n A PageIterator containing group join requests.\n \"\"\"\n return PageIterator(\n client=self._client,\n url=self._client.url_generator.get_url(\"groups\", f\"v1/groups/{self.id}/join-requests\"),\n page_size=page_size,\n sort_order=sort_order,\n max_items=max_items,\n handler=lambda client, data: JoinRequest(client=client, data=data, group=self)\n )\n\n async def get_join_request(self, user: Union[int, BaseUser]) -> Optional[JoinRequest]:\n \"\"\"\n Gets a specific user's join request to this group.\n\n Returns:\n The user's join request, or None if they have no active join request.\n \"\"\"\n join_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"groups\", f\"v1/groups/{self.id}/join-requests/users/{int(user)}\")\n )\n join_data = join_response.json()\n return join_data and JoinRequest(\n\n client=self._client,\n data=join_data,\n group=self\n ) or None\n\n async def accept_user(self, user: Union[int, BaseUser, JoinRequest]):\n \"\"\"\n Accepts a user's request to join this group.\n\n Arguments:\n user: The user to accept into this group.\n \"\"\"\n await self._client.requests.post(\n url=self._client.url_generator.get_url(\"groups\", f\"v1/groups/{self.id}/join-requests/users/{int(user)}\")\n )\n\n async def decline_user(self, user: Union[int, BaseUser, JoinRequest]):\n \"\"\"\n Declines a user's request to join this group.\n\n Arguments:\n user: The user to decline from this group.\n \"\"\"\n await self._client.requests.delete(\n url=self._client.url_generator.get_url(\"groups\", f\"v1/groups/{self.id}/join-requests/users/{int(user)}\")\n )\n\n async def update_shout(self, message: str) -> Optional[Shout]:\n \"\"\"\n Updates the shout.\n\n Arguments:\n message: The new shout message.\n \"\"\"\n shout_response = await self._client.requests.patch(\n url=self._client.url_generator.get_url(\"groups\", f\"v1/groups/{self.id}/status\"),\n json={\n \"message\": message\n }\n )\n shout_data = shout_response.json()\n\n new_shout: Optional[Shout] = shout_data and Shout(\n client=self._client,\n data=shout_data\n ) or None\n\n return new_shout\n\n async def get_social_links(self) -> List[SocialLink]:\n \"\"\"\n Gets the group's social links.\n\n Returns:\n A list of the universe's social links.\n \"\"\"\n\n links_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"groups\", f\"v1/groups/{self.id}/social-links\")\n )\n links_data = links_response.json()[\"data\"]\n return [SocialLink(client=self._client, data=link_data) for link_data in links_data]\n\n def get_name_history(\n self, \n page_size: int = 10, \n sort_order: SortOrder = SortOrder.Ascending, \n max_items: int = None\n ) -> PageIterator:\n \"\"\"\n Grabs the groups's name history.\n\n Arguments:\n page_size: How many members should be returned for each page.\n sort_order: Order in which data should be grabbed.\n max_items: The maximum items to return when looping through this object.\n\n Returns:\n A PageIterator containing the groups's name history.\n \"\"\"\n return PageIterator(\n client=self._client,\n url=self._client.url_generator.get_url(\n \"groups\", f\"v1/groups/{self.id}/name-history\"\n ),\n page_size=page_size,\n sort_order=sort_order,\n max_items=max_items,\n handler=lambda client, data: GroupNameHistoryItem(client=client, data=data),\n )\n
"},{"location":"reference/bases/basegroup/#roblox.bases.basegroup.BaseGroup.__init__","title":"__init__(client, group_id)
","text":"Parameters:
Name Type Description Defaultclient
Client
The Client this object belongs to.
requiredgroup_id
int
The group's ID.
required Source code inroblox/bases/basegroup.py
def __init__(self, client: Client, group_id: int):\n \"\"\"\n Parameters:\n client: The Client this object belongs to.\n group_id: The group's ID.\n \"\"\"\n self._client: Client = client\n self.id: int = group_id\n
"},{"location":"reference/bases/basegroup/#roblox.bases.basegroup.BaseGroup.accept_user","title":"accept_user(user)
async
","text":"Accepts a user's request to join this group.
Parameters:
Name Type Description Defaultuser
Union[int, BaseUser, JoinRequest]
The user to accept into this group.
required Source code inroblox/bases/basegroup.py
async def accept_user(self, user: Union[int, BaseUser, JoinRequest]):\n \"\"\"\n Accepts a user's request to join this group.\n\n Arguments:\n user: The user to accept into this group.\n \"\"\"\n await self._client.requests.post(\n url=self._client.url_generator.get_url(\"groups\", f\"v1/groups/{self.id}/join-requests/users/{int(user)}\")\n )\n
"},{"location":"reference/bases/basegroup/#roblox.bases.basegroup.BaseGroup.decline_user","title":"decline_user(user)
async
","text":"Declines a user's request to join this group.
Parameters:
Name Type Description Defaultuser
Union[int, BaseUser, JoinRequest]
The user to decline from this group.
required Source code inroblox/bases/basegroup.py
async def decline_user(self, user: Union[int, BaseUser, JoinRequest]):\n \"\"\"\n Declines a user's request to join this group.\n\n Arguments:\n user: The user to decline from this group.\n \"\"\"\n await self._client.requests.delete(\n url=self._client.url_generator.get_url(\"groups\", f\"v1/groups/{self.id}/join-requests/users/{int(user)}\")\n )\n
"},{"location":"reference/bases/basegroup/#roblox.bases.basegroup.BaseGroup.delete_all_messages","title":"delete_all_messages(user)
async
","text":"Deletes all messages from a user in a group.
Parameters:
Name Type Description Defaultuser
UserOrUserId
The user who will have their messages deleted.
required Source code inroblox/bases/basegroup.py
async def delete_all_messages(self, user: UserOrUserId):\n \"\"\"\n Deletes all messages from a user in a group.\n\n Arguments:\n user: The user who will have their messages deleted.\n \"\"\"\n await self._client.requests.delete(\n url=self._client.url_generator.get_url(\"groups\", f\"/v1/groups/{self.id}/wall/users/{int(user)}/posts\")\n )\n
"},{"location":"reference/bases/basegroup/#roblox.bases.basegroup.BaseGroup.get_join_request","title":"get_join_request(user)
async
","text":"Gets a specific user's join request to this group.
Returns:
Type DescriptionOptional[JoinRequest]
The user's join request, or None if they have no active join request.
Source code inroblox/bases/basegroup.py
async def get_join_request(self, user: Union[int, BaseUser]) -> Optional[JoinRequest]:\n \"\"\"\n Gets a specific user's join request to this group.\n\n Returns:\n The user's join request, or None if they have no active join request.\n \"\"\"\n join_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"groups\", f\"v1/groups/{self.id}/join-requests/users/{int(user)}\")\n )\n join_data = join_response.json()\n return join_data and JoinRequest(\n\n client=self._client,\n data=join_data,\n group=self\n ) or None\n
"},{"location":"reference/bases/basegroup/#roblox.bases.basegroup.BaseGroup.get_join_requests","title":"get_join_requests(page_size=10, sort_order=SortOrder.Ascending, max_items=None)
","text":"Gets all of this group's join requests.
Parameters:
Name Type Description Defaultpage_size
int
How many members should be returned for each page.
10
sort_order
SortOrder
Order in which data should be grabbed.
Ascending
max_items
int
The maximum items to return when looping through this object.
None
Returns:
Type DescriptionPageIterator
A PageIterator containing group join requests.
Source code inroblox/bases/basegroup.py
def get_join_requests(self, page_size: int = 10, sort_order: SortOrder = SortOrder.Ascending,\n max_items: int = None) -> PageIterator:\n \"\"\"\n Gets all of this group's join requests.\n\n Arguments:\n page_size: How many members should be returned for each page.\n sort_order: Order in which data should be grabbed.\n max_items: The maximum items to return when looping through this object.\n\n Returns:\n A PageIterator containing group join requests.\n \"\"\"\n return PageIterator(\n client=self._client,\n url=self._client.url_generator.get_url(\"groups\", f\"v1/groups/{self.id}/join-requests\"),\n page_size=page_size,\n sort_order=sort_order,\n max_items=max_items,\n handler=lambda client, data: JoinRequest(client=client, data=data, group=self)\n )\n
"},{"location":"reference/bases/basegroup/#roblox.bases.basegroup.BaseGroup.get_member","title":"get_member(user)
","text":"Gets a member of a group.
Parameters:
Name Type Description Defaultuser
Union[int, BaseUser]
A BaseUser or a User ID.
requiredReturns:
Type DescriptionMemberRelationship
A member.
Source code inroblox/bases/basegroup.py
def get_member(self, user: Union[int, BaseUser]) -> MemberRelationship:\n \"\"\"\n Gets a member of a group.\n\n Arguments:\n user: A BaseUser or a User ID.\n\n Returns:\n A member.\n \"\"\"\n return MemberRelationship(\n client=self._client,\n user=user,\n group=self\n )\n
"},{"location":"reference/bases/basegroup/#roblox.bases.basegroup.BaseGroup.get_member_by_username","title":"get_member_by_username(username, exclude_banned_users=False)
async
","text":"Gets a member of a group by username.
Parameters:
Name Type Description Defaultusername
str
A Roblox username.
requiredexclude_banned_users
bool
Whether to exclude banned users from the data.
False
Returns:
Type DescriptionMemberRelationship
A member.
Source code inroblox/bases/basegroup.py
async def get_member_by_username(self, username: str, exclude_banned_users: bool = False) -> MemberRelationship:\n \"\"\"\n Gets a member of a group by username.\n\n Arguments:\n username: A Roblox username.\n exclude_banned_users: Whether to exclude banned users from the data.\n\n Returns:\n A member.\n \"\"\"\n\n user: RequestedUsernamePartialUser = await self._client.get_user_by_username(\n username=username,\n exclude_banned_users=exclude_banned_users,\n expand=False\n )\n\n return MemberRelationship(\n client=self._client,\n user=user,\n group=self\n )\n
"},{"location":"reference/bases/basegroup/#roblox.bases.basegroup.BaseGroup.get_members","title":"get_members(page_size=10, sort_order=SortOrder.Ascending, max_items=None)
","text":"Gets all members of a group.
Parameters:
Name Type Description Defaultpage_size
int
How many members should be returned for each page.
10
sort_order
SortOrder
Order in which data should be grabbed.
Ascending
max_items
int
The maximum items to return when looping through this object.
None
Returns:
Type DescriptionPageIterator
A PageIterator containing the group's members.
Source code inroblox/bases/basegroup.py
def get_members(self, page_size: int = 10, sort_order: SortOrder = SortOrder.Ascending,\n max_items: int = None) -> PageIterator:\n \"\"\"\n Gets all members of a group.\n\n Arguments:\n page_size: How many members should be returned for each page.\n sort_order: Order in which data should be grabbed.\n max_items: The maximum items to return when looping through this object.\n\n Returns:\n A PageIterator containing the group's members.\n \"\"\"\n return PageIterator(\n client=self._client,\n url=self._client.url_generator.get_url(\"groups\", f\"v1/groups/{self.id}/users\"),\n page_size=page_size,\n sort_order=sort_order,\n max_items=max_items,\n handler=lambda client, data: Member(client=client, data=data, group=self)\n )\n
"},{"location":"reference/bases/basegroup/#roblox.bases.basegroup.BaseGroup.get_name_history","title":"get_name_history(page_size=10, sort_order=SortOrder.Ascending, max_items=None)
","text":"Grabs the groups's name history.
Parameters:
Name Type Description Defaultpage_size
int
How many members should be returned for each page.
10
sort_order
SortOrder
Order in which data should be grabbed.
Ascending
max_items
int
The maximum items to return when looping through this object.
None
Returns:
Type DescriptionPageIterator
A PageIterator containing the groups's name history.
Source code inroblox/bases/basegroup.py
def get_name_history(\n self, \n page_size: int = 10, \n sort_order: SortOrder = SortOrder.Ascending, \n max_items: int = None\n) -> PageIterator:\n \"\"\"\n Grabs the groups's name history.\n\n Arguments:\n page_size: How many members should be returned for each page.\n sort_order: Order in which data should be grabbed.\n max_items: The maximum items to return when looping through this object.\n\n Returns:\n A PageIterator containing the groups's name history.\n \"\"\"\n return PageIterator(\n client=self._client,\n url=self._client.url_generator.get_url(\n \"groups\", f\"v1/groups/{self.id}/name-history\"\n ),\n page_size=page_size,\n sort_order=sort_order,\n max_items=max_items,\n handler=lambda client, data: GroupNameHistoryItem(client=client, data=data),\n )\n
"},{"location":"reference/bases/basegroup/#roblox.bases.basegroup.BaseGroup.get_roles","title":"get_roles()
async
","text":"Gets all roles of the group.
Returns:
Type DescriptionList[Role]
A list of the group's roles.
Source code inroblox/bases/basegroup.py
async def get_roles(self) -> List[Role]:\n \"\"\"\n Gets all roles of the group.\n\n Returns:\n A list of the group's roles.\n \"\"\"\n roles_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"groups\", f\"v1/groups/{self.id}/roles\")\n )\n roles_data = roles_response.json()\n return [Role(\n client=self._client,\n data=role_data,\n group=self\n ) for role_data in roles_data[\"roles\"]]\n
"},{"location":"reference/bases/basegroup/#roblox.bases.basegroup.BaseGroup.get_settings","title":"get_settings()
async
","text":"Gets all the settings of the selected group
Returns:
Type DescriptionGroupSettings
The group's settings.
Source code inroblox/bases/basegroup.py
async def get_settings(self) -> GroupSettings:\n \"\"\"\n Gets all the settings of the selected group\n\n Returns:\n The group's settings.\n \"\"\"\n settings_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"groups\", f\"v1/groups/{self.id}/settings\"),\n )\n settings_data = settings_response.json()\n return GroupSettings(\n client=self._client,\n data=settings_data\n )\n
"},{"location":"reference/bases/basegroup/#roblox.bases.basegroup.BaseGroup.get_social_links","title":"get_social_links()
async
","text":"Gets the group's social links.
Returns:
Type DescriptionList[SocialLink]
A list of the universe's social links.
Source code inroblox/bases/basegroup.py
async def get_social_links(self) -> List[SocialLink]:\n \"\"\"\n Gets the group's social links.\n\n Returns:\n A list of the universe's social links.\n \"\"\"\n\n links_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"groups\", f\"v1/groups/{self.id}/social-links\")\n )\n links_data = links_response.json()[\"data\"]\n return [SocialLink(client=self._client, data=link_data) for link_data in links_data]\n
"},{"location":"reference/bases/basegroup/#roblox.bases.basegroup.BaseGroup.get_wall_post","title":"get_wall_post(post_id)
","text":"Gets a wall post from an ID.
Parameters:
Name Type Description Defaultpost_id
int
A post ID.
requiredReturns:
Type DescriptionWallPostRelationship
A basic wall post relationship.
Source code inroblox/bases/basegroup.py
def get_wall_post(self, post_id: int) -> WallPostRelationship:\n \"\"\"\n Gets a wall post from an ID.\n\n Arguments:\n post_id: A post ID.\n\n Returns:\n A basic wall post relationship.\n \"\"\"\n return WallPostRelationship(\n client=self._client,\n post_id=post_id,\n group=self\n )\n
"},{"location":"reference/bases/basegroup/#roblox.bases.basegroup.BaseGroup.get_wall_posts","title":"get_wall_posts(page_size=10, sort_order=SortOrder.Ascending, max_items=None)
","text":"Gets wall posts of a group.
Parameters:
Name Type Description Defaultpage_size
int
How many posts should be returned for each page.
10
sort_order
SortOrder
Order in which data should be grabbed.
Ascending
max_items
int
The maximum items to return when looping through this object.
None
Source code in roblox/bases/basegroup.py
def get_wall_posts(self, page_size: int = 10, sort_order: SortOrder = SortOrder.Ascending,\n max_items: int = None) -> PageIterator:\n \"\"\"\n Gets wall posts of a group.\n\n Arguments:\n page_size: How many posts should be returned for each page.\n sort_order: Order in which data should be grabbed.\n max_items: The maximum items to return when looping through this object.\n\n Returns: A PageIterator.\n \"\"\"\n return PageIterator(\n client=self._client,\n url=self._client.url_generator.get_url(\"groups\", f\"v2/groups/{self.id}/wall/posts\"),\n page_size=page_size,\n sort_order=sort_order,\n max_items=max_items,\n handler=lambda client, data: WallPost(client=client, data=data, group=self)\n )\n
"},{"location":"reference/bases/basegroup/#roblox.bases.basegroup.BaseGroup.kick_user","title":"kick_user(user)
async
","text":"Kicks a user from a group.
Parameters:
Name Type Description Defaultuser
UserOrUserId
The user who will be kicked from the group.
required Source code inroblox/bases/basegroup.py
async def kick_user(self, user: UserOrUserId):\n \"\"\"\n Kicks a user from a group.\n\n Arguments:\n user: The user who will be kicked from the group.\n \"\"\"\n await self._client.requests.delete(\n url=self._client.url_generator.get_url(\"groups\", f\"v1/groups/{self.id}/users/{int(user)}\")\n )\n
"},{"location":"reference/bases/basegroup/#roblox.bases.basegroup.BaseGroup.set_rank","title":"set_rank(user, rank)
async
","text":"Changes a member's role using a rank number.
Parameters:
Name Type Description Defaultuser
UserOrUserId
The user who's rank will be changed.
requiredrank
int
The rank number to change to. (1-255)
required Source code inroblox/bases/basegroup.py
async def set_rank(self, user: UserOrUserId, rank: int) -> None:\n \"\"\"\n Changes a member's role using a rank number.\n\n Arguments:\n user: The user who's rank will be changed.\n rank: The rank number to change to. (1-255)\n \"\"\"\n roles = await self.get_roles()\n\n role = next((role for role in roles if role.rank == rank), None)\n if not role:\n raise InvalidRole(f\"Role with rank number {rank} does not exist.\")\n\n await self.set_role(int(user), role)\n
"},{"location":"reference/bases/basegroup/#roblox.bases.basegroup.BaseGroup.set_role","title":"set_role(user, role)
async
","text":"Sets a users role.
Parameters:
Name Type Description Defaultuser
UserOrUserId
The user who's rank will be changed.
requiredrole
RoleOrRoleId
The new role.
required Source code inroblox/bases/basegroup.py
async def set_role(self, user: UserOrUserId, role: RoleOrRoleId) -> None:\n \"\"\"\n Sets a users role.\n\n Arguments:\n user: The user who's rank will be changed.\n role: The new role.\n \"\"\"\n await self._client.requests.patch(\n url=self._client.url_generator.get_url(\"groups\", f\"v1/groups/{self.id}/users/{int(user)}\"),\n json={\n \"roleId\": int(role)\n }\n )\n
"},{"location":"reference/bases/basegroup/#roblox.bases.basegroup.BaseGroup.update_settings","title":"update_settings(is_approval_required=None, is_builders_club_required=None, are_enemies_allowed=None, are_group_funds_visible=None, are_group_games_visible=None)
async
","text":"Updates this group's settings. Passing None
will default this setting to the value already present in the
Parameters:
Name Type Description Defaultis_approval_required
Optional[bool]
Whether approval is required via a join request before joining this group.
None
is_builders_club_required
Optional[bool]
Whether users are required to have a Premium subscription to join this group.
None
are_enemies_allowed
Optional[bool]
Whether this group can send and recieve enemy requests.
None
are_group_funds_visible
Optional[bool]
Whether the group fund balance is visible to external users.
None
are_group_games_visible
Optional[bool]
Whether group games are visible to external users.
None
Source code in roblox/bases/basegroup.py
async def update_settings(\n self,\n is_approval_required: Optional[bool] = None,\n is_builders_club_required: Optional[bool] = None,\n are_enemies_allowed: Optional[bool] = None,\n are_group_funds_visible: Optional[bool] = None,\n are_group_games_visible: Optional[bool] = None,\n) -> None:\n \"\"\"\n Updates this group's settings. Passing `None` will default this setting to the value already present in the\n\n Arguments:\n is_approval_required: Whether approval is required via a join request before joining this group.\n is_builders_club_required: Whether users are required to have a Premium subscription to join this group.\n are_enemies_allowed: Whether this group can send and recieve enemy requests.\n are_group_funds_visible: Whether the group fund balance is visible to external users.\n are_group_games_visible: Whether group games are visible to external users.\n \"\"\"\n await self._client.requests.patch(\n url=self._client.url_generator.get_url(\"groups\", f\"v1/groups/{self.id}/settings\"),\n json={\n \"isApprovalRequired\": is_approval_required,\n \"isBuildersClubRequired\": is_builders_club_required,\n \"areEnemiesAllowed\": are_enemies_allowed,\n \"areGroupFundsVisible\": are_group_funds_visible,\n \"areGroupGamesVisible\": are_group_games_visible,\n }\n )\n
"},{"location":"reference/bases/basegroup/#roblox.bases.basegroup.BaseGroup.update_shout","title":"update_shout(message)
async
","text":"Updates the shout.
Parameters:
Name Type Description Defaultmessage
str
The new shout message.
required Source code inroblox/bases/basegroup.py
async def update_shout(self, message: str) -> Optional[Shout]:\n \"\"\"\n Updates the shout.\n\n Arguments:\n message: The new shout message.\n \"\"\"\n shout_response = await self._client.requests.patch(\n url=self._client.url_generator.get_url(\"groups\", f\"v1/groups/{self.id}/status\"),\n json={\n \"message\": message\n }\n )\n shout_data = shout_response.json()\n\n new_shout: Optional[Shout] = shout_data and Shout(\n client=self._client,\n data=shout_data\n ) or None\n\n return new_shout\n
"},{"location":"reference/bases/basegroup/#roblox.bases.basegroup.GroupNameHistoryItem","title":"GroupNameHistoryItem
","text":"Represents a group's previous name.
Attributes:
Name Type Descriptionname
str
The group's previous name.
created
datetime
A datetime object representing when this name was changed.
Source code inroblox/bases/basegroup.py
class GroupNameHistoryItem:\n \"\"\"\n Represents a group's previous name.\n\n Attributes:\n name: The group's previous name.\n created: A datetime object representing when this name was changed.\n \"\"\"\n\n def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: The Client this object belongs to.\n data: The group's previous name data.\n \"\"\"\n\n self._client: Client = client\n self.name: str = data[\"name\"]\n self.created: datetime = parse(data[\"created\"])\n\n def __repr__(self):\n return f\"<{self.__class__.__name__} name={self.name!r} created={self.created}>\"\n
"},{"location":"reference/bases/basegroup/#roblox.bases.basegroup.GroupNameHistoryItem.__init__","title":"__init__(client, data)
","text":"Parameters:
Name Type Description Defaultclient
Client
The Client this object belongs to.
requireddata
dict
The group's previous name data.
required Source code inroblox/bases/basegroup.py
def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: The Client this object belongs to.\n data: The group's previous name data.\n \"\"\"\n\n self._client: Client = client\n self.name: str = data[\"name\"]\n self.created: datetime = parse(data[\"created\"])\n
"},{"location":"reference/bases/basegroup/#roblox.bases.basegroup.GroupSettings","title":"GroupSettings
","text":"Represents a group's settings.
Attributes:
Name Type Descriptionis_approval_required
bool
Whether approval is required to join this group.
is_builders_club_required
bool
Whether a membership is required to join this group.
are_enemies_allowed
bool
Whether group enemies are allowed.
are_group_funds_visible
bool
Whether group funds are visible.
are_group_games_visible
bool
Whether group games are visible.
is_group_name_change_enabled
bool
Whether group name changes are enabled.
can_change_group_name
bool
Whether the name of this group can be changed.
Source code inroblox/bases/basegroup.py
class GroupSettings:\n \"\"\"\n Represents a group's settings.\n\n Attributes:\n is_approval_required: Whether approval is required to join this group.\n is_builders_club_required: Whether a membership is required to join this group.\n are_enemies_allowed: Whether group enemies are allowed.\n are_group_funds_visible: Whether group funds are visible.\n are_group_games_visible: Whether group games are visible.\n is_group_name_change_enabled: Whether group name changes are enabled.\n can_change_group_name: Whether the name of this group can be changed.\n \"\"\"\n\n def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: The Client this object belongs to.\n data: The group settings data.\n \"\"\"\n\n self._client: Client = client\n self.is_approval_required: bool = data[\"isApprovalRequired\"]\n self.is_builders_club_required: bool = data[\"isBuildersClubRequired\"]\n self.are_enemies_allowed: bool = data[\"areEnemiesAllowed\"]\n self.are_group_funds_visible: bool = data[\"areGroupFundsVisible\"]\n self.are_group_games_visible: bool = data[\"areGroupGamesVisible\"]\n self.is_group_name_change_enabled: bool = data[\"isGroupNameChangeEnabled\"]\n self.can_change_group_name: bool = data[\"canChangeGroupName\"]\n
"},{"location":"reference/bases/basegroup/#roblox.bases.basegroup.GroupSettings.__init__","title":"__init__(client, data)
","text":"Parameters:
Name Type Description Defaultclient
Client
The Client this object belongs to.
requireddata
dict
The group settings data.
required Source code inroblox/bases/basegroup.py
def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: The Client this object belongs to.\n data: The group settings data.\n \"\"\"\n\n self._client: Client = client\n self.is_approval_required: bool = data[\"isApprovalRequired\"]\n self.is_builders_club_required: bool = data[\"isBuildersClubRequired\"]\n self.are_enemies_allowed: bool = data[\"areEnemiesAllowed\"]\n self.are_group_funds_visible: bool = data[\"areGroupFundsVisible\"]\n self.are_group_games_visible: bool = data[\"areGroupGamesVisible\"]\n self.is_group_name_change_enabled: bool = data[\"isGroupNameChangeEnabled\"]\n self.can_change_group_name: bool = data[\"canChangeGroupName\"]\n
"},{"location":"reference/bases/basegroup/#roblox.bases.basegroup.JoinRequest","title":"JoinRequest
","text":"Represents a group join request.
Attributes:
Name Type Descriptioncreated
datetime
When this join request was sent.
requester
The user that sent the join request.
group
BaseGroup
The parent group that this join request is linked to.
Source code inroblox/bases/basegroup.py
class JoinRequest:\n \"\"\"\n Represents a group join request.\n\n Attributes:\n created: When this join request was sent.\n requester: The user that sent the join request.\n group: The parent group that this join request is linked to.\n \"\"\"\n\n def __init__(self, client: Client, data: dict, group: Union[BaseGroup, int]):\n self._client: Client = client\n self.created: datetime = parse(data[\"created\"])\n self.requester = PartialUser(client=self._client, data=data[\"requester\"])\n self.group: BaseGroup\n if isinstance(group, int):\n self.group = BaseGroup(client=self._client, group_id=group)\n else:\n self.group = group\n\n def __int__(self):\n return self.requester.id\n\n async def accept(self):\n \"\"\"\n Accepts this join request.\n \"\"\"\n await self.group.accept_user(self)\n\n async def decline(self):\n \"\"\"\n Declines this join request.\n \"\"\"\n await self.group.decline_user(self)\n
"},{"location":"reference/bases/basegroup/#roblox.bases.basegroup.JoinRequest.accept","title":"accept()
async
","text":"Accepts this join request.
Source code inroblox/bases/basegroup.py
async def accept(self):\n \"\"\"\n Accepts this join request.\n \"\"\"\n await self.group.accept_user(self)\n
"},{"location":"reference/bases/basegroup/#roblox.bases.basegroup.JoinRequest.decline","title":"decline()
async
","text":"Declines this join request.
Source code inroblox/bases/basegroup.py
async def decline(self):\n \"\"\"\n Declines this join request.\n \"\"\"\n await self.group.decline_user(self)\n
"},{"location":"reference/bases/baseinstance/","title":"baseinstance","text":"This file contains the BaseInstance object, which represents a Roblox instance ID.
"},{"location":"reference/bases/baseinstance/#roblox.bases.baseinstance.BaseInstance","title":"BaseInstance
","text":" Bases: BaseItem
Represents a Roblox instance ID. Instance IDs represent the ownership of a single Roblox item.
Attributes:
Name Type Descriptionid
int
The instance ID.
Source code inroblox/bases/baseinstance.py
class BaseInstance(BaseItem):\n \"\"\"\n Represents a Roblox instance ID.\n Instance IDs represent the ownership of a single Roblox item.\n\n Attributes:\n id: The instance ID.\n \"\"\"\n\n def __init__(self, client: Client, instance_id: int):\n \"\"\"\n Arguments:\n client: The Client this object belongs to.\n instance_id: The asset instance ID.\n \"\"\"\n\n self._client: Client = client\n self.id: int = instance_id\n
"},{"location":"reference/bases/baseinstance/#roblox.bases.baseinstance.BaseInstance.__init__","title":"__init__(client, instance_id)
","text":"Parameters:
Name Type Description Defaultclient
Client
The Client this object belongs to.
requiredinstance_id
int
The asset instance ID.
required Source code inroblox/bases/baseinstance.py
def __init__(self, client: Client, instance_id: int):\n \"\"\"\n Arguments:\n client: The Client this object belongs to.\n instance_id: The asset instance ID.\n \"\"\"\n\n self._client: Client = client\n self.id: int = instance_id\n
"},{"location":"reference/bases/baseitem/","title":"baseitem","text":"This file contains the BaseItem class, which all bases inherit.
"},{"location":"reference/bases/baseitem/#roblox.bases.baseitem.BaseItem","title":"BaseItem
","text":"This object represents a base Roblox item. All other bases inherit this object. This object overrides equals and not-equals methods ensuring that two bases with the same ID are always equal.
Source code inroblox/bases/baseitem.py
class BaseItem:\n \"\"\"\n This object represents a base Roblox item. All other bases inherit this object.\n This object overrides equals and not-equals methods ensuring that two bases with the same ID are always equal.\n \"\"\"\n id = None\n\n def __repr__(self):\n attributes_repr = \"\".join(f\" {key}={value!r}\" for key, value in self.__dict__.items() if not key.startswith(\"_\"))\n return f\"<{self.__class__.__name__}{attributes_repr}>\"\n\n def __int__(self):\n return self.id\n\n def __eq__(self, other):\n return isinstance(other, self.__class__) and other.id == self.id\n\n def __ne__(self, other):\n if isinstance(other, self.__class__):\n return other.id != self.id\n return True\n
"},{"location":"reference/bases/basejob/","title":"basejob","text":"This file contains the BaseJob object, which represents a Roblox job ID.
"},{"location":"reference/bases/basejob/#roblox.bases.basejob.BaseJob","title":"BaseJob
","text":" Bases: BaseItem
Represents Roblox job ID.
Job IDs are UUIDs that represent a single game server instance. Learn more on the Developer Hub here.
Attributes:
Name Type Descriptionid
str
The job ID.
Source code inroblox/bases/basejob.py
class BaseJob(BaseItem):\n \"\"\"\n Represents Roblox job ID.\n\n Job IDs are UUIDs that represent a single game server instance.\n Learn more on the Developer Hub [here](https://developer.roblox.com/en-us/api-reference/property/DataModel/JobId).\n\n Attributes:\n id: The job ID.\n \"\"\"\n\n def __init__(self, client: Client, job_id: str):\n \"\"\"\n Arguments:\n client: The Client this object belongs to.\n job_id: The job ID.\n \"\"\"\n\n self._client: Client = client\n self.id: str = job_id\n
"},{"location":"reference/bases/basejob/#roblox.bases.basejob.BaseJob.__init__","title":"__init__(client, job_id)
","text":"Parameters:
Name Type Description Defaultclient
Client
The Client this object belongs to.
requiredjob_id
str
The job ID.
required Source code inroblox/bases/basejob.py
def __init__(self, client: Client, job_id: str):\n \"\"\"\n Arguments:\n client: The Client this object belongs to.\n job_id: The job ID.\n \"\"\"\n\n self._client: Client = client\n self.id: str = job_id\n
"},{"location":"reference/bases/baseplace/","title":"baseplace","text":"This file contains the BasePlace object, which represents a Roblox place ID.
"},{"location":"reference/bases/baseplace/#roblox.bases.baseplace.BasePlace","title":"BasePlace
","text":" Bases: BaseAsset
Represents a Roblox place ID. Places are a form of Asset and as such this object derives from BaseAsset.
Attributes:
Name Type Descriptionid
int
The place ID.
Source code inroblox/bases/baseplace.py
class BasePlace(BaseAsset):\n \"\"\"\n Represents a Roblox place ID.\n Places are a form of Asset and as such this object derives from BaseAsset.\n\n Attributes:\n id: The place ID.\n \"\"\"\n\n def __init__(self, client: Client, place_id: int):\n \"\"\"\n Arguments:\n client: The Client this object belongs to.\n place_id: The place ID.\n \"\"\"\n\n super().__init__(client, place_id)\n\n self._client: Client = client\n self.id: int = place_id\n\n async def get_instances(self, start_index: int = 0):\n \"\"\"\n Returns a list of this place's current active servers, known in the API as \"game instances\".\n This list always contains 10 items or fewer.\n For more items, add 10 to the start index and repeat until no more items are available.\n\n !!! warning\n This function has been deprecated. The Roblox endpoint used by this function has been removed. Please update any code using this method to use \n\n Arguments:\n start_index: Where to start in the server index.\n \"\"\"\n from ..jobs import GameInstances\n\n instances_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"www\", f\"games/getgameinstancesjson\"),\n params={\n \"placeId\": self.id,\n \"startIndex\": start_index\n }\n )\n instances_data = instances_response.json()\n return GameInstances(\n client=self._client,\n data=instances_data\n )\n\n def get_servers(\n self,\n server_type: ServerType,\n page_size: int = 10, \n sort_order: SortOrder = SortOrder.Descending, \n exclude_full_games: bool = False,\n max_items: int = None\n ) -> PageIterator:\n \"\"\"\n Grabs the place's servers.\n\n Arguments:\n server_type: The type of servers to return.\n page_size: How many servers should be returned for each page.\n sort_order: Order in which data should be grabbed.\n exclude_full_games: Whether to exclude full servers.\n max_items: The maximum items to return when looping through this object.\n\n Returns:\n A PageIterator containing servers.\n \"\"\"\n from ..jobs import Server\n\n return PageIterator(\n client=self._client,\n url=self._client._url_generator.get_url(\"games\", f\"v1/games/{self.id}/servers/{server_type.value}\"),\n page_size=page_size,\n max_items=max_items,\n sort_order=sort_order,\n extra_parameters={\"excludeFullGames\": exclude_full_games},\n handler=lambda client, data: Server(client=client, data=data),\n )\n\n def get_private_servers(\n self,\n page_size: int = 10, \n sort_order: SortOrder = SortOrder.Descending, \n max_items: int = None\n ) -> PageIterator:\n \"\"\"\n Grabs the private servers of a place the authenticated user can access.\n\n Arguments:\n page_size: How many private servers should be returned for each page.\n sort_order: Order in which data should be grabbed.\n max_items: The maximum items to return when looping through this object.\n\n Returns:\n A PageIterator containing private servers.\n \"\"\"\n from ..jobs import PrivateServer\n\n return PageIterator(\n client=self._client,\n url=self._client._url_generator.get_url(\"games\", f\"v1/games/{self.id}/private-servers\"),\n page_size=page_size,\n max_items=max_items,\n sort_order=sort_order,\n handler=lambda client, data: PrivateServer(client=client, data=data),\n )\n
"},{"location":"reference/bases/baseplace/#roblox.bases.baseplace.BasePlace.__init__","title":"__init__(client, place_id)
","text":"Parameters:
Name Type Description Defaultclient
Client
The Client this object belongs to.
requiredplace_id
int
The place ID.
required Source code inroblox/bases/baseplace.py
def __init__(self, client: Client, place_id: int):\n \"\"\"\n Arguments:\n client: The Client this object belongs to.\n place_id: The place ID.\n \"\"\"\n\n super().__init__(client, place_id)\n\n self._client: Client = client\n self.id: int = place_id\n
"},{"location":"reference/bases/baseplace/#roblox.bases.baseplace.BasePlace.get_instances","title":"get_instances(start_index=0)
async
","text":"Returns a list of this place's current active servers, known in the API as \"game instances\". This list always contains 10 items or fewer. For more items, add 10 to the start index and repeat until no more items are available.
Warning
This function has been deprecated. The Roblox endpoint used by this function has been removed. Please update any code using this method to use
Parameters:
Name Type Description Defaultstart_index
int
Where to start in the server index.
0
Source code in roblox/bases/baseplace.py
async def get_instances(self, start_index: int = 0):\n \"\"\"\n Returns a list of this place's current active servers, known in the API as \"game instances\".\n This list always contains 10 items or fewer.\n For more items, add 10 to the start index and repeat until no more items are available.\n\n !!! warning\n This function has been deprecated. The Roblox endpoint used by this function has been removed. Please update any code using this method to use \n\n Arguments:\n start_index: Where to start in the server index.\n \"\"\"\n from ..jobs import GameInstances\n\n instances_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"www\", f\"games/getgameinstancesjson\"),\n params={\n \"placeId\": self.id,\n \"startIndex\": start_index\n }\n )\n instances_data = instances_response.json()\n return GameInstances(\n client=self._client,\n data=instances_data\n )\n
"},{"location":"reference/bases/baseplace/#roblox.bases.baseplace.BasePlace.get_private_servers","title":"get_private_servers(page_size=10, sort_order=SortOrder.Descending, max_items=None)
","text":"Grabs the private servers of a place the authenticated user can access.
Parameters:
Name Type Description Defaultpage_size
int
How many private servers should be returned for each page.
10
sort_order
SortOrder
Order in which data should be grabbed.
Descending
max_items
int
The maximum items to return when looping through this object.
None
Returns:
Type DescriptionPageIterator
A PageIterator containing private servers.
Source code inroblox/bases/baseplace.py
def get_private_servers(\n self,\n page_size: int = 10, \n sort_order: SortOrder = SortOrder.Descending, \n max_items: int = None\n) -> PageIterator:\n \"\"\"\n Grabs the private servers of a place the authenticated user can access.\n\n Arguments:\n page_size: How many private servers should be returned for each page.\n sort_order: Order in which data should be grabbed.\n max_items: The maximum items to return when looping through this object.\n\n Returns:\n A PageIterator containing private servers.\n \"\"\"\n from ..jobs import PrivateServer\n\n return PageIterator(\n client=self._client,\n url=self._client._url_generator.get_url(\"games\", f\"v1/games/{self.id}/private-servers\"),\n page_size=page_size,\n max_items=max_items,\n sort_order=sort_order,\n handler=lambda client, data: PrivateServer(client=client, data=data),\n )\n
"},{"location":"reference/bases/baseplace/#roblox.bases.baseplace.BasePlace.get_servers","title":"get_servers(server_type, page_size=10, sort_order=SortOrder.Descending, exclude_full_games=False, max_items=None)
","text":"Grabs the place's servers.
Parameters:
Name Type Description Defaultserver_type
ServerType
The type of servers to return.
requiredpage_size
int
How many servers should be returned for each page.
10
sort_order
SortOrder
Order in which data should be grabbed.
Descending
exclude_full_games
bool
Whether to exclude full servers.
False
max_items
int
The maximum items to return when looping through this object.
None
Returns:
Type DescriptionPageIterator
A PageIterator containing servers.
Source code inroblox/bases/baseplace.py
def get_servers(\n self,\n server_type: ServerType,\n page_size: int = 10, \n sort_order: SortOrder = SortOrder.Descending, \n exclude_full_games: bool = False,\n max_items: int = None\n) -> PageIterator:\n \"\"\"\n Grabs the place's servers.\n\n Arguments:\n server_type: The type of servers to return.\n page_size: How many servers should be returned for each page.\n sort_order: Order in which data should be grabbed.\n exclude_full_games: Whether to exclude full servers.\n max_items: The maximum items to return when looping through this object.\n\n Returns:\n A PageIterator containing servers.\n \"\"\"\n from ..jobs import Server\n\n return PageIterator(\n client=self._client,\n url=self._client._url_generator.get_url(\"games\", f\"v1/games/{self.id}/servers/{server_type.value}\"),\n page_size=page_size,\n max_items=max_items,\n sort_order=sort_order,\n extra_parameters={\"excludeFullGames\": exclude_full_games},\n handler=lambda client, data: Server(client=client, data=data),\n )\n
"},{"location":"reference/bases/baseplugin/","title":"baseplugin","text":"This file contains the BasePlugin object, which represents a Roblox plugin ID.
"},{"location":"reference/bases/baseplugin/#roblox.bases.baseplugin.BasePlugin","title":"BasePlugin
","text":" Bases: BaseAsset
Represents a Roblox plugin ID. Plugins are a form of Asset and as such this object derives from BaseAsset.
Attributes:
Name Type Descriptionid
int
The plugin ID.
Source code inroblox/bases/baseplugin.py
class BasePlugin(BaseAsset):\n \"\"\"\n Represents a Roblox plugin ID.\n Plugins are a form of Asset and as such this object derives from BaseAsset.\n\n Attributes:\n id: The plugin ID.\n \"\"\"\n\n def __init__(self, client: Client, plugin_id: int):\n \"\"\"\n Arguments:\n client: The Client this object belongs to.\n plugin_id: The plugin ID.\n \"\"\"\n\n super().__init__(client, plugin_id)\n\n self._client: Client = client\n self.id: int = plugin_id\n\n async def update(self, name: str = None, description: str = None, comments_enabled: str = None):\n \"\"\"\n Updates the plugin's data.\n\n Arguments:\n name: The new group name.\n description: The new group description.\n comments_enabled: Whether to enable comments.\n \"\"\"\n await self._client.requests.patch(\n url=self._client.url_generator.get_url(\n \"develop\", f\"v1/plugins/{self.id}\"\n ),\n json={\n \"name\": name,\n \"description\": description,\n \"commentsEnabled\": comments_enabled\n }\n )\n
"},{"location":"reference/bases/baseplugin/#roblox.bases.baseplugin.BasePlugin.__init__","title":"__init__(client, plugin_id)
","text":"Parameters:
Name Type Description Defaultclient
Client
The Client this object belongs to.
requiredplugin_id
int
The plugin ID.
required Source code inroblox/bases/baseplugin.py
def __init__(self, client: Client, plugin_id: int):\n \"\"\"\n Arguments:\n client: The Client this object belongs to.\n plugin_id: The plugin ID.\n \"\"\"\n\n super().__init__(client, plugin_id)\n\n self._client: Client = client\n self.id: int = plugin_id\n
"},{"location":"reference/bases/baseplugin/#roblox.bases.baseplugin.BasePlugin.update","title":"update(name=None, description=None, comments_enabled=None)
async
","text":"Updates the plugin's data.
Parameters:
Name Type Description Defaultname
str
The new group name.
None
description
str
The new group description.
None
comments_enabled
str
Whether to enable comments.
None
Source code in roblox/bases/baseplugin.py
async def update(self, name: str = None, description: str = None, comments_enabled: str = None):\n \"\"\"\n Updates the plugin's data.\n\n Arguments:\n name: The new group name.\n description: The new group description.\n comments_enabled: Whether to enable comments.\n \"\"\"\n await self._client.requests.patch(\n url=self._client.url_generator.get_url(\n \"develop\", f\"v1/plugins/{self.id}\"\n ),\n json={\n \"name\": name,\n \"description\": description,\n \"commentsEnabled\": comments_enabled\n }\n )\n
"},{"location":"reference/bases/baserobloxbadge/","title":"baserobloxbadge","text":"This file contains the BaseRobloxBadge object, which represents a Roblox roblox badge ID.
"},{"location":"reference/bases/baserobloxbadge/#roblox.bases.baserobloxbadge.BaseRobloxBadge","title":"BaseRobloxBadge
","text":" Bases: BaseItem
Represents a Roblox roblox badge ID.
Warning
This is not a badge! It is a roblox badge.
Attributes:
Name Type Descriptionid
int
The roblox badge ID.
Source code inroblox/bases/baserobloxbadge.py
class BaseRobloxBadge(BaseItem):\n \"\"\"\n Represents a Roblox roblox badge ID.\n !!! warning\n This is not a badge! It is a **roblox badge**.\n\n Attributes:\n id: The roblox badge ID.\n \"\"\"\n\n def __init__(self, client: Client, roblox_badge_id: int):\n \"\"\"\n Arguments:\n client: The Client this object belongs to.\n roblox_badge_id: The roblox badge ID.\n \"\"\"\n\n self._client: Client = client\n self.id: int = roblox_badge_id\n
"},{"location":"reference/bases/baserobloxbadge/#roblox.bases.baserobloxbadge.BaseRobloxBadge.__init__","title":"__init__(client, roblox_badge_id)
","text":"Parameters:
Name Type Description Defaultclient
Client
The Client this object belongs to.
requiredroblox_badge_id
int
The roblox badge ID.
required Source code inroblox/bases/baserobloxbadge.py
def __init__(self, client: Client, roblox_badge_id: int):\n \"\"\"\n Arguments:\n client: The Client this object belongs to.\n roblox_badge_id: The roblox badge ID.\n \"\"\"\n\n self._client: Client = client\n self.id: int = roblox_badge_id\n
"},{"location":"reference/bases/baserole/","title":"baserole","text":"This file contains the BaseRole object, which represents a Roblox group role ID.
"},{"location":"reference/bases/baserole/#roblox.bases.baserole.BaseRole","title":"BaseRole
","text":" Bases: BaseItem
Represents a Roblox group role ID.
Attributes:
Name Type Descriptionid
int
The role ID.
Source code inroblox/bases/baserole.py
class BaseRole(BaseItem):\n \"\"\"\n Represents a Roblox group role ID.\n\n Attributes:\n id: The role ID.\n \"\"\"\n\n def __init__(self, client: Client, role_id: int):\n \"\"\"\n Arguments:\n client: The Client this object belongs to.\n role_id: The role ID.\n \"\"\"\n\n self._client: Client = client\n self.id: int = role_id\n
"},{"location":"reference/bases/baserole/#roblox.bases.baserole.BaseRole.__init__","title":"__init__(client, role_id)
","text":"Parameters:
Name Type Description Defaultclient
Client
The Client this object belongs to.
requiredrole_id
int
The role ID.
required Source code inroblox/bases/baserole.py
def __init__(self, client: Client, role_id: int):\n \"\"\"\n Arguments:\n client: The Client this object belongs to.\n role_id: The role ID.\n \"\"\"\n\n self._client: Client = client\n self.id: int = role_id\n
"},{"location":"reference/bases/basesociallink/","title":"basesociallink","text":"This file contains the BaseUniverseSocialLink object, which represents a Roblox social link ID.
"},{"location":"reference/bases/basesociallink/#roblox.bases.basesociallink.BaseUniverseSocialLink","title":"BaseUniverseSocialLink
","text":" Bases: BaseItem
Represents a Roblox universe social link ID.
Attributes:
Name Type Descriptionid
int
The universe social link ID.
Source code inroblox/bases/basesociallink.py
class BaseUniverseSocialLink(BaseItem):\n \"\"\"\n Represents a Roblox universe social link ID.\n\n Attributes:\n id: The universe social link ID.\n \"\"\"\n\n def __init__(self, client: Client, social_link_id: int):\n \"\"\"\n Arguments:\n client: The Client this object belongs to.\n social_link_id: The universe social link ID.\n \"\"\"\n\n self._client: Client = client\n self.id: int = social_link_id\n
"},{"location":"reference/bases/basesociallink/#roblox.bases.basesociallink.BaseUniverseSocialLink.__init__","title":"__init__(client, social_link_id)
","text":"Parameters:
Name Type Description Defaultclient
Client
The Client this object belongs to.
requiredsocial_link_id
int
The universe social link ID.
required Source code inroblox/bases/basesociallink.py
def __init__(self, client: Client, social_link_id: int):\n \"\"\"\n Arguments:\n client: The Client this object belongs to.\n social_link_id: The universe social link ID.\n \"\"\"\n\n self._client: Client = client\n self.id: int = social_link_id\n
"},{"location":"reference/bases/baseuniverse/","title":"baseuniverse","text":"This file contains the BaseUniverse object, which represents a Roblox universe ID. It also contains the UniverseLiveStats object, which represents a universe's live stats.
"},{"location":"reference/bases/baseuniverse/#roblox.bases.baseuniverse.BaseUniverse","title":"BaseUniverse
","text":" Bases: BaseItem
Represents a Roblox universe ID.
Attributes:
Name Type Descriptionid
int
The universe ID.
Source code inroblox/bases/baseuniverse.py
class BaseUniverse(BaseItem):\n \"\"\"\n Represents a Roblox universe ID.\n\n Attributes:\n id: The universe ID.\n \"\"\"\n\n def __init__(self, client: Client, universe_id: int):\n \"\"\"\n Arguments:\n client: The Client this object belongs to.\n universe_id: The universe ID.\n \"\"\"\n\n self._client: Client = client\n self.id: int = universe_id\n\n async def get_favorite_count(self) -> int:\n \"\"\"\n Grabs the universe's favorite count.\n\n Returns:\n The universe's favorite count.\n \"\"\"\n favorite_count_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"games\", f\"v1/games/{self.id}/favorites/count\")\n )\n favorite_count_data = favorite_count_response.json()\n return favorite_count_data[\"favoritesCount\"]\n\n async def is_favorited(self) -> bool:\n \"\"\"\n Grabs the authenticated user's favorite status for this game.\n\n Returns:\n Whether the authenticated user has favorited this game.\n \"\"\"\n is_favorited_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"games\", f\"v1/games/{self.id}/favorites\")\n )\n is_favorited_data = is_favorited_response.json()\n return is_favorited_data[\"isFavorited\"]\n\n def get_badges(self, page_size: int = 10, sort_order: SortOrder = SortOrder.Ascending,\n max_items: int = None) -> PageIterator:\n \"\"\"\n Gets the universe's badges.\n\n Arguments:\n page_size: How many members should be returned for each page.\n sort_order: Order in which data should be grabbed.\n max_items: The maximum items to return when looping through this object.\n\n Returns:\n A PageIterator containing this universe's badges.\n \"\"\"\n\n return PageIterator(\n client=self._client,\n url=self._client.url_generator.get_url(\"badges\", f\"v1/universes/{self.id}/badges\"),\n page_size=page_size,\n sort_order=sort_order,\n max_items=max_items,\n handler=_universe_badges_handler,\n )\n\n async def get_live_stats(self) -> UniverseLiveStats:\n \"\"\"\n Gets the universe's live stats.\n This data does not update live. These are just the stats that are shown on the website's live stats display.\n\n Returns:\n The universe's live stats.\n \"\"\"\n stats_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"develop\", f\"v1/universes/{self.id}/live-stats\")\n )\n stats_data = stats_response.json()\n return UniverseLiveStats(data=stats_data)\n\n def get_gamepasses(self, page_size: int = 10, sort_order: SortOrder = SortOrder.Ascending,\n max_items: int = None) -> PageIterator:\n \"\"\"\n Gets the universe's gamepasses.\n\n Arguments:\n page_size: How many members should be returned for each page.\n sort_order: Order in which data should be grabbed.\n max_items: The maximum items to return when looping through this object.\n\n Returns:\n A PageIterator containing the universe's gamepasses.\n \"\"\"\n\n return PageIterator(\n client=self._client,\n url=self._client.url_generator.get_url(\"games\", f\"v1/games/{self.id}/game-passes\"),\n page_size=page_size,\n sort_order=sort_order,\n max_items=max_items,\n handler=lambda client, data: GamePass(client, data),\n )\n\n async def get_social_links(self) -> List[SocialLink]:\n \"\"\"\n Gets the universe's social links.\n\n Returns:\n A list of the universe's social links.\n \"\"\"\n\n links_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"games\", f\"v1/games/{self.id}/social-links/list\")\n )\n links_data = links_response.json()[\"data\"]\n return [SocialLink(client=self._client, data=link_data) for link_data in links_data]\n
"},{"location":"reference/bases/baseuniverse/#roblox.bases.baseuniverse.BaseUniverse.__init__","title":"__init__(client, universe_id)
","text":"Parameters:
Name Type Description Defaultclient
Client
The Client this object belongs to.
requireduniverse_id
int
The universe ID.
required Source code inroblox/bases/baseuniverse.py
def __init__(self, client: Client, universe_id: int):\n \"\"\"\n Arguments:\n client: The Client this object belongs to.\n universe_id: The universe ID.\n \"\"\"\n\n self._client: Client = client\n self.id: int = universe_id\n
"},{"location":"reference/bases/baseuniverse/#roblox.bases.baseuniverse.BaseUniverse.get_badges","title":"get_badges(page_size=10, sort_order=SortOrder.Ascending, max_items=None)
","text":"Gets the universe's badges.
Parameters:
Name Type Description Defaultpage_size
int
How many members should be returned for each page.
10
sort_order
SortOrder
Order in which data should be grabbed.
Ascending
max_items
int
The maximum items to return when looping through this object.
None
Returns:
Type DescriptionPageIterator
A PageIterator containing this universe's badges.
Source code inroblox/bases/baseuniverse.py
def get_badges(self, page_size: int = 10, sort_order: SortOrder = SortOrder.Ascending,\n max_items: int = None) -> PageIterator:\n \"\"\"\n Gets the universe's badges.\n\n Arguments:\n page_size: How many members should be returned for each page.\n sort_order: Order in which data should be grabbed.\n max_items: The maximum items to return when looping through this object.\n\n Returns:\n A PageIterator containing this universe's badges.\n \"\"\"\n\n return PageIterator(\n client=self._client,\n url=self._client.url_generator.get_url(\"badges\", f\"v1/universes/{self.id}/badges\"),\n page_size=page_size,\n sort_order=sort_order,\n max_items=max_items,\n handler=_universe_badges_handler,\n )\n
"},{"location":"reference/bases/baseuniverse/#roblox.bases.baseuniverse.BaseUniverse.get_favorite_count","title":"get_favorite_count()
async
","text":"Grabs the universe's favorite count.
Returns:
Type Descriptionint
The universe's favorite count.
Source code inroblox/bases/baseuniverse.py
async def get_favorite_count(self) -> int:\n \"\"\"\n Grabs the universe's favorite count.\n\n Returns:\n The universe's favorite count.\n \"\"\"\n favorite_count_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"games\", f\"v1/games/{self.id}/favorites/count\")\n )\n favorite_count_data = favorite_count_response.json()\n return favorite_count_data[\"favoritesCount\"]\n
"},{"location":"reference/bases/baseuniverse/#roblox.bases.baseuniverse.BaseUniverse.get_gamepasses","title":"get_gamepasses(page_size=10, sort_order=SortOrder.Ascending, max_items=None)
","text":"Gets the universe's gamepasses.
Parameters:
Name Type Description Defaultpage_size
int
How many members should be returned for each page.
10
sort_order
SortOrder
Order in which data should be grabbed.
Ascending
max_items
int
The maximum items to return when looping through this object.
None
Returns:
Type DescriptionPageIterator
A PageIterator containing the universe's gamepasses.
Source code inroblox/bases/baseuniverse.py
def get_gamepasses(self, page_size: int = 10, sort_order: SortOrder = SortOrder.Ascending,\n max_items: int = None) -> PageIterator:\n \"\"\"\n Gets the universe's gamepasses.\n\n Arguments:\n page_size: How many members should be returned for each page.\n sort_order: Order in which data should be grabbed.\n max_items: The maximum items to return when looping through this object.\n\n Returns:\n A PageIterator containing the universe's gamepasses.\n \"\"\"\n\n return PageIterator(\n client=self._client,\n url=self._client.url_generator.get_url(\"games\", f\"v1/games/{self.id}/game-passes\"),\n page_size=page_size,\n sort_order=sort_order,\n max_items=max_items,\n handler=lambda client, data: GamePass(client, data),\n )\n
"},{"location":"reference/bases/baseuniverse/#roblox.bases.baseuniverse.BaseUniverse.get_live_stats","title":"get_live_stats()
async
","text":"Gets the universe's live stats. This data does not update live. These are just the stats that are shown on the website's live stats display.
Returns:
Type DescriptionUniverseLiveStats
The universe's live stats.
Source code inroblox/bases/baseuniverse.py
async def get_live_stats(self) -> UniverseLiveStats:\n \"\"\"\n Gets the universe's live stats.\n This data does not update live. These are just the stats that are shown on the website's live stats display.\n\n Returns:\n The universe's live stats.\n \"\"\"\n stats_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"develop\", f\"v1/universes/{self.id}/live-stats\")\n )\n stats_data = stats_response.json()\n return UniverseLiveStats(data=stats_data)\n
"},{"location":"reference/bases/baseuniverse/#roblox.bases.baseuniverse.BaseUniverse.get_social_links","title":"get_social_links()
async
","text":"Gets the universe's social links.
Returns:
Type DescriptionList[SocialLink]
A list of the universe's social links.
Source code inroblox/bases/baseuniverse.py
async def get_social_links(self) -> List[SocialLink]:\n \"\"\"\n Gets the universe's social links.\n\n Returns:\n A list of the universe's social links.\n \"\"\"\n\n links_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"games\", f\"v1/games/{self.id}/social-links/list\")\n )\n links_data = links_response.json()[\"data\"]\n return [SocialLink(client=self._client, data=link_data) for link_data in links_data]\n
"},{"location":"reference/bases/baseuniverse/#roblox.bases.baseuniverse.BaseUniverse.is_favorited","title":"is_favorited()
async
","text":"Grabs the authenticated user's favorite status for this game.
Returns:
Type Descriptionbool
Whether the authenticated user has favorited this game.
Source code inroblox/bases/baseuniverse.py
async def is_favorited(self) -> bool:\n \"\"\"\n Grabs the authenticated user's favorite status for this game.\n\n Returns:\n Whether the authenticated user has favorited this game.\n \"\"\"\n is_favorited_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"games\", f\"v1/games/{self.id}/favorites\")\n )\n is_favorited_data = is_favorited_response.json()\n return is_favorited_data[\"isFavorited\"]\n
"},{"location":"reference/bases/baseuniverse/#roblox.bases.baseuniverse.UniverseLiveStats","title":"UniverseLiveStats
","text":"Represents a universe's live stats.
Attributes:
Name Type Descriptiontotal_player_count
int
The amount of players present in this universe's subplaces.
game_count
int
The amount of active servers for this universe's subplaces.
player_counts_by_device_type
Dict[str, int]
A dictionary where the keys are device types and the values are the amount of this universe's subplace's active players which are on that device type.
Source code inroblox/bases/baseuniverse.py
class UniverseLiveStats:\n \"\"\"\n Represents a universe's live stats.\n\n Attributes:\n total_player_count: The amount of players present in this universe's subplaces.\n game_count: The amount of active servers for this universe's subplaces.\n player_counts_by_device_type: A dictionary where the keys are device types and the values are the amount of\n this universe's subplace's active players which are on that device type.\n \"\"\"\n\n def __init__(self, data: dict):\n self.total_player_count: int = data[\"totalPlayerCount\"]\n self.game_count: int = data[\"gameCount\"]\n self.player_counts_by_device_type: Dict[str, int] = data[\"playerCountsByDeviceType\"]\n
"},{"location":"reference/bases/baseuser/","title":"baseuser","text":"This file contains the BaseUser object, which represents a Roblox user ID.
"},{"location":"reference/bases/baseuser/#roblox.bases.baseuser.BaseUser","title":"BaseUser
","text":" Bases: BaseItem
Represents a Roblox user ID.
Attributes:
Name Type Descriptionid
int
The user ID.
Source code inroblox/bases/baseuser.py
class BaseUser(BaseItem):\n \"\"\"\n Represents a Roblox user ID.\n\n Attributes:\n id: The user ID.\n \"\"\"\n\n def __init__(self, client: Client, user_id: int):\n \"\"\"\n Arguments:\n client: The Client this object belongs to.\n user_id: The user ID.\n \"\"\"\n\n self._client: Client = client\n self.id: int = user_id\n\n def username_history(\n self, page_size: int = 10, sort_order: SortOrder = SortOrder.Ascending, max_items: int = None\n ) -> PageIterator:\n \"\"\"\n Grabs the user's username history.\n\n Arguments:\n page_size: How many members should be returned for each page.\n sort_order: Order in which data should be grabbed.\n max_items: The maximum items to return when looping through this object.\n\n Returns:\n A PageIterator containing the user's username history.\n \"\"\"\n return PageIterator(\n client=self._client,\n url=self._client.url_generator.get_url(\n \"users\", f\"v1/users/{self.id}/username-history\"\n ),\n page_size=page_size,\n sort_order=sort_order,\n max_items=max_items,\n handler=lambda client, data: data[\"name\"],\n )\n\n async def get_presence(self) -> Optional[Presence]:\n \"\"\"\n Grabs the user's presence.\n\n Returns:\n The user's presence, if they have an active presence.\n \"\"\"\n presences = await self._client.presence.get_user_presences([self.id])\n try:\n return presences[0]\n except IndexError:\n return None\n\n async def get_friends(self) -> List[Friend]:\n \"\"\"\n Grabs the user's friends.\n\n Returns:\n A list of the user's friends.\n \"\"\"\n\n from ..friends import Friend\n friends_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"friends\", f\"v1/users/{self.id}/friends\")\n )\n friends_data = friends_response.json()[\"data\"]\n return [Friend(client=self._client, data=friend_data) for friend_data in friends_data]\n\n async def get_currency(self) -> int:\n \"\"\"\n Grabs the user's current Robux amount. Only works on the authenticated user.\n\n Returns:\n The user's Robux amount.\n \"\"\"\n currency_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"economy\", f\"v1/users/{self.id}/currency\")\n )\n currency_data = currency_response.json()\n return currency_data[\"robux\"]\n\n async def has_premium(self) -> bool:\n \"\"\"\n Checks if the user has a Roblox Premium membership.\n\n Returns:\n Whether the user has Premium or not.\n \"\"\"\n premium_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"premiumfeatures\", f\"v1/users/{self.id}/validate-membership\")\n )\n premium_data = premium_response.text\n return premium_data == \"true\"\n\n async def get_item_instance(self, item_type: InstanceType, item_id: int) -> Optional[ItemInstance]:\n \"\"\"\n Gets an item instance for a specific user.\n\n Arguments:\n item_type: The type of item to get an instance for.\n item_id: The item's ID.\n\n Returns: An ItemInstance, if it exists.\n \"\"\"\n\n item_type: str = item_type.value.lower()\n\n # this is so we can have special classes for other types\n item_class = instance_classes.get(item_type) or ItemInstance\n\n instance_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"inventory\", f\"v1/users/{self.id}/items/{item_type}/{item_id}\")\n )\n instance_data = instance_response.json()[\"data\"]\n if len(instance_data) > 0:\n return item_class(\n client=self._client,\n data=instance_data[0]\n )\n else:\n return None\n\n async def get_asset_instance(self, asset: AssetOrAssetId) -> Optional[AssetInstance]:\n \"\"\"\n Checks if a user owns the asset, and returns details about the asset if they do.\n\n Returns:\n An asset instance, if the user owns this asset.\n \"\"\"\n return await self.get_item_instance(\n item_type=InstanceType.asset,\n item_id=int(asset)\n )\n\n async def get_gamepass_instance(self, gamepass: GamePassOrGamePassId) -> Optional[GamePassInstance]:\n \"\"\"\n Checks if a user owns the gamepass, and returns details about the asset if they do.\n\n Returns:\n An gamepass instance, if the user owns this gamepass.\n \"\"\"\n return await self.get_item_instance(\n item_type=InstanceType.gamepass,\n item_id=int(gamepass)\n )\n\n async def get_badge_awarded_dates(self, badges: list[BaseBadge]) -> List[PartialBadge]:\n \"\"\"\n Gets the dates that each badge in a list of badges were awarded to this user.\n\n Returns:\n A list of partial badges containing badge awarded dates.\n \"\"\"\n awarded_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"badges\", f\"v1/users/{self.id}/badges/awarded-dates\"),\n params={\n \"badgeIds\": [badge.id for badge in badges]\n }\n )\n awarded_data: list = awarded_response.json()[\"data\"]\n return [\n PartialBadge(\n client=self._client,\n data=partial_data\n ) for partial_data in awarded_data\n ]\n\n async def get_group_roles(self) -> List[Role]:\n \"\"\"\n Gets a list of roles for all groups this user is in.\n\n Returns:\n A list of roles.\n \"\"\"\n from ..roles import Role\n from ..groups import Group\n roles_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"groups\", f\"v1/users/{self.id}/groups/roles\")\n )\n roles_data = roles_response.json()[\"data\"]\n return [\n Role(\n client=self._client,\n data=role_data[\"role\"],\n group=Group(\n client=self._client,\n data=role_data[\"group\"]\n )\n ) for role_data in roles_data\n ]\n\n async def get_roblox_badges(self) -> List[RobloxBadge]:\n \"\"\"\n Gets the user's Roblox badges.\n\n Returns:\n A list of Roblox badges.\n \"\"\"\n\n badges_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"accountinformation\", f\"v1/users/{self.id}/roblox-badges\")\n )\n badges_data = badges_response.json()\n return [RobloxBadge(client=self._client, data=badge_data) for badge_data in badges_data]\n\n async def get_promotion_channels(self) -> UserPromotionChannels:\n \"\"\"\n Gets the user's promotion channels.\n\n Returns:\n The user's promotion channels.\n \"\"\"\n channels_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"accountinformation\", f\"v1/users/{self.id}/promotion-channels\")\n )\n channels_data = channels_response.json()\n return UserPromotionChannels(\n data=channels_data\n )\n\n async def _get_friend_channel_count(self, channel: str) -> int:\n count_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"friends\", f\"v1/users/{self.id}/{channel}/count\")\n )\n return count_response.json()[\"count\"]\n\n def _get_friend_channel_iterator(\n self,\n channel: str,\n page_size: int = 10,\n sort_order: SortOrder = SortOrder.Ascending, max_items: int = None\n ) -> PageIterator:\n from ..friends import Friend\n return PageIterator(\n client=self._client,\n url=self._client.url_generator.get_url(\"friends\", f\"v1/users/{self.id}/{channel}\"),\n page_size=page_size,\n sort_order=sort_order,\n max_items=max_items,\n handler=lambda client, data: Friend(client=client, data=data)\n )\n\n async def get_friend_count(self) -> int:\n \"\"\"\n Gets the user's friend count.\n\n Returns:\n The user's friend count.\n \"\"\"\n return await self._get_friend_channel_count(\"friends\")\n\n async def get_follower_count(self) -> int:\n \"\"\"\n Gets the user's follower count.\n\n Returns:\n The user's follower count.\n \"\"\"\n return await self._get_friend_channel_count(\"followers\")\n\n async def get_following_count(self) -> int:\n \"\"\"\n Gets the user's following count.\n\n Returns:\n The user's following count.\n \"\"\"\n return await self._get_friend_channel_count(\"followings\")\n\n def get_followers(\n self,\n page_size: int = 10,\n sort_order: SortOrder = SortOrder.Ascending, max_items: int = None\n ) -> PageIterator:\n \"\"\"\n Gets the user's followers.\n\n Returns:\n A PageIterator containing everyone who follows this user.\n \"\"\"\n return self._get_friend_channel_iterator(\n channel=\"followers\",\n page_size=page_size,\n sort_order=sort_order,\n max_items=max_items,\n )\n\n def get_followings(\n self,\n page_size: int = 10,\n sort_order: SortOrder = SortOrder.Ascending, max_items: int = None\n ) -> PageIterator:\n \"\"\"\n Gets the user's followings.\n\n Returns:\n A PageIterator containing everyone that this user is following.\n \"\"\"\n return self._get_friend_channel_iterator(\n channel=\"followings\",\n page_size=page_size,\n sort_order=sort_order,\n max_items=max_items,\n )\n
"},{"location":"reference/bases/baseuser/#roblox.bases.baseuser.BaseUser.__init__","title":"__init__(client, user_id)
","text":"Parameters:
Name Type Description Defaultclient
Client
The Client this object belongs to.
requireduser_id
int
The user ID.
required Source code inroblox/bases/baseuser.py
def __init__(self, client: Client, user_id: int):\n \"\"\"\n Arguments:\n client: The Client this object belongs to.\n user_id: The user ID.\n \"\"\"\n\n self._client: Client = client\n self.id: int = user_id\n
"},{"location":"reference/bases/baseuser/#roblox.bases.baseuser.BaseUser.get_asset_instance","title":"get_asset_instance(asset)
async
","text":"Checks if a user owns the asset, and returns details about the asset if they do.
Returns:
Type DescriptionOptional[AssetInstance]
An asset instance, if the user owns this asset.
Source code inroblox/bases/baseuser.py
async def get_asset_instance(self, asset: AssetOrAssetId) -> Optional[AssetInstance]:\n \"\"\"\n Checks if a user owns the asset, and returns details about the asset if they do.\n\n Returns:\n An asset instance, if the user owns this asset.\n \"\"\"\n return await self.get_item_instance(\n item_type=InstanceType.asset,\n item_id=int(asset)\n )\n
"},{"location":"reference/bases/baseuser/#roblox.bases.baseuser.BaseUser.get_badge_awarded_dates","title":"get_badge_awarded_dates(badges)
async
","text":"Gets the dates that each badge in a list of badges were awarded to this user.
Returns:
Type DescriptionList[PartialBadge]
A list of partial badges containing badge awarded dates.
Source code inroblox/bases/baseuser.py
async def get_badge_awarded_dates(self, badges: list[BaseBadge]) -> List[PartialBadge]:\n \"\"\"\n Gets the dates that each badge in a list of badges were awarded to this user.\n\n Returns:\n A list of partial badges containing badge awarded dates.\n \"\"\"\n awarded_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"badges\", f\"v1/users/{self.id}/badges/awarded-dates\"),\n params={\n \"badgeIds\": [badge.id for badge in badges]\n }\n )\n awarded_data: list = awarded_response.json()[\"data\"]\n return [\n PartialBadge(\n client=self._client,\n data=partial_data\n ) for partial_data in awarded_data\n ]\n
"},{"location":"reference/bases/baseuser/#roblox.bases.baseuser.BaseUser.get_currency","title":"get_currency()
async
","text":"Grabs the user's current Robux amount. Only works on the authenticated user.
Returns:
Type Descriptionint
The user's Robux amount.
Source code inroblox/bases/baseuser.py
async def get_currency(self) -> int:\n \"\"\"\n Grabs the user's current Robux amount. Only works on the authenticated user.\n\n Returns:\n The user's Robux amount.\n \"\"\"\n currency_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"economy\", f\"v1/users/{self.id}/currency\")\n )\n currency_data = currency_response.json()\n return currency_data[\"robux\"]\n
"},{"location":"reference/bases/baseuser/#roblox.bases.baseuser.BaseUser.get_follower_count","title":"get_follower_count()
async
","text":"Gets the user's follower count.
Returns:
Type Descriptionint
The user's follower count.
Source code inroblox/bases/baseuser.py
async def get_follower_count(self) -> int:\n \"\"\"\n Gets the user's follower count.\n\n Returns:\n The user's follower count.\n \"\"\"\n return await self._get_friend_channel_count(\"followers\")\n
"},{"location":"reference/bases/baseuser/#roblox.bases.baseuser.BaseUser.get_followers","title":"get_followers(page_size=10, sort_order=SortOrder.Ascending, max_items=None)
","text":"Gets the user's followers.
Returns:
Type DescriptionPageIterator
A PageIterator containing everyone who follows this user.
Source code inroblox/bases/baseuser.py
def get_followers(\n self,\n page_size: int = 10,\n sort_order: SortOrder = SortOrder.Ascending, max_items: int = None\n) -> PageIterator:\n \"\"\"\n Gets the user's followers.\n\n Returns:\n A PageIterator containing everyone who follows this user.\n \"\"\"\n return self._get_friend_channel_iterator(\n channel=\"followers\",\n page_size=page_size,\n sort_order=sort_order,\n max_items=max_items,\n )\n
"},{"location":"reference/bases/baseuser/#roblox.bases.baseuser.BaseUser.get_following_count","title":"get_following_count()
async
","text":"Gets the user's following count.
Returns:
Type Descriptionint
The user's following count.
Source code inroblox/bases/baseuser.py
async def get_following_count(self) -> int:\n \"\"\"\n Gets the user's following count.\n\n Returns:\n The user's following count.\n \"\"\"\n return await self._get_friend_channel_count(\"followings\")\n
"},{"location":"reference/bases/baseuser/#roblox.bases.baseuser.BaseUser.get_followings","title":"get_followings(page_size=10, sort_order=SortOrder.Ascending, max_items=None)
","text":"Gets the user's followings.
Returns:
Type DescriptionPageIterator
A PageIterator containing everyone that this user is following.
Source code inroblox/bases/baseuser.py
def get_followings(\n self,\n page_size: int = 10,\n sort_order: SortOrder = SortOrder.Ascending, max_items: int = None\n) -> PageIterator:\n \"\"\"\n Gets the user's followings.\n\n Returns:\n A PageIterator containing everyone that this user is following.\n \"\"\"\n return self._get_friend_channel_iterator(\n channel=\"followings\",\n page_size=page_size,\n sort_order=sort_order,\n max_items=max_items,\n )\n
"},{"location":"reference/bases/baseuser/#roblox.bases.baseuser.BaseUser.get_friend_count","title":"get_friend_count()
async
","text":"Gets the user's friend count.
Returns:
Type Descriptionint
The user's friend count.
Source code inroblox/bases/baseuser.py
async def get_friend_count(self) -> int:\n \"\"\"\n Gets the user's friend count.\n\n Returns:\n The user's friend count.\n \"\"\"\n return await self._get_friend_channel_count(\"friends\")\n
"},{"location":"reference/bases/baseuser/#roblox.bases.baseuser.BaseUser.get_friends","title":"get_friends()
async
","text":"Grabs the user's friends.
Returns:
Type DescriptionList[Friend]
A list of the user's friends.
Source code inroblox/bases/baseuser.py
async def get_friends(self) -> List[Friend]:\n \"\"\"\n Grabs the user's friends.\n\n Returns:\n A list of the user's friends.\n \"\"\"\n\n from ..friends import Friend\n friends_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"friends\", f\"v1/users/{self.id}/friends\")\n )\n friends_data = friends_response.json()[\"data\"]\n return [Friend(client=self._client, data=friend_data) for friend_data in friends_data]\n
"},{"location":"reference/bases/baseuser/#roblox.bases.baseuser.BaseUser.get_gamepass_instance","title":"get_gamepass_instance(gamepass)
async
","text":"Checks if a user owns the gamepass, and returns details about the asset if they do.
Returns:
Type DescriptionOptional[GamePassInstance]
An gamepass instance, if the user owns this gamepass.
Source code inroblox/bases/baseuser.py
async def get_gamepass_instance(self, gamepass: GamePassOrGamePassId) -> Optional[GamePassInstance]:\n \"\"\"\n Checks if a user owns the gamepass, and returns details about the asset if they do.\n\n Returns:\n An gamepass instance, if the user owns this gamepass.\n \"\"\"\n return await self.get_item_instance(\n item_type=InstanceType.gamepass,\n item_id=int(gamepass)\n )\n
"},{"location":"reference/bases/baseuser/#roblox.bases.baseuser.BaseUser.get_group_roles","title":"get_group_roles()
async
","text":"Gets a list of roles for all groups this user is in.
Returns:
Type DescriptionList[Role]
A list of roles.
Source code inroblox/bases/baseuser.py
async def get_group_roles(self) -> List[Role]:\n \"\"\"\n Gets a list of roles for all groups this user is in.\n\n Returns:\n A list of roles.\n \"\"\"\n from ..roles import Role\n from ..groups import Group\n roles_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"groups\", f\"v1/users/{self.id}/groups/roles\")\n )\n roles_data = roles_response.json()[\"data\"]\n return [\n Role(\n client=self._client,\n data=role_data[\"role\"],\n group=Group(\n client=self._client,\n data=role_data[\"group\"]\n )\n ) for role_data in roles_data\n ]\n
"},{"location":"reference/bases/baseuser/#roblox.bases.baseuser.BaseUser.get_item_instance","title":"get_item_instance(item_type, item_id)
async
","text":"Gets an item instance for a specific user.
Parameters:
Name Type Description Defaultitem_type
InstanceType
The type of item to get an instance for.
requireditem_id
int
The item's ID.
required Source code inroblox/bases/baseuser.py
async def get_item_instance(self, item_type: InstanceType, item_id: int) -> Optional[ItemInstance]:\n \"\"\"\n Gets an item instance for a specific user.\n\n Arguments:\n item_type: The type of item to get an instance for.\n item_id: The item's ID.\n\n Returns: An ItemInstance, if it exists.\n \"\"\"\n\n item_type: str = item_type.value.lower()\n\n # this is so we can have special classes for other types\n item_class = instance_classes.get(item_type) or ItemInstance\n\n instance_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"inventory\", f\"v1/users/{self.id}/items/{item_type}/{item_id}\")\n )\n instance_data = instance_response.json()[\"data\"]\n if len(instance_data) > 0:\n return item_class(\n client=self._client,\n data=instance_data[0]\n )\n else:\n return None\n
"},{"location":"reference/bases/baseuser/#roblox.bases.baseuser.BaseUser.get_presence","title":"get_presence()
async
","text":"Grabs the user's presence.
Returns:
Type DescriptionOptional[Presence]
The user's presence, if they have an active presence.
Source code inroblox/bases/baseuser.py
async def get_presence(self) -> Optional[Presence]:\n \"\"\"\n Grabs the user's presence.\n\n Returns:\n The user's presence, if they have an active presence.\n \"\"\"\n presences = await self._client.presence.get_user_presences([self.id])\n try:\n return presences[0]\n except IndexError:\n return None\n
"},{"location":"reference/bases/baseuser/#roblox.bases.baseuser.BaseUser.get_promotion_channels","title":"get_promotion_channels()
async
","text":"Gets the user's promotion channels.
Returns:
Type DescriptionUserPromotionChannels
The user's promotion channels.
Source code inroblox/bases/baseuser.py
async def get_promotion_channels(self) -> UserPromotionChannels:\n \"\"\"\n Gets the user's promotion channels.\n\n Returns:\n The user's promotion channels.\n \"\"\"\n channels_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"accountinformation\", f\"v1/users/{self.id}/promotion-channels\")\n )\n channels_data = channels_response.json()\n return UserPromotionChannels(\n data=channels_data\n )\n
"},{"location":"reference/bases/baseuser/#roblox.bases.baseuser.BaseUser.get_roblox_badges","title":"get_roblox_badges()
async
","text":"Gets the user's Roblox badges.
Returns:
Type DescriptionList[RobloxBadge]
A list of Roblox badges.
Source code inroblox/bases/baseuser.py
async def get_roblox_badges(self) -> List[RobloxBadge]:\n \"\"\"\n Gets the user's Roblox badges.\n\n Returns:\n A list of Roblox badges.\n \"\"\"\n\n badges_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"accountinformation\", f\"v1/users/{self.id}/roblox-badges\")\n )\n badges_data = badges_response.json()\n return [RobloxBadge(client=self._client, data=badge_data) for badge_data in badges_data]\n
"},{"location":"reference/bases/baseuser/#roblox.bases.baseuser.BaseUser.has_premium","title":"has_premium()
async
","text":"Checks if the user has a Roblox Premium membership.
Returns:
Type Descriptionbool
Whether the user has Premium or not.
Source code inroblox/bases/baseuser.py
async def has_premium(self) -> bool:\n \"\"\"\n Checks if the user has a Roblox Premium membership.\n\n Returns:\n Whether the user has Premium or not.\n \"\"\"\n premium_response = await self._client.requests.get(\n url=self._client.url_generator.get_url(\"premiumfeatures\", f\"v1/users/{self.id}/validate-membership\")\n )\n premium_data = premium_response.text\n return premium_data == \"true\"\n
"},{"location":"reference/bases/baseuser/#roblox.bases.baseuser.BaseUser.username_history","title":"username_history(page_size=10, sort_order=SortOrder.Ascending, max_items=None)
","text":"Grabs the user's username history.
Parameters:
Name Type Description Defaultpage_size
int
How many members should be returned for each page.
10
sort_order
SortOrder
Order in which data should be grabbed.
Ascending
max_items
int
The maximum items to return when looping through this object.
None
Returns:
Type DescriptionPageIterator
A PageIterator containing the user's username history.
Source code inroblox/bases/baseuser.py
def username_history(\n self, page_size: int = 10, sort_order: SortOrder = SortOrder.Ascending, max_items: int = None\n) -> PageIterator:\n \"\"\"\n Grabs the user's username history.\n\n Arguments:\n page_size: How many members should be returned for each page.\n sort_order: Order in which data should be grabbed.\n max_items: The maximum items to return when looping through this object.\n\n Returns:\n A PageIterator containing the user's username history.\n \"\"\"\n return PageIterator(\n client=self._client,\n url=self._client.url_generator.get_url(\n \"users\", f\"v1/users/{self.id}/username-history\"\n ),\n page_size=page_size,\n sort_order=sort_order,\n max_items=max_items,\n handler=lambda client, data: data[\"name\"],\n )\n
"},{"location":"reference/partials/","title":"partials","text":"Contains partial objects representing objects on Roblox. Some endpoints return some, but not all, data for an object, and these partial objects represent that data.
"},{"location":"reference/partials/partialbadge/","title":"partialbadge","text":"This file contains partial objects related to Roblox badges.
"},{"location":"reference/partials/partialbadge/#roblox.partials.partialbadge.PartialBadge","title":"PartialBadge
","text":" Bases: BaseBadge
Represents partial badge data.
Attributes:
Name Type Description_data
The data we get back from the endpoint.
_client
Client
The cCient object, which is passed to all objects this Client generates.
id
int
The universe ID.
awarded
datetime
The date when the badge was awarded.
Source code inroblox/partials/partialbadge.py
class PartialBadge(BaseBadge):\n \"\"\"\n Represents partial badge data.\n\n Attributes:\n _data: The data we get back from the endpoint.\n _client: The cCient object, which is passed to all objects this Client generates.\n id: The universe ID.\n awarded: The date when the badge was awarded.\n \"\"\"\n\n def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: The Client.\n data: The raw data.\n \"\"\"\n self._client: Client = client\n\n self.id: int = data[\"badgeId\"]\n\n super().__init__(client=client, badge_id=self.id)\n\n self.awarded: datetime = parse(data[\"awardedDate\"])\n
"},{"location":"reference/partials/partialbadge/#roblox.partials.partialbadge.PartialBadge.__init__","title":"__init__(client, data)
","text":"Parameters:
Name Type Description Defaultclient
Client
The Client.
requireddata
dict
The raw data.
required Source code inroblox/partials/partialbadge.py
def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: The Client.\n data: The raw data.\n \"\"\"\n self._client: Client = client\n\n self.id: int = data[\"badgeId\"]\n\n super().__init__(client=client, badge_id=self.id)\n\n self.awarded: datetime = parse(data[\"awardedDate\"])\n
"},{"location":"reference/partials/partialgroup/","title":"partialgroup","text":"This file contains partial objects related to Roblox groups.
"},{"location":"reference/partials/partialgroup/#roblox.partials.partialgroup.AssetPartialGroup","title":"AssetPartialGroup
","text":" Bases: BaseGroup
Represents a partial group in the context of a Roblox asset. Intended to parse the data[0][\"creator\"]
data from https://games.roblox.com/v1/games.
Attributes:
Name Type Description_client
Client
The Client object, which is passed to all objects this Client generates.
id
int
The group's name.
creator
BaseUser
The group's owner.
name
str
The group's name.
has_verified_badge
bool
If the group has a verified badge.
Source code inroblox/partials/partialgroup.py
class AssetPartialGroup(BaseGroup):\n \"\"\"\n Represents a partial group in the context of a Roblox asset.\n Intended to parse the `data[0][\"creator\"]` data from https://games.roblox.com/v1/games.\n\n Attributes:\n _client: The Client object, which is passed to all objects this Client generates.\n id: The group's name.\n creator: The group's owner.\n name: The group's name.\n has_verified_badge: If the group has a verified badge.\n \"\"\"\n\n def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: The Client.\n data: The data from the endpoint.\n \"\"\"\n self._client: Client = client\n\n self.creator: BaseUser = BaseUser(client=client, user_id=data[\"Id\"])\n self.id: int = data[\"CreatorTargetId\"]\n self.name: str = data[\"Name\"]\n self.has_verified_badge: bool = data[\"HasVerifiedBadge\"]\n\n super().__init__(client, self.id)\n
"},{"location":"reference/partials/partialgroup/#roblox.partials.partialgroup.AssetPartialGroup.__init__","title":"__init__(client, data)
","text":"Parameters:
Name Type Description Defaultclient
Client
The Client.
requireddata
dict
The data from the endpoint.
required Source code inroblox/partials/partialgroup.py
def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: The Client.\n data: The data from the endpoint.\n \"\"\"\n self._client: Client = client\n\n self.creator: BaseUser = BaseUser(client=client, user_id=data[\"Id\"])\n self.id: int = data[\"CreatorTargetId\"]\n self.name: str = data[\"Name\"]\n self.has_verified_badge: bool = data[\"HasVerifiedBadge\"]\n\n super().__init__(client, self.id)\n
"},{"location":"reference/partials/partialgroup/#roblox.partials.partialgroup.UniversePartialGroup","title":"UniversePartialGroup
","text":" Bases: BaseGroup
Represents a partial group in the context of a Roblox universe.
Attributes:
Name Type Description_data
The data we get back from the endpoint.
_client
Client
The client object, which is passed to all objects this client generates.
id
Id of the group
name
str
Name of the group
has_verified_badge
bool
If the group has a verified badge.
Source code inroblox/partials/partialgroup.py
class UniversePartialGroup(BaseGroup):\n \"\"\"\n Represents a partial group in the context of a Roblox universe.\n\n Attributes:\n _data: The data we get back from the endpoint.\n _client: The client object, which is passed to all objects this client generates.\n id: Id of the group\n name: Name of the group\n has_verified_badge: If the group has a verified badge.\n \"\"\"\n\n def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: The ClientSharedObject.\n data: The data from the endpoint.\n \"\"\"\n self._client: Client = client\n self.id = data[\"id\"]\n self.name: str = data[\"name\"]\n self.has_verified_badge: bool = data[\"hasVerifiedBadge\"]\n\n super().__init__(client, self.id)\n
"},{"location":"reference/partials/partialgroup/#roblox.partials.partialgroup.UniversePartialGroup.__init__","title":"__init__(client, data)
","text":"Parameters:
Name Type Description Defaultclient
Client
The ClientSharedObject.
requireddata
dict
The data from the endpoint.
required Source code inroblox/partials/partialgroup.py
def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: The ClientSharedObject.\n data: The data from the endpoint.\n \"\"\"\n self._client: Client = client\n self.id = data[\"id\"]\n self.name: str = data[\"name\"]\n self.has_verified_badge: bool = data[\"hasVerifiedBadge\"]\n\n super().__init__(client, self.id)\n
"},{"location":"reference/partials/partialrole/","title":"partialrole","text":"This file contains partial objects related to Roblox group roles.
"},{"location":"reference/partials/partialrole/#roblox.partials.partialrole.PartialRole","title":"PartialRole
","text":" Bases: BaseRole
Represents partial group role information.
Attributes:
Name Type Description_client
Client
The Client object.
id
int
The role's ID.
name
str
The role's name.
rank
int
The role's rank ID.
Source code inroblox/partials/partialrole.py
class PartialRole(BaseRole):\n \"\"\"\n Represents partial group role information.\n\n Attributes:\n _client: The Client object.\n id: The role's ID.\n name: The role's name.\n rank: The role's rank ID.\n \"\"\"\n\n def __init__(self, client: Client, data: dict):\n self._client: Client = client\n\n self.id: int = data[\"id\"]\n super().__init__(client=self._client, role_id=self.id)\n self.name: str = data[\"name\"]\n self.rank: int = data[\"rank\"]\n
"},{"location":"reference/partials/partialuniverse/","title":"partialuniverse","text":"This file contains partial objects related to Roblox universes.
"},{"location":"reference/partials/partialuniverse/#roblox.partials.partialuniverse.ChatPartialUniverse","title":"ChatPartialUniverse
","text":" Bases: BaseUniverse
Represents a partial universe in the context of a chat conversation.
Attributes:
Name Type Description_data
The data we get back from the endpoint.
_client
Client
The client object, which is passed to all objects this client generates.
id
int
The universe ID.
root_place
BasePlace
The universe's root place.
Source code inroblox/partials/partialuniverse.py
class ChatPartialUniverse(BaseUniverse):\n \"\"\"\n Represents a partial universe in the context of a chat conversation.\n\n Attributes:\n _data: The data we get back from the endpoint.\n _client: The client object, which is passed to all objects this client generates.\n id: The universe ID.\n root_place: The universe's root place.\n \"\"\"\n\n def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: The ClientSharedObject.\n data: The raw data.\n \"\"\"\n self._client: Client = client\n\n self.id: int = data[\"universeId\"]\n\n super().__init__(client=client, universe_id=self.id)\n\n self.root_place: BasePlace = BasePlace(client=client, place_id=data[\"rootPlaceId\"])\n
"},{"location":"reference/partials/partialuniverse/#roblox.partials.partialuniverse.ChatPartialUniverse.__init__","title":"__init__(client, data)
","text":"Parameters:
Name Type Description Defaultclient
Client
The ClientSharedObject.
requireddata
dict
The raw data.
required Source code inroblox/partials/partialuniverse.py
def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: The ClientSharedObject.\n data: The raw data.\n \"\"\"\n self._client: Client = client\n\n self.id: int = data[\"universeId\"]\n\n super().__init__(client=client, universe_id=self.id)\n\n self.root_place: BasePlace = BasePlace(client=client, place_id=data[\"rootPlaceId\"])\n
"},{"location":"reference/partials/partialuniverse/#roblox.partials.partialuniverse.PartialUniverse","title":"PartialUniverse
","text":" Bases: BaseUniverse
Represents partial universe information.
Attributes:. _client: The Client object, which is passed to all objects this Client generates. id: The universe ID. name: The name of the universe. root_place: The universe's root place.
Source code inroblox/partials/partialuniverse.py
class PartialUniverse(BaseUniverse):\n \"\"\"\n Represents partial universe information.\n\n Attributes:.\n _client: The Client object, which is passed to all objects this Client generates.\n id: The universe ID.\n name: The name of the universe.\n root_place: The universe's root place.\n \"\"\"\n\n def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: The Client.\n data: The raw data.\n \"\"\"\n self._client: Client = client\n\n self.id: int = data[\"id\"]\n\n super().__init__(client=client, universe_id=self.id)\n\n self.name: str = data[\"name\"]\n self.root_place: BasePlace = BasePlace(client=client, place_id=data[\"rootPlaceId\"])\n
"},{"location":"reference/partials/partialuniverse/#roblox.partials.partialuniverse.PartialUniverse.__init__","title":"__init__(client, data)
","text":"Parameters:
Name Type Description Defaultclient
Client
The Client.
requireddata
dict
The raw data.
required Source code inroblox/partials/partialuniverse.py
def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: The Client.\n data: The raw data.\n \"\"\"\n self._client: Client = client\n\n self.id: int = data[\"id\"]\n\n super().__init__(client=client, universe_id=self.id)\n\n self.name: str = data[\"name\"]\n self.root_place: BasePlace = BasePlace(client=client, place_id=data[\"rootPlaceId\"])\n
"},{"location":"reference/partials/partialuser/","title":"partialuser","text":"This file contains partial objects related to Roblox users.
"},{"location":"reference/partials/partialuser/#roblox.partials.partialuser.PartialUser","title":"PartialUser
","text":" Bases: BaseUser
Represents partial user information.
Attributes:
Name Type Description_client
Client
The Client object, which is passed to all objects this Client generates.
id
int
The user's ID.
name
str
The user's name.
display_name
str
The user's display name.
has_verified_badge
bool
If the user has a verified badge.
Source code inroblox/partials/partialuser.py
class PartialUser(BaseUser):\n \"\"\"\n Represents partial user information.\n\n Attributes:\n _client: The Client object, which is passed to all objects this Client generates.\n id: The user's ID.\n name: The user's name.\n display_name: The user's display name.\n has_verified_badge: If the user has a verified badge.\n \"\"\"\n\n def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: The Client.\n data: The data from the endpoint.\n \"\"\"\n self._client: Client = client\n\n self.id: int = data.get(\"id\") or data.get(\"userId\") or data.get(\"Id\")\n\n super().__init__(client=client, user_id=self.id)\n\n self.name: str = data.get(\"name\") or data.get(\"Name\") or data.get(\"username\") or data.get(\"Username\")\n self.display_name: str = data.get(\"displayName\")\n self.has_verified_badge: bool = data.get(\"hasVerifiedBadge\", False) or data.get(\"HasVerifiedBadge\", False)\n
"},{"location":"reference/partials/partialuser/#roblox.partials.partialuser.PartialUser.__init__","title":"__init__(client, data)
","text":"Parameters:
Name Type Description Defaultclient
Client
The Client.
requireddata
dict
The data from the endpoint.
required Source code inroblox/partials/partialuser.py
def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: The Client.\n data: The data from the endpoint.\n \"\"\"\n self._client: Client = client\n\n self.id: int = data.get(\"id\") or data.get(\"userId\") or data.get(\"Id\")\n\n super().__init__(client=client, user_id=self.id)\n\n self.name: str = data.get(\"name\") or data.get(\"Name\") or data.get(\"username\") or data.get(\"Username\")\n self.display_name: str = data.get(\"displayName\")\n self.has_verified_badge: bool = data.get(\"hasVerifiedBadge\", False) or data.get(\"HasVerifiedBadge\", False)\n
"},{"location":"reference/partials/partialuser/#roblox.partials.partialuser.PreviousUsernamesPartialUser","title":"PreviousUsernamesPartialUser
","text":" Bases: PartialUser
Represents a partial user in the context of a search where the user's previous usernames are present. Attributes: previous_usernames: A list of the user's previous usernames.
Source code inroblox/partials/partialuser.py
class PreviousUsernamesPartialUser(PartialUser):\n \"\"\"\n Represents a partial user in the context of a search where the user's previous usernames are present.\n Attributes:\n previous_usernames: A list of the user's previous usernames.\n \"\"\"\n\n def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: The Client.\n data: The data from the endpoint.\n \"\"\"\n super().__init__(client=client, data=data)\n\n self.previous_usernames: List[str] = data[\"previousUsernames\"]\n
"},{"location":"reference/partials/partialuser/#roblox.partials.partialuser.PreviousUsernamesPartialUser.__init__","title":"__init__(client, data)
","text":"Parameters:
Name Type Description Defaultclient
Client
The Client.
requireddata
dict
The data from the endpoint.
required Source code inroblox/partials/partialuser.py
def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: The Client.\n data: The data from the endpoint.\n \"\"\"\n super().__init__(client=client, data=data)\n\n self.previous_usernames: List[str] = data[\"previousUsernames\"]\n
"},{"location":"reference/partials/partialuser/#roblox.partials.partialuser.RequestedUsernamePartialUser","title":"RequestedUsernamePartialUser
","text":" Bases: PartialUser
Represents a partial user in the context of a search where the requested username is present.
Attributes:
Name Type Descriptionrequested_username
Optional[str]
The requested username.
Source code inroblox/partials/partialuser.py
class RequestedUsernamePartialUser(PartialUser):\n \"\"\"\n Represents a partial user in the context of a search where the requested username is present.\n\n Attributes:\n requested_username: The requested username.\n \"\"\"\n\n def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: The Client.\n data: The data from the endpoint.\n \"\"\"\n super().__init__(client=client, data=data)\n\n self.requested_username: Optional[str] = data.get(\"requestedUsername\")\n
"},{"location":"reference/partials/partialuser/#roblox.partials.partialuser.RequestedUsernamePartialUser.__init__","title":"__init__(client, data)
","text":"Parameters:
Name Type Description Defaultclient
Client
The Client.
requireddata
dict
The data from the endpoint.
required Source code inroblox/partials/partialuser.py
def __init__(self, client: Client, data: dict):\n \"\"\"\n Arguments:\n client: The Client.\n data: The data from the endpoint.\n \"\"\"\n super().__init__(client=client, data=data)\n\n self.requested_username: Optional[str] = data.get(\"requestedUsername\")\n
"},{"location":"reference/utilities/","title":"utilities","text":"Contains utilities used internally for ro.py.
"},{"location":"reference/utilities/exceptions/","title":"exceptions","text":"Contains exceptions used by ro.py.
"},{"location":"reference/utilities/exceptions/#roblox.utilities.exceptions.AssetNotFound","title":"AssetNotFound
","text":" Bases: ItemNotFound
Raised for invalid asset IDs.
Source code inroblox/utilities/exceptions.py
class AssetNotFound(ItemNotFound):\n \"\"\"\n Raised for invalid asset IDs.\n \"\"\"\n pass\n
"},{"location":"reference/utilities/exceptions/#roblox.utilities.exceptions.BadRequest","title":"BadRequest
","text":" Bases: HTTPException
HTTP exception raised for status code 400.
Source code inroblox/utilities/exceptions.py
class BadRequest(HTTPException):\n \"\"\"HTTP exception raised for status code 400.\"\"\"\n pass\n
"},{"location":"reference/utilities/exceptions/#roblox.utilities.exceptions.BadgeNotFound","title":"BadgeNotFound
","text":" Bases: ItemNotFound
Raised for invalid badge IDs.
Source code inroblox/utilities/exceptions.py
class BadgeNotFound(ItemNotFound):\n \"\"\"\n Raised for invalid badge IDs.\n \"\"\"\n pass\n
"},{"location":"reference/utilities/exceptions/#roblox.utilities.exceptions.Forbidden","title":"Forbidden
","text":" Bases: HTTPException
HTTP exception raised for status code 403. This usually means the X-CSRF-Token was not properly provided.
Source code inroblox/utilities/exceptions.py
class Forbidden(HTTPException):\n \"\"\"HTTP exception raised for status code 403. This usually means the X-CSRF-Token was not properly provided.\"\"\"\n pass\n
"},{"location":"reference/utilities/exceptions/#roblox.utilities.exceptions.GroupNotFound","title":"GroupNotFound
","text":" Bases: ItemNotFound
Raised for invalid group IDs.
Source code inroblox/utilities/exceptions.py
class GroupNotFound(ItemNotFound):\n \"\"\"\n Raised for invalid group IDs.\n \"\"\"\n pass\n
"},{"location":"reference/utilities/exceptions/#roblox.utilities.exceptions.HTTPException","title":"HTTPException
","text":" Bases: RobloxException
Exception that's raised when an HTTP request fails.
Attributes:
Name Type Descriptionresponse
Response
The HTTP response object.
status
int
The HTTP response status code.
errors
List[ResponseError]
A list of Roblox response errors.
Source code inroblox/utilities/exceptions.py
class HTTPException(RobloxException):\n \"\"\"\n Exception that's raised when an HTTP request fails.\n\n Attributes:\n response: The HTTP response object.\n status: The HTTP response status code.\n errors: A list of Roblox response errors.\n \"\"\"\n\n def __init__(self, response: Response, errors: Optional[list] = None):\n \"\"\"\n Arguments:\n response: The raw response object.\n errors: A list of errors.\n \"\"\"\n self.response: Response = response\n self.status: int = response.status_code\n self.errors: List[ResponseError]\n\n if errors:\n self.errors = [\n ResponseError(data=error_data) for error_data in errors\n ]\n else:\n self.errors = []\n\n if self.errors:\n error_string = self._generate_string()\n super().__init__(\n f\"{response.status_code} {response.reason_phrase}: {response.url}.\\n\\nErrors:\\n{error_string}\")\n else:\n super().__init__(f\"{response.status_code} {response.reason_phrase}: {response.url}\")\n\n def _generate_string(self) -> str:\n parsed_errors = []\n for error in self.errors:\n # Make each error into a parsed string\n parsed_error = f\"\\t{error.code}: {error.message}\"\n error_messages = []\n\n error.user_facing_message and error_messages.append(f\"User-facing message: {error.user_facing_message}\")\n error.field and error_messages.append(f\"Field: {error.field}\")\n error.retryable and error_messages.append(f\"Retryable: {error.retryable}\")\n\n if error_messages:\n error_message_string = \"\\n\\t\\t\".join(error_messages)\n parsed_error += f\"\\n\\t\\t{error_message_string}\"\n\n parsed_errors.append(parsed_error)\n\n # Turn the parsed errors into a joined string\n return \"\\n\".join(parsed_errors)\n
"},{"location":"reference/utilities/exceptions/#roblox.utilities.exceptions.HTTPException.__init__","title":"__init__(response, errors=None)
","text":"Parameters:
Name Type Description Defaultresponse
Response
The raw response object.
requirederrors
Optional[list]
A list of errors.
None
Source code in roblox/utilities/exceptions.py
def __init__(self, response: Response, errors: Optional[list] = None):\n \"\"\"\n Arguments:\n response: The raw response object.\n errors: A list of errors.\n \"\"\"\n self.response: Response = response\n self.status: int = response.status_code\n self.errors: List[ResponseError]\n\n if errors:\n self.errors = [\n ResponseError(data=error_data) for error_data in errors\n ]\n else:\n self.errors = []\n\n if self.errors:\n error_string = self._generate_string()\n super().__init__(\n f\"{response.status_code} {response.reason_phrase}: {response.url}.\\n\\nErrors:\\n{error_string}\")\n else:\n super().__init__(f\"{response.status_code} {response.reason_phrase}: {response.url}\")\n
"},{"location":"reference/utilities/exceptions/#roblox.utilities.exceptions.InternalServerError","title":"InternalServerError
","text":" Bases: HTTPException
HTTP exception raised for status code 500. This usually means that there was an issue on Roblox's end, but due to faulty coding on Roblox's part this can sometimes mean that an endpoint used internally was disabled or that invalid parameters were passed.
Source code inroblox/utilities/exceptions.py
class InternalServerError(HTTPException):\n \"\"\"\n HTTP exception raised for status code 500.\n This usually means that there was an issue on Roblox's end, but due to faulty coding on Roblox's part this can\n sometimes mean that an endpoint used internally was disabled or that invalid parameters were passed.\n \"\"\"\n pass\n
"},{"location":"reference/utilities/exceptions/#roblox.utilities.exceptions.InvalidRole","title":"InvalidRole
","text":" Bases: RobloxException
Raised when a role doesn't exist.
Source code inroblox/utilities/exceptions.py
class InvalidRole(RobloxException):\n \"\"\"\n Raised when a role doesn't exist.\n \"\"\"\n pass\n
"},{"location":"reference/utilities/exceptions/#roblox.utilities.exceptions.ItemNotFound","title":"ItemNotFound
","text":" Bases: RobloxException
Raised for invalid items.
Source code inroblox/utilities/exceptions.py
class ItemNotFound(RobloxException):\n \"\"\"\n Raised for invalid items.\n \"\"\"\n\n def __init__(self, message: str, response: Optional[Response] = None):\n \"\"\"\n Arguments:\n response: The raw response object.\n \"\"\"\n self.response: Optional[Response] = response\n self.status: Optional[int] = response.status_code if response else None\n super().__init__(message)\n
"},{"location":"reference/utilities/exceptions/#roblox.utilities.exceptions.ItemNotFound.__init__","title":"__init__(message, response=None)
","text":"Parameters:
Name Type Description Defaultresponse
Optional[Response]
The raw response object.
None
Source code in roblox/utilities/exceptions.py
def __init__(self, message: str, response: Optional[Response] = None):\n \"\"\"\n Arguments:\n response: The raw response object.\n \"\"\"\n self.response: Optional[Response] = response\n self.status: Optional[int] = response.status_code if response else None\n super().__init__(message)\n
"},{"location":"reference/utilities/exceptions/#roblox.utilities.exceptions.NoMoreItems","title":"NoMoreItems
","text":" Bases: RobloxException
Raised when there are no more items left to iterate through.
Source code inroblox/utilities/exceptions.py
class NoMoreItems(RobloxException):\n \"\"\"\n Raised when there are no more items left to iterate through.\n \"\"\"\n pass\n
"},{"location":"reference/utilities/exceptions/#roblox.utilities.exceptions.NotFound","title":"NotFound
","text":" Bases: HTTPException
HTTP exception raised for status code 404. This usually means we have an internal URL issue - please make a GitHub issue about this!
Source code inroblox/utilities/exceptions.py
class NotFound(HTTPException):\n \"\"\"\n HTTP exception raised for status code 404.\n This usually means we have an internal URL issue - please make a GitHub issue about this!\n \"\"\"\n pass\n
"},{"location":"reference/utilities/exceptions/#roblox.utilities.exceptions.PlaceNotFound","title":"PlaceNotFound
","text":" Bases: ItemNotFound
Raised for invalid place IDs.
Source code inroblox/utilities/exceptions.py
class PlaceNotFound(ItemNotFound):\n \"\"\"\n Raised for invalid place IDs.\n \"\"\"\n pass\n
"},{"location":"reference/utilities/exceptions/#roblox.utilities.exceptions.PluginNotFound","title":"PluginNotFound
","text":" Bases: ItemNotFound
Raised for invalid plugin IDs.
Source code inroblox/utilities/exceptions.py
class PluginNotFound(ItemNotFound):\n \"\"\"\n Raised for invalid plugin IDs.\n \"\"\"\n pass\n
"},{"location":"reference/utilities/exceptions/#roblox.utilities.exceptions.ResponseError","title":"ResponseError
","text":"Represents an error returned by a Roblox game server.
Attributes:
Name Type Descriptioncode
int
The error code.
message
Optional[str]
The error message.
user_facing_message
Optional[str]
A more simple error message intended for frontend use.
field
Optional[str]
The field causing this error.
retryable
Optional[str]
Whether retrying this exception could supress this issue.
Source code inroblox/utilities/exceptions.py
class ResponseError:\n \"\"\"\n Represents an error returned by a Roblox game server.\n\n Attributes:\n code: The error code.\n message: The error message.\n user_facing_message: A more simple error message intended for frontend use.\n field: The field causing this error.\n retryable: Whether retrying this exception could supress this issue.\n \"\"\"\n\n def __init__(self, data: dict):\n self.code: int = data[\"code\"]\n self.message: Optional[str] = data.get(\"message\")\n self.user_facing_message: Optional[str] = data.get(\"userFacingMessage\")\n self.field: Optional[str] = data.get(\"field\")\n self.retryable: Optional[str] = data.get(\"retryable\")\n
"},{"location":"reference/utilities/exceptions/#roblox.utilities.exceptions.RobloxException","title":"RobloxException
","text":" Bases: Exception
Base exception for all of ro.py.
Source code inroblox/utilities/exceptions.py
class RobloxException(Exception):\n \"\"\"\n Base exception for all of ro.py.\n \"\"\"\n pass\n
"},{"location":"reference/utilities/exceptions/#roblox.utilities.exceptions.TooManyRequests","title":"TooManyRequests
","text":" Bases: HTTPException
HTTP exception raised for status code 429. This means that Roblox has ratelimited you.
Source code inroblox/utilities/exceptions.py
class TooManyRequests(HTTPException):\n \"\"\"\n HTTP exception raised for status code 429.\n This means that Roblox has [ratelimited](https://en.wikipedia.org/wiki/Rate_limiting) you.\n \"\"\"\n pass\n
"},{"location":"reference/utilities/exceptions/#roblox.utilities.exceptions.Unauthorized","title":"Unauthorized
","text":" Bases: HTTPException
HTTP exception raised for status code 401. This usually means you aren't properly authenticated.
Source code inroblox/utilities/exceptions.py
class Unauthorized(HTTPException):\n \"\"\"HTTP exception raised for status code 401. This usually means you aren't properly authenticated.\"\"\"\n
"},{"location":"reference/utilities/exceptions/#roblox.utilities.exceptions.UniverseNotFound","title":"UniverseNotFound
","text":" Bases: ItemNotFound
Raised for invalid universe IDs.
Source code inroblox/utilities/exceptions.py
class UniverseNotFound(ItemNotFound):\n \"\"\"\n Raised for invalid universe IDs.\n \"\"\"\n pass\n
"},{"location":"reference/utilities/exceptions/#roblox.utilities.exceptions.UserNotFound","title":"UserNotFound
","text":" Bases: ItemNotFound
Raised for invalid user IDs or usernames.
Source code inroblox/utilities/exceptions.py
class UserNotFound(ItemNotFound):\n \"\"\"\n Raised for invalid user IDs or usernames.\n \"\"\"\n pass\n
"},{"location":"reference/utilities/exceptions/#roblox.utilities.exceptions.get_exception_from_status_code","title":"get_exception_from_status_code(code)
","text":"Gets an exception that should be raised instead of the generic HTTPException for this status code.
Source code inroblox/utilities/exceptions.py
def get_exception_from_status_code(code: int) -> Type[HTTPException]:\n \"\"\"\n Gets an exception that should be raised instead of the generic HTTPException for this status code.\n \"\"\"\n return _codes_exceptions.get(code) or HTTPException\n
"},{"location":"reference/utilities/iterators/","title":"iterators","text":"This module contains iterators used internally by ro.py to provide paginated information.
"},{"location":"reference/utilities/iterators/#roblox.utilities.iterators.IteratorItems","title":"IteratorItems
","text":" Bases: AsyncIterator
Represents the items inside of an iterator.
Source code inroblox/utilities/iterators.py
class IteratorItems(AsyncIterator):\n \"\"\"\n Represents the items inside of an iterator.\n \"\"\"\n\n def __init__(self, iterator: RobloxIterator, max_items: Optional[int] = None):\n self._iterator = iterator\n self._position: int = 0\n self._global_position: int = 0\n self._items: list = []\n self._max_items = max_items\n\n def __aiter__(self):\n self._position = 0\n self._items = []\n return self\n\n async def __anext__(self):\n if self._position == len(self._items):\n # we are at the end of our current page of items. start again with a new page\n self._position = 0\n try:\n # get new items\n self._items = await self._iterator.next()\n except NoMoreItems:\n # if there aren't any more items, reset and break the loop\n self._position = 0\n self._global_position = 0\n self._items = []\n raise StopAsyncIteration\n\n if self._max_items is not None and self._global_position >= self._max_items:\n raise StopAsyncIteration\n\n # if we got here we know there are more items\n try:\n item = self._items[self._position]\n except IndexError:\n # edge case for group roles\n raise StopAsyncIteration\n # we advance the iterator by one for the next iteration\n self._position += 1\n self._global_position += 1\n return item\n
"},{"location":"reference/utilities/iterators/#roblox.utilities.iterators.IteratorPages","title":"IteratorPages
","text":" Bases: AsyncIterator
Represents the pages inside of an iterator.
Source code inroblox/utilities/iterators.py
class IteratorPages(AsyncIterator):\n \"\"\"\n Represents the pages inside of an iterator.\n \"\"\"\n\n def __init__(self, iterator: RobloxIterator):\n self._iterator = iterator\n\n def __aiter__(self):\n return self\n\n async def __anext__(self):\n try:\n page = await self._iterator.next()\n return page\n except NoMoreItems:\n raise StopAsyncIteration\n
"},{"location":"reference/utilities/iterators/#roblox.utilities.iterators.PageIterator","title":"PageIterator
","text":" Bases: RobloxIterator
Represents a cursor-based, paginated Roblox object. Learn more about iterators in the pagination tutorial: Pagination For more information about how cursor-based pagination works, see https://robloxapi.wiki/wiki/Pagination.
Attributes:
Name Type Description_client
Client
The Client.
url
str
The endpoint to hit for new page data.
sort_order
SortOrder
The sort order to use for returned data.
page_size
int
How much data should be returned per-page.
extra_parameters
dict
Extra parameters to pass to the endpoint.
handler
Callable
A callable object to use to convert raw endpoint data to parsed objects.
handler_kwargs
dict
Extra keyword arguments to pass to the handler.
next_cursor
str
Cursor to use to advance to the next page.
previous_cursor
str
Cursor to use to advance to the previous page.
iterator_position
int
What position in the iterator_items the iterator is currently at.
iterator_items
list
List of current items the iterator is working on.
Source code inroblox/utilities/iterators.py
class PageIterator(RobloxIterator):\n \"\"\"\n Represents a cursor-based, paginated Roblox object. Learn more about iterators in the pagination tutorial:\n [Pagination](../../tutorials/pagination.md)\n For more information about how cursor-based pagination works, see https://robloxapi.wiki/wiki/Pagination.\n\n Attributes:\n _client: The Client.\n url: The endpoint to hit for new page data.\n sort_order: The sort order to use for returned data.\n page_size: How much data should be returned per-page.\n extra_parameters: Extra parameters to pass to the endpoint.\n handler: A callable object to use to convert raw endpoint data to parsed objects.\n handler_kwargs: Extra keyword arguments to pass to the handler.\n next_cursor: Cursor to use to advance to the next page.\n previous_cursor: Cursor to use to advance to the previous page.\n iterator_position: What position in the iterator_items the iterator is currently at.\n iterator_items: List of current items the iterator is working on.\n \"\"\"\n\n def __init__(\n self,\n client: Client,\n url: str,\n sort_order: SortOrder = SortOrder.Ascending,\n page_size: int = 10,\n max_items: int = None,\n extra_parameters: Optional[dict] = None,\n handler: Optional[Callable] = None,\n handler_kwargs: Optional[dict] = None\n ):\n \"\"\"\n Parameters:\n client: The Client.\n url: The endpoint to hit for new page data.\n sort_order: The sort order to use for returned data.\n page_size: How much data should be returned per-page.\n max_items: The maximum amount of items to return when this iterator is looped through.\n extra_parameters: Extra parameters to pass to the endpoint.\n handler: A callable object to use to convert raw endpoint data to parsed objects.\n handler_kwargs: Extra keyword arguments to pass to the handler.\n \"\"\"\n super().__init__(max_items=max_items)\n\n self._client: Client = client\n\n # store some basic arguments in the object\n self.url: str = url\n self.sort_order: SortOrder = sort_order\n self.page_size: int = page_size\n\n self.extra_parameters: dict = extra_parameters or {}\n self.handler: Callable = handler\n self.handler_kwargs: dict = handler_kwargs or {}\n\n # cursors to use for next, previous\n self.next_cursor: str = \"\"\n self.previous_cursor: str = \"\"\n\n # iter values\n self.iterator_position: int = 0\n self.iterator_items: list = []\n self.next_started: bool = False\n\n async def next(self):\n \"\"\"\n Advances the iterator to the next page.\n \"\"\"\n if self.next_started and not self.next_cursor:\n \"\"\"\n If we just started and there is no cursor, this is the last page, because we can go back but not forward.\n We should raise an exception here.\n \"\"\"\n raise NoMoreItems(\"No more items.\")\n\n if not self.next_started:\n self.next_started = True\n\n page_response = await self._client.requests.get(\n url=self.url,\n params={\n \"cursor\": self.next_cursor,\n \"limit\": self.page_size,\n \"sortOrder\": self.sort_order.value,\n **self.extra_parameters\n }\n )\n page_data = page_response.json()\n\n # fill in cursors\n self.next_cursor = page_data[\"nextPageCursor\"]\n self.previous_cursor = page_data[\"previousPageCursor\"]\n\n data = page_data[\"data\"]\n\n if self.handler:\n data = [\n self.handler(\n client=self._client,\n data=item_data,\n **self.handler_kwargs\n ) for item_data in data\n ]\n\n return data\n
"},{"location":"reference/utilities/iterators/#roblox.utilities.iterators.PageIterator.__init__","title":"__init__(client, url, sort_order=SortOrder.Ascending, page_size=10, max_items=None, extra_parameters=None, handler=None, handler_kwargs=None)
","text":"Parameters:
Name Type Description Defaultclient
Client
The Client.
requiredurl
str
The endpoint to hit for new page data.
requiredsort_order
SortOrder
The sort order to use for returned data.
Ascending
page_size
int
How much data should be returned per-page.
10
max_items
int
The maximum amount of items to return when this iterator is looped through.
None
extra_parameters
Optional[dict]
Extra parameters to pass to the endpoint.
None
handler
Optional[Callable]
A callable object to use to convert raw endpoint data to parsed objects.
None
handler_kwargs
Optional[dict]
Extra keyword arguments to pass to the handler.
None
Source code in roblox/utilities/iterators.py
def __init__(\n self,\n client: Client,\n url: str,\n sort_order: SortOrder = SortOrder.Ascending,\n page_size: int = 10,\n max_items: int = None,\n extra_parameters: Optional[dict] = None,\n handler: Optional[Callable] = None,\n handler_kwargs: Optional[dict] = None\n):\n \"\"\"\n Parameters:\n client: The Client.\n url: The endpoint to hit for new page data.\n sort_order: The sort order to use for returned data.\n page_size: How much data should be returned per-page.\n max_items: The maximum amount of items to return when this iterator is looped through.\n extra_parameters: Extra parameters to pass to the endpoint.\n handler: A callable object to use to convert raw endpoint data to parsed objects.\n handler_kwargs: Extra keyword arguments to pass to the handler.\n \"\"\"\n super().__init__(max_items=max_items)\n\n self._client: Client = client\n\n # store some basic arguments in the object\n self.url: str = url\n self.sort_order: SortOrder = sort_order\n self.page_size: int = page_size\n\n self.extra_parameters: dict = extra_parameters or {}\n self.handler: Callable = handler\n self.handler_kwargs: dict = handler_kwargs or {}\n\n # cursors to use for next, previous\n self.next_cursor: str = \"\"\n self.previous_cursor: str = \"\"\n\n # iter values\n self.iterator_position: int = 0\n self.iterator_items: list = []\n self.next_started: bool = False\n
"},{"location":"reference/utilities/iterators/#roblox.utilities.iterators.PageIterator.next","title":"next()
async
","text":"Advances the iterator to the next page.
Source code inroblox/utilities/iterators.py
async def next(self):\n \"\"\"\n Advances the iterator to the next page.\n \"\"\"\n if self.next_started and not self.next_cursor:\n \"\"\"\n If we just started and there is no cursor, this is the last page, because we can go back but not forward.\n We should raise an exception here.\n \"\"\"\n raise NoMoreItems(\"No more items.\")\n\n if not self.next_started:\n self.next_started = True\n\n page_response = await self._client.requests.get(\n url=self.url,\n params={\n \"cursor\": self.next_cursor,\n \"limit\": self.page_size,\n \"sortOrder\": self.sort_order.value,\n **self.extra_parameters\n }\n )\n page_data = page_response.json()\n\n # fill in cursors\n self.next_cursor = page_data[\"nextPageCursor\"]\n self.previous_cursor = page_data[\"previousPageCursor\"]\n\n data = page_data[\"data\"]\n\n if self.handler:\n data = [\n self.handler(\n client=self._client,\n data=item_data,\n **self.handler_kwargs\n ) for item_data in data\n ]\n\n return data\n
"},{"location":"reference/utilities/iterators/#roblox.utilities.iterators.PageNumberIterator","title":"PageNumberIterator
","text":" Bases: RobloxIterator
Represents an iterator that is advanced with page numbers and sizes, like those seen on chat.roblox.com.
Attributes:
Name Type Descriptionurl
str
The endpoint to hit for new page data.
page_number
int
The current page number.
page_size
int
The size of each page.
extra_parameters
dict
Extra parameters to pass to the endpoint.
handler
Callable
A callable object to use to convert raw endpoint data to parsed objects.
handler_kwargs
dict
Extra keyword arguments to pass to the handler.
Source code inroblox/utilities/iterators.py
class PageNumberIterator(RobloxIterator):\n \"\"\"\n Represents an iterator that is advanced with page numbers and sizes, like those seen on chat.roblox.com.\n\n Attributes:\n url: The endpoint to hit for new page data.\n page_number: The current page number.\n page_size: The size of each page.\n extra_parameters: Extra parameters to pass to the endpoint.\n handler: A callable object to use to convert raw endpoint data to parsed objects.\n handler_kwargs: Extra keyword arguments to pass to the handler.\n \"\"\"\n\n def __init__(\n self,\n client: Client,\n url: str,\n page_size: int = 10,\n extra_parameters: Optional[dict] = None,\n handler: Optional[Callable] = None,\n handler_kwargs: Optional[dict] = None\n ):\n super().__init__()\n\n self._client: Client = client\n\n self.url: str = url\n self.page_number: int = 1\n self.page_size: int = page_size\n\n self.extra_parameters: dict = extra_parameters or {}\n self.handler: Callable = handler\n self.handler_kwargs: dict = handler_kwargs or {}\n\n self.iterator_position = 0\n self.iterator_items = []\n\n async def next(self):\n \"\"\"\n Advances the iterator to the next page.\n \"\"\"\n page_response = await self._client.requests.get(\n url=self.url,\n params={\n \"pageNumber\": self.page_number,\n \"pageSize\": self.page_size,\n **self.extra_parameters\n }\n )\n data = page_response.json()\n\n if len(data) == 0:\n raise NoMoreItems(\"No more items.\")\n\n self.page_number += 1\n\n if self.handler:\n data = [\n self.handler(\n client=self._client,\n data=item_data,\n **self.handler_kwargs\n ) for item_data in data\n ]\n\n return data\n
"},{"location":"reference/utilities/iterators/#roblox.utilities.iterators.PageNumberIterator.next","title":"next()
async
","text":"Advances the iterator to the next page.
Source code inroblox/utilities/iterators.py
async def next(self):\n \"\"\"\n Advances the iterator to the next page.\n \"\"\"\n page_response = await self._client.requests.get(\n url=self.url,\n params={\n \"pageNumber\": self.page_number,\n \"pageSize\": self.page_size,\n **self.extra_parameters\n }\n )\n data = page_response.json()\n\n if len(data) == 0:\n raise NoMoreItems(\"No more items.\")\n\n self.page_number += 1\n\n if self.handler:\n data = [\n self.handler(\n client=self._client,\n data=item_data,\n **self.handler_kwargs\n ) for item_data in data\n ]\n\n return data\n
"},{"location":"reference/utilities/iterators/#roblox.utilities.iterators.RobloxIterator","title":"RobloxIterator
","text":"Represents a basic iterator which all iterators should implement.
Source code inroblox/utilities/iterators.py
class RobloxIterator:\n \"\"\"\n Represents a basic iterator which all iterators should implement.\n \"\"\"\n\n def __init__(self, max_items: int = None):\n self.max_items: Optional[int] = max_items\n\n async def next(self):\n \"\"\"\n Moves to the next page and returns that page's data.\n \"\"\"\n\n raise NotImplementedError\n\n async def flatten(self, max_items: int = None) -> list:\n \"\"\"\n Flattens the data into a list.\n \"\"\"\n if max_items is None:\n max_items = self.max_items\n\n items: list = []\n\n while True:\n try:\n new_items = await self.next()\n items += new_items\n except NoMoreItems:\n break\n\n if max_items is not None and len(items) >= max_items:\n break\n\n return items[:max_items]\n\n def __aiter__(self):\n return IteratorItems(\n iterator=self,\n max_items=self.max_items\n )\n\n def items(self, max_items: int = None) -> IteratorItems:\n \"\"\"\n Returns an AsyncIterable containing each iterator item.\n \"\"\"\n if max_items is None:\n max_items = self.max_items\n return IteratorItems(\n iterator=self,\n max_items=max_items\n )\n\n def pages(self) -> IteratorPages:\n \"\"\"\n Returns an AsyncIterable containing each iterator page. Each page is a list of items.\n \"\"\"\n return IteratorPages(self)\n
"},{"location":"reference/utilities/iterators/#roblox.utilities.iterators.RobloxIterator.flatten","title":"flatten(max_items=None)
async
","text":"Flattens the data into a list.
Source code inroblox/utilities/iterators.py
async def flatten(self, max_items: int = None) -> list:\n \"\"\"\n Flattens the data into a list.\n \"\"\"\n if max_items is None:\n max_items = self.max_items\n\n items: list = []\n\n while True:\n try:\n new_items = await self.next()\n items += new_items\n except NoMoreItems:\n break\n\n if max_items is not None and len(items) >= max_items:\n break\n\n return items[:max_items]\n
"},{"location":"reference/utilities/iterators/#roblox.utilities.iterators.RobloxIterator.items","title":"items(max_items=None)
","text":"Returns an AsyncIterable containing each iterator item.
Source code inroblox/utilities/iterators.py
def items(self, max_items: int = None) -> IteratorItems:\n \"\"\"\n Returns an AsyncIterable containing each iterator item.\n \"\"\"\n if max_items is None:\n max_items = self.max_items\n return IteratorItems(\n iterator=self,\n max_items=max_items\n )\n
"},{"location":"reference/utilities/iterators/#roblox.utilities.iterators.RobloxIterator.next","title":"next()
async
","text":"Moves to the next page and returns that page's data.
Source code inroblox/utilities/iterators.py
async def next(self):\n \"\"\"\n Moves to the next page and returns that page's data.\n \"\"\"\n\n raise NotImplementedError\n
"},{"location":"reference/utilities/iterators/#roblox.utilities.iterators.RobloxIterator.pages","title":"pages()
","text":"Returns an AsyncIterable containing each iterator page. Each page is a list of items.
Source code inroblox/utilities/iterators.py
def pages(self) -> IteratorPages:\n \"\"\"\n Returns an AsyncIterable containing each iterator page. Each page is a list of items.\n \"\"\"\n return IteratorPages(self)\n
"},{"location":"reference/utilities/iterators/#roblox.utilities.iterators.SortOrder","title":"SortOrder
","text":" Bases: Enum
Order in which page data should load in.
Source code inroblox/utilities/iterators.py
class SortOrder(Enum):\n \"\"\"\n Order in which page data should load in.\n \"\"\"\n\n Ascending = \"Asc\"\n Descending = \"Desc\"\n
"},{"location":"reference/utilities/requests/","title":"requests","text":"This module contains classes used internally by ro.py for sending requests to Roblox endpoints.
"},{"location":"reference/utilities/requests/#roblox.utilities.requests.CleanAsyncClient","title":"CleanAsyncClient
","text":" Bases: AsyncClient
This is a clean-on-delete version of httpx.AsyncClient.
Source code inroblox/utilities/requests.py
class CleanAsyncClient(AsyncClient):\n \"\"\"\n This is a clean-on-delete version of httpx.AsyncClient.\n \"\"\"\n\n def __init__(self):\n super().__init__()\n\n def __del__(self):\n try:\n asyncio.get_event_loop().create_task(self.aclose())\n except RuntimeError:\n pass\n
"},{"location":"reference/utilities/requests/#roblox.utilities.requests.Requests","title":"Requests
","text":"A special request object that implements special functionality required to connect to some Roblox endpoints.
Attributes:
Name Type Descriptionsession
CleanAsyncClient
Base session object to use when sending requests.
xcsrf_token_name
str
The header that will contain the Cross-Site Request Forgery token.
Source code inroblox/utilities/requests.py
class Requests:\n \"\"\"\n A special request object that implements special functionality required to connect to some Roblox endpoints.\n\n Attributes:\n session: Base session object to use when sending requests.\n xcsrf_token_name: The header that will contain the Cross-Site Request Forgery token.\n \"\"\"\n\n def __init__(\n self,\n session: CleanAsyncClient = None,\n xcsrf_token_name: str = \"X-CSRF-Token\"\n ):\n \"\"\"\n Arguments:\n session: A custom session object to use for sending requests, compatible with httpx.AsyncClient.\n xcsrf_token_name: The header to place X-CSRF-Token data into.\n \"\"\"\n self.session: CleanAsyncClient\n\n if session is None:\n self.session = CleanAsyncClient()\n else:\n self.session = session\n\n self.xcsrf_token_name: str = xcsrf_token_name\n\n self.session.headers[\"User-Agent\"] = \"Roblox/WinInet\"\n self.session.headers[\"Referer\"] = \"www.roblox.com\"\n\n async def request(self, method: str, *args, **kwargs) -> Response:\n \"\"\"\n Arguments:\n method: The request method.\n\n Returns:\n An HTTP response.\n \"\"\"\n\n handle_xcsrf_token = kwargs.pop(\"handle_xcsrf_token\", True)\n skip_roblox = kwargs.pop(\"skip_roblox\", False)\n\n response = await self.session.request(method, *args, **kwargs)\n\n if skip_roblox:\n return response\n\n method = method.lower()\n\n if handle_xcsrf_token and self.xcsrf_token_name in response.headers and _xcsrf_allowed_methods.get(method):\n self.session.headers[self.xcsrf_token_name] = response.headers[self.xcsrf_token_name]\n if response.status_code == 403: # Request failed, send it again\n response = await self.session.request(method, *args, **kwargs)\n\n if kwargs.get(\"stream\"):\n # Streamed responses should not be decoded, so we immediately return the response.\n return response\n\n if response.is_error:\n # Something went wrong, parse an error\n content_type = response.headers.get(\"Content-Type\")\n errors = None\n if content_type and content_type.startswith(\"application/json\"):\n data = None\n try:\n data = response.json()\n except JSONDecodeError:\n pass\n errors = data and data.get(\"errors\")\n\n exception = get_exception_from_status_code(response.status_code)(\n response=response,\n errors=errors\n )\n raise exception\n else:\n return response\n\n async def get(self, *args, **kwargs) -> Response:\n \"\"\"\n Sends a GET request.\n\n Returns:\n An HTTP response.\n \"\"\"\n\n return await self.request(\"GET\", *args, **kwargs)\n\n async def post(self, *args, **kwargs) -> Response:\n \"\"\"\n Sends a POST request.\n\n Returns:\n An HTTP response.\n \"\"\"\n\n return await self.request(\"POST\", *args, **kwargs)\n\n async def put(self, *args, **kwargs) -> Response:\n \"\"\"\n Sends a PATCH request.\n\n Returns:\n An HTTP response.\n \"\"\"\n\n return await self.request(\"PUT\", *args, **kwargs)\n\n async def patch(self, *args, **kwargs) -> Response:\n \"\"\"\n Sends a PATCH request.\n\n Returns:\n An HTTP response.\n \"\"\"\n\n return await self.request(\"PATCH\", *args, **kwargs)\n\n async def delete(self, *args, **kwargs) -> Response:\n \"\"\"\n Sends a DELETE request.\n\n Returns:\n An HTTP response.\n \"\"\"\n\n return await self.request(\"DELETE\", *args, **kwargs)\n
"},{"location":"reference/utilities/requests/#roblox.utilities.requests.Requests.__init__","title":"__init__(session=None, xcsrf_token_name='X-CSRF-Token')
","text":"Parameters:
Name Type Description Defaultsession
CleanAsyncClient
A custom session object to use for sending requests, compatible with httpx.AsyncClient.
None
xcsrf_token_name
str
The header to place X-CSRF-Token data into.
'X-CSRF-Token'
Source code in roblox/utilities/requests.py
def __init__(\n self,\n session: CleanAsyncClient = None,\n xcsrf_token_name: str = \"X-CSRF-Token\"\n):\n \"\"\"\n Arguments:\n session: A custom session object to use for sending requests, compatible with httpx.AsyncClient.\n xcsrf_token_name: The header to place X-CSRF-Token data into.\n \"\"\"\n self.session: CleanAsyncClient\n\n if session is None:\n self.session = CleanAsyncClient()\n else:\n self.session = session\n\n self.xcsrf_token_name: str = xcsrf_token_name\n\n self.session.headers[\"User-Agent\"] = \"Roblox/WinInet\"\n self.session.headers[\"Referer\"] = \"www.roblox.com\"\n
"},{"location":"reference/utilities/requests/#roblox.utilities.requests.Requests.delete","title":"delete(*args, **kwargs)
async
","text":"Sends a DELETE request.
Returns:
Type DescriptionResponse
An HTTP response.
Source code inroblox/utilities/requests.py
async def delete(self, *args, **kwargs) -> Response:\n \"\"\"\n Sends a DELETE request.\n\n Returns:\n An HTTP response.\n \"\"\"\n\n return await self.request(\"DELETE\", *args, **kwargs)\n
"},{"location":"reference/utilities/requests/#roblox.utilities.requests.Requests.get","title":"get(*args, **kwargs)
async
","text":"Sends a GET request.
Returns:
Type DescriptionResponse
An HTTP response.
Source code inroblox/utilities/requests.py
async def get(self, *args, **kwargs) -> Response:\n \"\"\"\n Sends a GET request.\n\n Returns:\n An HTTP response.\n \"\"\"\n\n return await self.request(\"GET\", *args, **kwargs)\n
"},{"location":"reference/utilities/requests/#roblox.utilities.requests.Requests.patch","title":"patch(*args, **kwargs)
async
","text":"Sends a PATCH request.
Returns:
Type DescriptionResponse
An HTTP response.
Source code inroblox/utilities/requests.py
async def patch(self, *args, **kwargs) -> Response:\n \"\"\"\n Sends a PATCH request.\n\n Returns:\n An HTTP response.\n \"\"\"\n\n return await self.request(\"PATCH\", *args, **kwargs)\n
"},{"location":"reference/utilities/requests/#roblox.utilities.requests.Requests.post","title":"post(*args, **kwargs)
async
","text":"Sends a POST request.
Returns:
Type DescriptionResponse
An HTTP response.
Source code inroblox/utilities/requests.py
async def post(self, *args, **kwargs) -> Response:\n \"\"\"\n Sends a POST request.\n\n Returns:\n An HTTP response.\n \"\"\"\n\n return await self.request(\"POST\", *args, **kwargs)\n
"},{"location":"reference/utilities/requests/#roblox.utilities.requests.Requests.put","title":"put(*args, **kwargs)
async
","text":"Sends a PATCH request.
Returns:
Type DescriptionResponse
An HTTP response.
Source code inroblox/utilities/requests.py
async def put(self, *args, **kwargs) -> Response:\n \"\"\"\n Sends a PATCH request.\n\n Returns:\n An HTTP response.\n \"\"\"\n\n return await self.request(\"PUT\", *args, **kwargs)\n
"},{"location":"reference/utilities/requests/#roblox.utilities.requests.Requests.request","title":"request(method, *args, **kwargs)
async
","text":"Parameters:
Name Type Description Defaultmethod
str
The request method.
requiredReturns:
Type DescriptionResponse
An HTTP response.
Source code inroblox/utilities/requests.py
async def request(self, method: str, *args, **kwargs) -> Response:\n \"\"\"\n Arguments:\n method: The request method.\n\n Returns:\n An HTTP response.\n \"\"\"\n\n handle_xcsrf_token = kwargs.pop(\"handle_xcsrf_token\", True)\n skip_roblox = kwargs.pop(\"skip_roblox\", False)\n\n response = await self.session.request(method, *args, **kwargs)\n\n if skip_roblox:\n return response\n\n method = method.lower()\n\n if handle_xcsrf_token and self.xcsrf_token_name in response.headers and _xcsrf_allowed_methods.get(method):\n self.session.headers[self.xcsrf_token_name] = response.headers[self.xcsrf_token_name]\n if response.status_code == 403: # Request failed, send it again\n response = await self.session.request(method, *args, **kwargs)\n\n if kwargs.get(\"stream\"):\n # Streamed responses should not be decoded, so we immediately return the response.\n return response\n\n if response.is_error:\n # Something went wrong, parse an error\n content_type = response.headers.get(\"Content-Type\")\n errors = None\n if content_type and content_type.startswith(\"application/json\"):\n data = None\n try:\n data = response.json()\n except JSONDecodeError:\n pass\n errors = data and data.get(\"errors\")\n\n exception = get_exception_from_status_code(response.status_code)(\n response=response,\n errors=errors\n )\n raise exception\n else:\n return response\n
"},{"location":"reference/utilities/types/","title":"types","text":"Contains types used internally by ro.py.
"},{"location":"reference/utilities/url/","title":"url","text":"This module contains functions and objects used internally by ro.py to generate URLs.
"},{"location":"reference/utilities/url/#roblox.utilities.url.URLGenerator","title":"URLGenerator
","text":"Generates URLs based on a chosen base URL.
Attributes:
Name Type Descriptionbase_url
The base URL.
Source code inroblox/utilities/url.py
class URLGenerator:\n \"\"\"\n Generates URLs based on a chosen base URL.\n\n Attributes:\n base_url: The base URL.\n \"\"\"\n\n def __init__(self, base_url: str):\n self.base_url = base_url\n\n def get_subdomain(self, subdomain: str, protocol: str = \"https\") -> str:\n \"\"\"\n Returns the full URL of a subdomain, given the base subdomain name.\n\n Arguments:\n subdomain: The URL subdomain.\n protocol: The URL protocol.\n \"\"\"\n return f\"{protocol}://{subdomain}.{self.base_url}\"\n\n def get_url(\n self,\n subdomain: str,\n path: str = \"\",\n base_url: str = None,\n protocol: str = \"https\",\n ) -> str:\n \"\"\"\n Returns a full URL, given a subdomain name, protocol, and path.\n\n Arguments:\n subdomain: The URL subdomain.\n protocol: The URL protocol.\n path: The URL path.\n base_url: The base URL.\n \"\"\"\n if base_url is None:\n base_url = self.base_url\n return f\"{protocol}://{subdomain}.{base_url}/{path}\"\n
"},{"location":"reference/utilities/url/#roblox.utilities.url.URLGenerator.get_subdomain","title":"get_subdomain(subdomain, protocol='https')
","text":"Returns the full URL of a subdomain, given the base subdomain name.
Parameters:
Name Type Description Defaultsubdomain
str
The URL subdomain.
requiredprotocol
str
The URL protocol.
'https'
Source code in roblox/utilities/url.py
def get_subdomain(self, subdomain: str, protocol: str = \"https\") -> str:\n \"\"\"\n Returns the full URL of a subdomain, given the base subdomain name.\n\n Arguments:\n subdomain: The URL subdomain.\n protocol: The URL protocol.\n \"\"\"\n return f\"{protocol}://{subdomain}.{self.base_url}\"\n
"},{"location":"reference/utilities/url/#roblox.utilities.url.URLGenerator.get_url","title":"get_url(subdomain, path='', base_url=None, protocol='https')
","text":"Returns a full URL, given a subdomain name, protocol, and path.
Parameters:
Name Type Description Defaultsubdomain
str
The URL subdomain.
requiredprotocol
str
The URL protocol.
'https'
path
str
The URL path.
''
base_url
str
The base URL.
None
Source code in roblox/utilities/url.py
def get_url(\n self,\n subdomain: str,\n path: str = \"\",\n base_url: str = None,\n protocol: str = \"https\",\n) -> str:\n \"\"\"\n Returns a full URL, given a subdomain name, protocol, and path.\n\n Arguments:\n subdomain: The URL subdomain.\n protocol: The URL protocol.\n path: The URL path.\n base_url: The base URL.\n \"\"\"\n if base_url is None:\n base_url = self.base_url\n return f\"{protocol}://{subdomain}.{base_url}/{path}\"\n
"},{"location":"tutorials/","title":"Tutorials","text":"This tutorial is intended for people building standalone applications. It expects basic Python knowledge but will explain almost everything you need to know to build. Make sure to read through the entire page instead of skimming it to ensure you don't miss anything important!
If at any point you are struggling to understand what to do, join the RoAPI Discord for help and support.
"},{"location":"tutorials/authentication/","title":"Authentication","text":"To authenticate our client, we need our .ROBLOSECURITY token. To learn about why we need this and how to get it, please see ROBLOSECURITY.
Once we have our token, we can add it to our client by passing it as the first parameter. Use the following code and replace TOKEN
with the .ROBLOSECURITY token grabbed earlier to authenticate your client.
from roblox import Client\nclient = Client(\"TOKEN\")\n
To test your token, replace the code in main()
with the following:
user = await client.get_authenticated_user()\nprint(\"ID:\", user.id)\nprint(\"Name:\", user.name)\n
If this raises an error, or the name and ID differ from what is expected, follow the instructions and try again. The issue with this structure is that it is not secure. It's easy to slip up and copy your code and accidentally send someone your token, and it makes it harder to collaborate on code with others."},{"location":"tutorials/authentication/#using-a-env-file","title":"Using a .env file","text":"To solve this problem, we'll create a separate file called .env
which will contain our token.
Your file should look like this, where TOKEN is the .ROBLOSECURITY token you grabbed earlier. .env
ROBLOXTOKEN=TOKEN\n
Place it in the same folder as your application's main file. Your file structure should look like this:
.\n\u251c\u2500 .env\n\u2514\u2500 main.py\n
Next, install the python-dotenv library with the following command:
$ pip install python-dotenv\n
Then, add these lines to the top of your code: import os\nfrom dotenv import load_dotenv\n
After that, replace the code where you generate your client with this: load_dotenv()\nclient = Client(os.getenv(\"ROBLOXTOKEN\"))\n
Test it with get_authenticated_user
and you should be all set! Finished code
main.pyimport asyncio\nimport os\nfrom dotenv import load_dotenv\nfrom roblox import Client\n\nload_dotenv()\n\nclient = Client(os.getenv(\"ROBLOXTOKEN\"))\n\nasync def main():\n user = await client.get_authenticated_user()\n print(\"ID:\", user.id)\n print(\"Name:\", user.name)\n\nasyncio.get_event_loop().run_until_complete(main())\n
"},{"location":"tutorials/bases/","title":"Bases","text":"Let's say you want to use ro.py to fetch the username history of a user, and you already know their user ID. You could do this:
user = await client.get_user(968108160)\nasync for username in user.username_history():\n print(username)\n
This code works, but it has an issue: we're sending an unnecessary request to Roblox. To explain why, let's take a look at what ro.py is doing behind the scenes in this code. - First, we call await client.get_user(2067807455)
. ro.py asks Roblox for information about the user with the ID 2067807455 and returns it as a User object. - Next, we iterate through user.username_history
. ro.py asks Roblox for the username history for user 2067807455 and returns it to you.
In this code, we call await client.get_user()
, but we don't use any user information, like user.name
or user.description
. We don't need to make this request!
ro.py lets you skip the \"information request\" with the client.get_base_TYPE
methods. We can use the client.get_base_user()
function to improve this code:
user = client.get_base_user(2067807455) # no await!\nasync for username in user.username_history():\n print(username)\n
Hint
In ro.py, all functions you await
or paginators you iterate through with async for
make at least one request internally. Notice how you need to await
the get_user
function, but not the get_base_user
function!
This works for other Roblox types as well, like groups and assets. For example, this code kicks a user from a group with only 1 request:
group = client.get_base_group(9695397)\nuser = client.get_base_user(2067807455)\nawait group.kick_user(user)\n
There's another technique we can use to optimize this example further. For functions that accept only one type, like kick_user
which always accepts a user, ro.py accepts bare IDs:
group = client.get_base_group(9695397)\nawait group.kick_user(2067807455)\n
"},{"location":"tutorials/error-handling/","title":"Error handling","text":"You can import ro.py exceptions from the roblox.utilities.exceptions
module or from the main roblox
module:
from roblox.utilities.exceptions import InternalServerError\n# or\nfrom roblox import InternalServerError\n
"},{"location":"tutorials/error-handling/#client-errors","title":"Client errors","text":"All of the Client.get_TYPE()
methods, like get_user()
and get_group()
, raise their own exceptions.
client.get_asset()
AssetNotFound
client.get_badge()
BadgeNotFound
client.get_group()
GroupNotFound
client.get_place()
PlaceNotFound
client.get_plugin()
PluginNotFound
client.get_universe()
UniverseNotFound
client.get_user()
UserNotFound
client.get_user_by_username()
UserNotFound
Here is an example of catching one of these exceptions:
try:\n user = await client.get_user_by_username(\"InvalidUsername!!!\")\nexcept UserNotFound:\n print(\"Invalid username!\")\n
All of these exceptions are subclasses of ItemNotFound
, which you can use as a catch-all.
When Roblox returns an error, ro.py raises an HTTP exception.
For example, if we try to post a group shout to a group that we don't the necessary permissions in, Roblox stops us and returns a 401 Unauthorized
error:
group = await client.get_group(1)\nawait group.update_shout(\"Shout!\")\n
This code will raise an error like this: roblox.utilities.exceptions.Unauthorized: 401 Unauthorized: https://groups.roblox.com/v1/groups/1/status.\n\nErrors:\n 0: Authorization has been denied for this request.\n
You can catch this error as follows:: group = await client.get_group(1)\ntry:\n await group.update_shout(\"Shout!\")\n print(\"Shout updated.\")\nexcept Unauthorized:\n print(\"Not allowed to shout.\")\n
These are the different types of exceptions raised depending on the HTTP error code Roblox returns:
HTTP status code Exception 400BadRequest
401 Unauthorized
403 Forbidden
429 TooManyRequests
500 InternalServerError
All of these exceptions are subclasses of the HTTPException
error, which you can use as a catch-all. For other unrecognized error codes, ro.py will fallback to the default HTTPException
.
For all HTTP exceptions, ro.py exposes a response
attribute so you can get the response information:
group = await client.get_group(1)\ntry:\n await group.update_shout(\"Shout!\")\n print(\"Shout updated.\")\nexcept Unauthorized as exception:\n print(\"Not allowed to shout.\")\n print(\"URL:\", exception.response.url)\n
Roblox also returns extra error data, which is what you see in the default error message. We can access this with the .errors
attribute, which is a list of ResponseError
: group = await client.get_group(1)\ntry:\n await group.update_shout(\"Shout!\")\n print(\"Shout updated.\")\nexcept Unauthorized as exception:\n print(\"Not allowed to shout.\")\n if len(exception.errors) > 0:\n error = exception.errors[0]\n print(\"Reason:\", error.message)\n
"},{"location":"tutorials/get-started/","title":"Get started","text":"At the beginning of every ro.py application is the client. The client represents a Roblox session, and it's your gateway to everything in ro.py.
To initialize a client, import it from the roblox
module: main.py
from roblox import Client\nclient = Client()\n
We can use the client to get information from Roblox by calling await client.get_TYPE()
, where TYPE
is a Roblox datatype, like a user or group.
There's a problem, though: if we run the following code... main.py
from roblox import Client\nclient = Client()\nawait client.get_user(1)\n
...it'll raise an error like this: File \"...\", line 1\nSyntaxError: 'await' outside function\n
This is because ro.py, like many Python libraries, is based on asyncio, a builtin Python library that allows for concurrent code. In the case of ro.py, this means your app can do something, like process Discord bot commands, while ro.py waits for Roblox to respond, saving tons of time and preventing one slow function from slowing down the whole program. Neat!
This means we need to wrap our code in an asynchronous function and then run it with asyncio.run
, like so:
import asyncio\nfrom roblox import Client\nclient = Client()\n\nasync def main():\n await client.get_user(1)\n\nasyncio.run(main())\n
This is the basic structure of every simple ro.py application. More complicated apps might not work like this - for example, in a Discord bot, another library might already be handling the asyncio part for you - but for simple scripts, this is what you'll be doing.
Now the error is gone, but our code doesn't do anything yet. Let's try printing out some information about this user. Add these lines to the end of your main function:
main.pyprint(\"Name:\", user.name)\nprint(\"Display Name:\", user.display_name)\nprint(\"Description:\", user.description)\n
Great! We now have a program that prints out a user's name, display name, and description. This same basic concept works for other kinds of objects on Roblox, like groups. Try replacing the code in your main function with this:
group = await client.get_group(1)\nprint(\"Name:\", group.name)\nprint(\"Description:\", group.description)\n
To see a list of everything you can do with the client, see Client
in the Code Reference.
So far, we've been using ro.py unauthenticated. Basically, we aren't logged in to Roblox, which means we can't perform any actions, like updating our description, or access any sensitive information, like which game our friend is playing right now. Your next mission, if you choose to accept it, is authenticating your client.
"},{"location":"tutorials/pagination/","title":"Pagination","text":"Certain Roblox endpoints are paginated. This means that going through their data is kind of like flipping through the pages of a book - you start at page 1 and then you can move forwards or backwards until you reach the start or the end.
This can be annoying when all you want is \"every member in a group\" or \"the last 10 posts on a group wall\", so ro.py abstracts this away into an iterator that you can use to loop over your data.
As an example, the Client.user_search()
function takes in a keyword (like \"builderman\") and returns a PageIterator
which you can loop through to get the search results.
A simple async for
can loop through the data no problem:
async for user in client.user_search(\"builderman\"):\n print(user.name)\n
We can limit the amount of items returned using the max_items
argument: async for user in client.user_search(\"builderman\", max_items=10):\n print(user.name)\n
We can also use .items()
: async for user in client.user_search(\"builderman\").items(10):\n print(user.name)\n
"},{"location":"tutorials/pagination/#looping-through-pages","title":"Looping through pages","text":"If we want to instead loop through each page, we can use .pages()
:
async for page in client.user_search(\"builderman\").pages():\n print(\"Page:\")\n for user in page:\n print(f\"\\t{user.name}\")\n
The size of this page depends on the value of the page_size
argument. It can be either 10, 25, 50 or 100. Higher values mean you send less requests to get the same amount of data, however these requests will usually take longer. async for page in client.user_search(\"builderman\", page_size=100).pages():\n print(f\"Page with {len(page)} items:\")\n for user in page:\n print(f\"\\t{user.name}\")\n
"},{"location":"tutorials/pagination/#flattening-into-a-list","title":"Flattening into a list","text":"If we want to turn all of this data into one list, we can use flatten()
. Be careful, as this isn't ideal for large sets of data and may use more memory. Because we turn this iterator into a list, we can use a normal for loop now:
for user in await client.user_search(\"boatbomber\").flatten():\n print(user.name)\n
We can limit the amount of items in this list using the max_items
argument: for user in await client.user_search(\"builderman\", max_items=10).flatten():\n print(user.name)\n
We can also pass the value directly to .flatten()
: for user in await client.user_search(\"builderman\").flatten(10):\n print(user.name)\n
As the result is just a normal list, we can store it in a variable: users = await client.user_search(\"builderman\").flatten(10)\nprint(f\"{len(users)} items:\")\nfor user in users:\n print(f\"\\t{user.name}\")\n
"},{"location":"tutorials/pagination/#but-what-about-other-things","title":"But what about other things?","text":"Iterators aren't just used for searching for users. There are also various other things that use this same concept, including group wall posts. In this example, we get the first 10 posts on the \"Official Group of Roblox\" group:
group = await client.get_group(1200769)\nasync for post in group.get_wall_posts(max_items=10):\n print(post)\n
If instead we want the last 10 posts (as in the most recent posts) we can use the sort_order
argument: group = await client.get_group(1200769)\nasync for post in group.get_wall_posts(sort_order=SortOrder.Descending, max_items=10):\n print(post)\n
The SortOrder
object can be imported like this: from roblox.utilities.iterators import SortOrder\n
"},{"location":"tutorials/roblosecurity/","title":"ROBLOSECURITY","text":"When you log in on the Roblox website, you create a new session with a special identifier linked to it, and that token is stored on your computer as a cookie. Every single time your computer asks Roblox to do anything - for example, \"give me the name of this user\" - your computer also gives this token to Roblox, and it can look and see if that token is valid.
Let's say you're asking Roblox to give you a list of your friends. It'll look at that token and know who you are, and can use that to give you your friends list. When you log out, that token is invalidated. Even if the client holds on to the token, it won't be valid after logging out.
This token is called the .ROBLOSECURITY
token and you will need one to do anything that you need to be logged in to do on Roblox, including: - getting information about yourself (name, description, ID, etc) - changing avatar - getting friends list - playing games
Danger
You may have heard of this token before and have been told that you should never, under any circumstances, share this token with anyone - and this is true! This token does give an attacker access to your Roblox account. However, this doesn't mean they gain access to everything - over time, more and more things are being locked behind other verification methods, like 2-step verification. We recommend using an alternate account with only the permissions it needs to limit the destruction an attacker can do. Always enable 2-step verification!
The best way to authenticate your ro.py application is to log in to Roblox on the website and then taking the .ROBLOSECURITY token from there.
Warning
Pressing the \"Log out\" button on the Roblox website invalidates your token, so you should not press this button after grabbing your token. Instead, consider using a private or incognito window and closing it when you are done.
To grab your .ROBLOSECURITY cookie, log into your account on the Roblox website and follow the instructions below.
Chrome/Chromium-basedFirefoxYou can access the cookie by going to https://www.roblox.com/, pressing the padlock icon next to the URL in your browser, clicking the arrow next to roblox.com
, opening up the \"Cookies\" folder, clicking \".ROBLOSECURITY\", clicking on the \"Content\" text once, pressing Ctrl+A, and then pressing Ctrl+C (make sure not to double-click this field as you won't select the entire value!)
Alternatively, you can access the cookie by going to https://www.roblox.com/, pressing Ctrl+Shift+I to access the Developer Tools, navigating to the \"Application\" tab, opening up the arrow next to \"Cookies\" on the sidebar on the left, clicking the https://www.roblox.com
item underneath the Cookies button, and then copying the .ROBLOSECURITY token by double-clicking on the value and then hitting Ctrl+C.
You can access the cookie by going to https://www.roblox.com/ and pressing Shift+F9, pressing the \"Storage\" tab button on the top, opening up the \"Cookies\" section in the sidebar on the left, clicking the https://www.roblox.com
item underneath it, and then copying the .ROBLOSECURITY token by double-clicking on the value and then hitting Ctrl+C.
The client.thumbnails
attribute is a ThumbnailProvider
object which you can use to generate thumbnails. Below is a list of item types on Roblox and methods you can use to generate their thumbnails.
To generate avatar thumbnails, use the get_user_avatar_thumbnails()
method. The type
parameter is an AvatarThumbnailType
object, which you can import from roblox
or from roblox.thumbnails
. Do note that the size
parameter only allows certain sizes - see the docs for more details.
user = await client.get_user(2067807455)\nuser_thumbnails = await client.thumbnails.get_user_avatar_thumbnails(\n users=[user],\n type=AvatarThumbnailType.full_body,\n size=(420, 420)\n)\n\nif len(user_thumbnails) > 0:\n user_thumbnail = user_thumbnails[0]\n print(user_thumbnail.image_url)\n
thumbnails
is a list of Thumbnail
objects. We can read the first thumbnail (if it exists) and print out its URL.
To generate 3D avatar thumbnails, use the get_user_avatar_thumbnail_3d()
method and call get_3d_data()
on the resulting thumbnail.
user = await client.get_user(1)\nuser_3d_thumbnail = await client.thumbnails.get_user_avatar_thumbnail_3d(user)\nuser_3d_data = await user_3d_thumbnail.get_3d_data()\nprint(\"OBJ:\", user_3d_data.obj.get_url())\nprint(\"MTL:\", user_3d_data.mtl.get_url())\nprint(\"Textures:\")\nfor texture in user_3d_data.textures:\n print(texture.get_url())\n
threed_data
is a ThreeDThumbnail
object."},{"location":"tutorials/thumbnails/#groups","title":"Groups","text":"To generate group icons, use the get_group_icons()
method.
group = await client.get_group(9695397)\ngroup_icons = await client.thumbnails.get_group_icons(\n groups=[group],\n size=(150, 150)\n)\nif len(group_icons) > 0:\n group_icon = group_icons[0]\n print(group_icon.image_url)\n
"},{"location":"tutorials/thumbnails/#assets","title":"Assets","text":"To generate asset thumbnails, use the get_asset_thumbnails()
method.
asset = await client.get_asset(8100249026)\nasset_thumbnails = await client.thumbnails.get_asset_thumbnails(\n assets=[asset],\n size=(420, 420)\n)\nif len(asset_thumbnails) > 0:\n asset_thumbnail = asset_thumbnails[0]\n print(asset_thumbnail.image_url)\n
"},{"location":"tutorials/thumbnails/#3d-thumbnails_1","title":"3D thumbnails","text":"Note
Not all assets support 3D thumbnails. Most \"catalog\" assets do, excluding \"classic faces\", which have no 3D representation.
To generate 3D asset thumbnails, use the get_asset_thumbnail_3d()
method and call get_3d_data()
on the resulting thumbnail.
asset = await client.get_asset(151784320)\nasset_3d_thumbnail = await client.thumbnails.get_asset_thumbnail_3d(asset)\nasset_3d_data = await asset_3d_thumbnail.get_3d_data()\nprint(\"OBJ:\", asset_3d_data.obj.get_url())\nprint(\"MTL:\", asset_3d_data.mtl.get_url())\nprint(\"Textures:\")\nfor texture in asset_3d_data.textures:\n print(texture.get_url())\n
"},{"location":"tutorials/thumbnails/#places","title":"Places","text":"To generate place icons, use the get_place_icons()
method.
place = await client.get_place(8100260845)\nplace_thumbnails = await client.thumbnails.get_place_icons(\n places=[place],\n size=(512, 512)\n)\nif len(place_thumbnails) > 0:\n place_thumbnail = place_thumbnails[0]\n print(place_thumbnail.image_url)\n
"},{"location":"tutorials/thumbnails/#universes","title":"Universes","text":""},{"location":"tutorials/thumbnails/#icons","title":"Icons","text":"To generate universe icons, use theget_universe_icons()
method.
universe = await client.get_universe(3118067569)\nuniverse_icons = await client.thumbnails.get_universe_icons(\n universes=[universe],\n size=(512, 512)\n)\nif len(universe_icons) > 0:\n universe_icon = universe_icons[0]\n print(universe_icon.image_url)\n
"},{"location":"tutorials/thumbnails/#thumbnails_1","title":"Thumbnails","text":"To generate universe thumbnails, use the get_universe_thumbnails()
method. Because each universe can have multiple thumbnails, this method behaves differently.
universe = await client.get_universe(3118067569)\nuniverses_thumbnails = await client.thumbnails.get_universe_thumbnails(\n universes=[universe],\n size=(768, 432)\n)\nif len(universes_thumbnails) > 0:\n universe_thumbnails = universes_thumbnails[0]\n for universe_thumbnail in universe_thumbnails.thumbnails:\n print(universe_thumbnail.image_url)\n
"},{"location":"tutorials/thumbnails/#badges","title":"Badges","text":"To generate badge icons, use the get_badge_icons()
method.
badge = await client.get_badge(2124867793)\nbadge_icons = await client.thumbnails.get_badge_icons(\n badges=[badge],\n size=(150, 150)\n)\nif len(badge_icons) > 0:\n icon = badge_icons[0]\n print(icon.image_url)\n
"},{"location":"tutorials/thumbnails/#gamepasses","title":"Gamepasses","text":"To generate gamepass icons, use the get_gamepass_icons()
method. This example uses get_base_gamepass()
because there is no get_gamepass
method.
gamepass = client.get_base_gamepass(25421830)\ngamepass_icons = await client.thumbnails.get_gamepass_icons(\n gamepasses=[gamepass],\n size=(150, 150)\n)\nif len(gamepass_icons) > 0:\n icon = gamepass_icons[0]\n print(icon.image_url)\n
"}]}
\ No newline at end of file
diff --git a/dev/sitemap.xml.gz b/dev/sitemap.xml.gz
index 54d27fed..900bc559 100644
Binary files a/dev/sitemap.xml.gz and b/dev/sitemap.xml.gz differ
diff --git a/dev/tutorials/bases/index.html b/dev/tutorials/bases/index.html
index 43d6d478..c886a49f 100644
--- a/dev/tutorials/bases/index.html
+++ b/dev/tutorials/bases/index.html
@@ -1941,7 +1941,7 @@ await client.get_user(2067807455)
. ro.py asks Roblox for information about the user with the ID 2067807455 and returns it as a User object.user.username_history
. ro.py asks Roblox for the username history for user 2067807455 and returns it to you.
In this code, we call await client.get_user()
, but we don't use any user information, like user.name
or user.description
. We don't need to make this request!
ro.py lets you do this with the client.get_base_TYPE
functions. We'll can the client.get_base_user()
function to improve the code:
+
ro.py lets you skip the "information request" with the client.get_base_TYPE
methods. We can use the client.get_base_user()
function to improve this code:
user = client.get_base_user(2067807455) # no await!
async for username in user.username_history():
print(username)
@@ -1955,7 +1955,7 @@ Bases&
user = client.get_base_user(2067807455)
await group.kick_user(user)
There's another technique we can use to optimize this example further. For functions that accept only one type, like kick_user
which always accepts a user, ro.py accepts bare user IDs:
+
There's another technique we can use to optimize this example further. For functions that accept only one type, like kick_user
which always accepts a user, ro.py accepts bare IDs:
group = client.get_base_group(9695397)
await group.kick_user(2067807455)