fix: stop bot from loading playlists and crashing itself

This commit is contained in:
moonleay 2024-09-29 22:41:05 +02:00
parent e56e83213f
commit 84048b1b67
Signed by: moonleay
GPG key ID: 82667543CCD715FB

View file

@ -56,7 +56,7 @@ pub async fn attempt_to_queue_song(
return Embed::create_error_respose(
username,
"You are not in my VC",
"You have to be in my VC in order to controll the music.",
"You have to be in my VC in order to control the music.",
);
}
}
@ -70,6 +70,14 @@ pub async fn attempt_to_queue_song(
.expect("Guaranteed to exist in the typemap.")
};
if query.contains("youtu") && query.contains("&list=") {
return Embed::create_error_respose(
username,
"Playlists are not supported",
"I do not support playlists of any kind, please only provide links to videos"
);
}
// Create source
let src = if do_search {
YoutubeDl::new_search(http_client, query.to_string())