diff --git a/plugins/cowsay.lua b/plugins/cowsay.lua index 904efca..735947a 100644 --- a/plugins/cowsay.lua +++ b/plugins/cowsay.lua @@ -1,8 +1,12 @@ function run(msg, matches) cow = matches[1] local receiver = get_receiver(msg) + if string.match(msg.text, '"') then + return 'Vergiss es' + else local text = run_bash('cowsay "' .. cow .. '"') send_msg(receiver, text, ok_cb, false) + end end return { diff --git a/plugins/youtube_dl.lua b/plugins/youtube_dl.lua index 7d79584..64cd3e7 100644 --- a/plugins/youtube_dl.lua +++ b/plugins/youtube_dl.lua @@ -1,9 +1,14 @@ +-- Requires: (sudo) apt-get install youtube-dl function run(msg, matches) URL = matches[1] local receiver = get_receiver(msg) + if string.match(msg.text, '"') then + return 'Vergiss es' + else text = run_bash("rm tmp/video.mp4 && youtube-dl -o tmp/video.mp4 " .. URL) send_video(get_receiver(msg), "tmp/video.mp4", ok_cb, false) return URL .. ' wurde gedownloadet und wird jetzt gesendet! \nDas kann je nach Video sehr lang dauern! \nAlso habt Gedult!' + end end return {