fixed a critical bug in cowsay and youtube_dl

This commit is contained in:
Akamaru 2015-06-17 20:30:14 +02:00
parent bcb00f488f
commit 23cd446e0b
2 changed files with 9 additions and 0 deletions

View File

@ -1,8 +1,12 @@
function run(msg, matches) function run(msg, matches)
cow = matches[1] cow = matches[1]
local receiver = get_receiver(msg) local receiver = get_receiver(msg)
if string.match(msg.text, '"') then
return 'Vergiss es'
else
local text = run_bash('cowsay "' .. cow .. '"') local text = run_bash('cowsay "' .. cow .. '"')
send_msg(receiver, text, ok_cb, false) send_msg(receiver, text, ok_cb, false)
end
end end
return { return {

View File

@ -1,9 +1,14 @@
-- Requires: (sudo) apt-get install youtube-dl
function run(msg, matches) function run(msg, matches)
URL = matches[1] URL = matches[1]
local receiver = get_receiver(msg) 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) 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) 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!' return URL .. ' wurde gedownloadet und wird jetzt gesendet! \nDas kann je nach Video sehr lang dauern! \nAlso habt Gedult!'
end
end end
return { return {