From b203958ff299c080a6b0156be0a8a6451b8dfca1 Mon Sep 17 00:00:00 2001 From: tommy aka doge <59783653+dowoge@users.noreply.github.com> Date: Thu, 22 Sep 2022 22:20:47 -0400 Subject: [PATCH] havent tested this but this shouldve been there from the beginning --- src/modules/commands/download.lua | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/modules/commands/download.lua b/src/modules/commands/download.lua index cbe23ff..3f5e020 100644 --- a/src/modules/commands/download.lua +++ b/src/modules/commands/download.lua @@ -43,11 +43,13 @@ commands:Add('sc',{},'download soundcloud song (usage: "sc [link]")', function(t local songName repeat local str = s:read() - local tag = str:match('^%[(.+)%]') - if tag=='soundcloud' then - local song = str:match('^%[soundcloud%] (.+):') - if song:match('%d+')~=song then - songName = song:match('.+/(.+)') + if str then + local tag = str:match('^%[(.+)%]') + if tag=='soundcloud' then + local song = str:match('^%[soundcloud%] (.+):') + if song:match('%d+')~=song then + songName = song:match('.+/(.+)') + end end end until s:read()==nil