diff --git a/Cargo.lock b/Cargo.lock index 8cdc981..685bd25 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,7 +4,7 @@ version = 4 [[package]] name = "RhythmWorks" -version = "0.1.0" +version = "0.2.0" dependencies = [ "reqwest", "semver", diff --git a/Cargo.toml b/Cargo.toml index 1ab1f66..90da1cd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "RhythmWorks" -version = "0.1.0" +version = "0.2.0" edition = "2024" [dependencies] diff --git a/src/main.rs b/src/main.rs index fe15726..f460121 100644 --- a/src/main.rs +++ b/src/main.rs @@ -77,13 +77,16 @@ impl EventHandler for Handler { } } if msg.content.starts_with("!play") { - let url = msg + let mut url = msg .content .strip_prefix("!play ") .unwrap_or("") .trim() .to_string(); - + let separator = "&"; + if let Some(offset) = url.find(separator) { + url.truncate(offset); + } if url.is_empty() { let _ = msg.reply(&ctx, "Please provide a YouTube URL.").await; return;