From 2e63040f99859c6221478c80c886be9e0e914cb5 Mon Sep 17 00:00:00 2001 From: yago Date: Thu, 20 Nov 2014 23:30:41 +0100 Subject: [PATCH] Some cool media files --- plugins/gifs.lua | 14 -------------- plugins/media.lua | 23 +++++++++++++++++++++++ 2 files changed, 23 insertions(+), 14 deletions(-) delete mode 100644 plugins/gifs.lua create mode 100644 plugins/media.lua diff --git a/plugins/gifs.lua b/plugins/gifs.lua deleted file mode 100644 index 66e685f..0000000 --- a/plugins/gifs.lua +++ /dev/null @@ -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 -} \ No newline at end of file diff --git a/plugins/media.lua b/plugins/media.lua new file mode 100644 index 0000000..664f6a5 --- /dev/null +++ b/plugins/media.lua @@ -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 +} \ No newline at end of file