Creator
rblxopencloud.Asset
Represents an uploaded and processed asset on Roblox.
Warning
This class isn't designed to be created by users. It is returned by Creator.upload_asset()
, and Creator.update_asset()
.
Attributes:
Name | Type | Description |
---|---|---|
id |
int
|
The ID of the asset. |
type |
AssetType
|
The type of the asset. |
name |
str
|
The asset's name. |
description |
str
|
The asset's description. |
creator |
Union[User, Group]
|
The |
revision_id |
Optional[int]
|
The ID of the current revision (only for updatable assets). |
revision_time |
Optional[datetime]
|
The timestamp the current revision was made (only for updatable assets). |
rblxopencloud.PendingAsset
Represents an asset uploaded to Roblox, but hasn't been processed yet.
Warning
This class isn't designed to be created by users. It is returned by Creator.upload_asset()
, and Creator.update_asset()
.
fetch_operation()
Checks if the asset has finished proccessing, if so returns the asset's rblxopencloud.Asset
object.
Returns:
Type | Description |
---|---|
Optional[Asset]
|
If it has finished processing it'll return the asset's |
Raises:
Type | Description |
---|---|
InvalidKey
|
The API key isn't valid, doesn't have access to upload assets, or is from an invalid IP address. |
RateLimited
|
You've exceeded the rate limits. |
ServiceUnavailable
|
The Roblox servers ran into an error, or are unavailable right now. |
rblx_opencloudException
|
Roblox returned an unexpected error. |
rblxopencloud.Creator
Represents a base object that assets can be uploaded to, such as users or groups.
Warning
This class isn't designed to be created by users. It bases rblxopencloud.User()
, and rblxopencloud.Group()
.
Attributes:
Name | Type | Description |
---|---|---|
id |
int
|
The user/group ID. |
upload_asset(file, asset_type, name, description, expected_robux_price=0)
Uploads the file requested file onto roblox as an asset with the provided name and description. The following asset types and file formats are accepted:
Asset Type | File Formats |
---|---|
rblxopencloud.AssetType.Decal |
.png , .jpeg , .bmp , .tga |
rblxopencloud.AssetType.Audio |
.mp3 , .ogg |
rblxopencloud.AssetType.Model |
.fbx |
The asset:read
and asset:write
scopes are required for OAuth2 authorization.
Example
You can upload a file stored on your computer like this:
If the asset is from hosted from a URL on the internet, you could use this:Parameters:
Name | Type | Description | Default |
---|---|---|---|
file |
BytesIO
|
The file opened in bytes to be uploaded. |
required |
asset_type |
Union[AssetType, str]
|
The type of asset you're uploading. |
required |
name |
str
|
The name of your asset. |
required |
description |
str
|
The description of your asset. |
required |
expected_robux_price |
int
|
The amount of robux expected to upload. Fails if lower than actual price. |
0
|
Returns:
Type | Description |
---|---|
Union[Asset, PendingAsset]
|
Returns |
Raises:
Type | Description |
---|---|
InvalidAsset
|
The file is either an unsupported type, uploaded as the wrong |
ModeratedText
|
The name or description was moderated by Roblox's text filter. |
InvalidKey
|
The API key isn't valid, doesn't have access to upload assets, or is from an invalid IP address. |
RateLimited
|
You've exceeded the rate limits. |
ServiceUnavailable
|
The Roblox servers ran into an error, or are unavailable right now. |
rblx_opencloudException
|
Roblox returned an unexpected error. |
Danger
Avoid uploading assets to Roblox that you don't have full control over, such as AI generated assets or content created by unknown people. Assets uploaded that break Roblox's Terms of Services can get your account moderated.
For OAuth2 developers, it has been confirmed by Roblox staff in this DevForum post, that your app will not be punished if a malicious user uses it to upload Terms of Service violating content, and instead the authorizing user's account will be punished.
update_asset(asset_id, file)
Uploads the file requested file onto roblox, replacing the existing asset. The following asset types and file formats can be updated:
Asset Type | File Formats |
---|---|
rblxopencloud.AssetType.Model |
.fbx |
The asset:read
and asset:write
scopes are required for OAuth2 authorization.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
asset_id |
int
|
The ID of the asset to update. |
required |
file |
BytesIO
|
The file opened in bytes to be replace the old one. |
required |
Returns:
Type | Description |
---|---|
Union[Asset, PendingAsset]
|
Returns |
Raises:
Type | Description |
---|---|
InvalidAsset
|
The file is either an unsupported type, uploaded as the wrong |
ModeratedText
|
The name or description was moderated by Roblox's text filter. |
InvalidKey
|
The API key isn't valid, doesn't have access to upload assets, or is from an invalid IP address. |
RateLimited
|
You've exceeded the rate limits. |
ServiceUnavailable
|
The Roblox servers ran into an error, or are unavailable right now. |
rblx_opencloudException
|
Roblox returned an unexpected error. |
Danger
Avoid uploading assets to Roblox that you don't have full control over, such as AI generated assets or content created by unknown people. Assets uploaded that break Roblox's Terms of Services can get your account moderated.
For OAuth2 developers, it has been confirmed by Roblox staff in this DevForum post, that your app will not be punished if a malicious user uses it to upload Terms of Service violating content, and instead the authorizing user's account will be punished.
rblxopencloud.AssetType
Bases: Enum
Enum denoting what type a rblxopencloud.Asset
is.
Attributes:
Name | Type | Description |
---|---|---|
Unknown |
0
|
The asset type is unknown. |
Decal |
1
|
|
Audio |
2
|
|
Model |
3
|
|