Some cool media files

This commit is contained in:
yago 2014-11-20 23:30:41 +01:00
parent 33441b7dd7
commit 2e63040f99
2 changed files with 23 additions and 14 deletions

View File

@ -1,14 +0,0 @@
function run(msg, matches)
file = download_to_file(matches[1])
send_document(get_receiver(msg), file, ok_cb, false)
end
return {
description = "from gif URL downloads it and sends to origin",
usage = "",
patterns = {
"(https?://[%w-_%.%?%.:/%+=&]+.gif)$"
},
run = run
}

23
plugins/media.lua Normal file
View File

@ -0,0 +1,23 @@
function run(msg, matches)
file = download_to_file(matches[1])
send_document(get_receiver(msg), file, ok_cb, false)
end
return {
description = "from media URL downloads it and sends to origin",
usage = "",
patterns = {
"(https?://[%w-_%.%?%.:/%+=&]+.gif)$",
"(https?://[%w-_%.%?%.:/%+=&]+.mp4)$",
"(https?://[%w-_%.%?%.:/%+=&]+.pdf)$",
"(https?://[%w-_%.%?%.:/%+=&]+.ogg)$",
"(https?://[%w-_%.%?%.:/%+=&]+.zip)$",
"(https?://[%w-_%.%?%.:/%+=&]+.mp3)$",
"(https?://[%w-_%.%?%.:/%+=&]+.rar)$",
"(https?://[%w-_%.%?%.:/%+=&]+.wmv)$",
"(https?://[%w-_%.%?%.:/%+=&]+.doc)$",
"(https?://[%w-_%.%?%.:/%+=&]+.avi)$"
},
run = run
}