From 84048b1b67bbf4c8a563beda0948aa2e9bc20f2a Mon Sep 17 00:00:00 2001 From: moonleay Date: Sun, 29 Sep 2024 22:41:05 +0200 Subject: [PATCH] fix: stop bot from loading playlists and crashing itself --- src/music/music_manager.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/music/music_manager.rs b/src/music/music_manager.rs index df6654c..3df3dfc 100644 --- a/src/music/music_manager.rs +++ b/src/music/music_manager.rs @@ -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())