From 9652a2630ec6e9b7260346b924dbfb3df2da6607 Mon Sep 17 00:00:00 2001 From: itzaname Date: Tue, 22 Sep 2020 12:30:25 -0400 Subject: [PATCH] Update to allow overwriting --- asset.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/asset.go b/asset.go index 4d6df6b..95d30d2 100644 --- a/asset.go +++ b/asset.go @@ -11,6 +11,7 @@ import ( type AssetUploadOptions struct { Name string + AssetID int Description string Public bool Comments bool @@ -25,7 +26,7 @@ type AssetUploadResponse struct { func (s *Session) CreateAsset(options *AssetUploadOptions, f io.Reader) (AssetUploadResponse, error) { var aresp AssetUploadResponse - endpoint, err := url.Parse("https://data.roblox.com/Data/Upload.ashx?json=1&assetid=0&type=Model&genreTypeId=1") + endpoint, err := url.Parse("https://data.roblox.com/Data/Upload.ashx?json=1&type=Model&genreTypeId=1") if err != nil { return aresp, err } @@ -33,6 +34,7 @@ func (s *Session) CreateAsset(options *AssetUploadOptions, f io.Reader) (AssetUp query := endpoint.Query() query.Set("name", options.Name) query.Set("description", options.Description) + query.Set("assetid", strconv.Itoa(options.AssetID)) // Comments if options.Comments {