Merge branch 'feature/FixURLS'
This commit is contained in:
Generated
+1
-1
@@ -4,7 +4,7 @@ version = 4
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "RhythmWorks"
|
name = "RhythmWorks"
|
||||||
version = "0.1.0"
|
version = "0.2.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"reqwest",
|
"reqwest",
|
||||||
"semver",
|
"semver",
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "RhythmWorks"
|
name = "RhythmWorks"
|
||||||
version = "0.1.0"
|
version = "0.2.0"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
|||||||
+5
-2
@@ -77,13 +77,16 @@ impl EventHandler for Handler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if msg.content.starts_with("!play") {
|
if msg.content.starts_with("!play") {
|
||||||
let url = msg
|
let mut url = msg
|
||||||
.content
|
.content
|
||||||
.strip_prefix("!play ")
|
.strip_prefix("!play ")
|
||||||
.unwrap_or("")
|
.unwrap_or("")
|
||||||
.trim()
|
.trim()
|
||||||
.to_string();
|
.to_string();
|
||||||
|
let separator = "&";
|
||||||
|
if let Some(offset) = url.find(separator) {
|
||||||
|
url.truncate(offset);
|
||||||
|
}
|
||||||
if url.is_empty() {
|
if url.is_empty() {
|
||||||
let _ = msg.reply(&ctx, "Please provide a YouTube URL.").await;
|
let _ = msg.reply(&ctx, "Please provide a YouTube URL.").await;
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user