Update to allow overwriting
This commit is contained in:
parent
f16da548b6
commit
9652a2630e
4
asset.go
4
asset.go
@ -11,6 +11,7 @@ import (
|
|||||||
|
|
||||||
type AssetUploadOptions struct {
|
type AssetUploadOptions struct {
|
||||||
Name string
|
Name string
|
||||||
|
AssetID int
|
||||||
Description string
|
Description string
|
||||||
Public bool
|
Public bool
|
||||||
Comments bool
|
Comments bool
|
||||||
@ -25,7 +26,7 @@ type AssetUploadResponse struct {
|
|||||||
func (s *Session) CreateAsset(options *AssetUploadOptions, f io.Reader) (AssetUploadResponse, error) {
|
func (s *Session) CreateAsset(options *AssetUploadOptions, f io.Reader) (AssetUploadResponse, error) {
|
||||||
var aresp AssetUploadResponse
|
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 {
|
if err != nil {
|
||||||
return aresp, err
|
return aresp, err
|
||||||
}
|
}
|
||||||
@ -33,6 +34,7 @@ func (s *Session) CreateAsset(options *AssetUploadOptions, f io.Reader) (AssetUp
|
|||||||
query := endpoint.Query()
|
query := endpoint.Query()
|
||||||
query.Set("name", options.Name)
|
query.Set("name", options.Name)
|
||||||
query.Set("description", options.Description)
|
query.Set("description", options.Description)
|
||||||
|
query.Set("assetid", strconv.Itoa(options.AssetID))
|
||||||
|
|
||||||
// Comments
|
// Comments
|
||||||
if options.Comments {
|
if options.Comments {
|
||||||
|
Loading…
Reference in New Issue
Block a user