diff --git a/src/main.rs b/src/main.rs index e9b20f7..55e08e3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -41,6 +41,9 @@ struct Args { /// Generate a TypeScript definition file for roblox-ts users. #[arg(short, long)] typescript: bool, + + #[arg(short, long)] + user_id: u64, } const LOCKFILE_PATH: &str = "asphalt.lock.toml"; @@ -102,7 +105,8 @@ async fn main() { } if asset_id.is_none() { - asset_id = Some(upload_asset(path.clone(), asset_type, api_key.clone()).await); + asset_id = + Some(upload_asset(path.clone(), asset_type, api_key.clone(), args.user_id).await); println!("Uploaded {}", style(path_str).green()); } diff --git a/src/upload.rs b/src/upload.rs index a7378dd..745410f 100644 --- a/src/upload.rs +++ b/src/upload.rs @@ -63,7 +63,12 @@ async fn get_image_id(asset_id: u64) -> u64 { id_str.parse::().unwrap() } -pub async fn upload_asset(path: PathBuf, asset_type: AssetType, api_key: String) -> u64 { +pub async fn upload_asset( + path: PathBuf, + asset_type: AssetType, + api_key: String, + user_id: u64, +) -> u64 { let path_str = path.to_str().unwrap(); let create_params = CreateAssetParams { @@ -74,7 +79,7 @@ pub async fn upload_asset(path: PathBuf, asset_type: AssetType, api_key: String) display_name: path_str.to_string(), creation_context: AssetCreationContext { creator: AssetCreator::User(AssetUserCreator { - user_id: "9670971".to_string(), + user_id: user_id.to_string(), }), expected_price: None, },