Documentation ¶
Overview ¶
Deals with services related to ROBLOX assets.
Index ¶
- Constants
- func ChangeAssetOptions(client *rbxweb.Client, assetId int64, options AssetOptions) error
- func DisownAsset(client *rbxweb.Client, assetId int64) error
- func GetIdFromVersion(client *rbxweb.Client, assetVersionId int64) (assetId int64, err error)
- func GetLatestModel(client *rbxweb.Client, userId int32) (assetId int64, err error)
- func UpdatePlace(client *rbxweb.Client, reader io.Reader, placeId int64) (err error)
- func UpdatePlaceFile(client *rbxweb.Client, filename string, placeId int64) (err error)
- func Upload(client *rbxweb.Client, reader io.Reader, info url.Values) (assetVersionId int64, err error)
- func UploadModel(client *rbxweb.Client, reader io.Reader, modelId int64, info url.Values) (assetVersionId int64, err error)
- func UploadModelFile(client *rbxweb.Client, filename string, modelId int64, info url.Values) (assetVersionId int64, err error)
- func UserOwnsAsset(client *rbxweb.Client, assetId int64, userId int64) (bool, error)
- type AssetOptions
- type Info
Constants ¶
const ( TypeImage byte = 1 TypeTShirt byte = 2 TypeAudio byte = 3 TypeMesh byte = 4 TypeLua byte = 5 TypeHTML byte = 6 TypeText byte = 7 TypeHat byte = 8 TypePlace byte = 9 TypeModel byte = 10 TypeShirt byte = 11 TypePants byte = 12 TypeDecal byte = 13 TypeAvatar byte = 16 TypeHead byte = 17 TypeFace byte = 18 TypeGear byte = 19 TypeBadge byte = 21 TypeGroupEmblem byte = 22 TypeAnimation byte = 24 TypeArms byte = 25 TypeLegs byte = 26 TypeTorso byte = 27 TypeRightArm byte = 28 TypeLeftArm byte = 29 TypeLeftLeg byte = 30 TypeRightLeg byte = 31 TypePackage byte = 32 TypeYouTubeVideo byte = 33 TypeGamePass byte = 34 TypeApp byte = 35 TypeCode byte = 37 TypePlugin byte = 38 )
Asset types.
Variables ¶
This section is empty.
Functions ¶
func ChangeAssetOptions ¶
func ChangeAssetOptions(client *rbxweb.Client, assetId int64, options AssetOptions) error
func GetIdFromVersion ¶
GetIdFromVersion returns an asset id from an asset version id.
func GetLatestModel ¶
GetLatestModel returns the asset id of the latest model for a given user. While this is useful for retrieving the asset id of a newly created model that was just uploaded, it is not necessarily reliable for this purpose.
func UpdatePlace ¶
UpdatePlace uploads data from `reader` to Roblox as a Place asset. `placeId` must be the id of an existing place. This function cannot create a new place.
This function requires the client to be logged in.
func UpdatePlaceFile ¶
UpdatePlaceFile is similar to UpdatePlace, but gets the data from a file name.
This function requires the client to be logged in.
func Upload ¶
func Upload(client *rbxweb.Client, reader io.Reader, info url.Values) (assetVersionId int64, err error)
Upload generically uploads data from `reader` as an asset to the ROBLOX website. `info` can be used to specify information about the model. The following parameters are known:
type - The type of asset. assetid - The id of the asset to update. 0 uploads a new asset. name - The name of the asset. description - The asset's description. genreTypeId - The asset's genre. isPublic - Whether the asset can be taken by other users. allowComments - Whether users can comment on the asset.
The success of this function is highly dependent on these parameters. For example, most asset types may only be uploaded by authorized users. Parameters that specify information about the asset only apply for new assets. That is, updating an asset will only update the contents, but not the information about it.
`assetVersionId` is the version id of the uploaded asset. This is unique for each upload. This can be used with GetIdFromVersion to get the asset id.
This function requires the client to be logged in.
func UploadModel ¶
func UploadModel(client *rbxweb.Client, reader io.Reader, modelId int64, info url.Values) (assetVersionId int64, err error)
UploadModel uploads data from `reader` to Roblox as a Model asset. If updating an existing model, `modelId` should be the id of the model. If `modelId` is 0, then a new model will be uploaded. If uploading a new model, `info` can be used to specify information about the model.
This function requires the client to be logged in.
Types ¶
type AssetOptions ¶
type Info ¶
type Info struct { AssetId int64 ProductId int64 Name string Description string AssetTypeId int32 Creator struct { Id int32 Name string } Created time.Time Updated time.Time PriceInRobux int64 PriceInTickets int64 Sales int32 IsNew bool IsForSale bool IsPublicDomain bool IsLimited bool IsLimitedUnique bool Remaining int32 MinimumMembershipLevel int32 ContentRatingTypeId int32 }
Contains information about an asset.