Closes #5
This commit is contained in:
+5
-2
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user