Media: Fix

This commit is contained in:
Andreas Bielawski 2016-08-14 22:56:18 +02:00
parent c2bab342a9
commit 0fbd5e16cf

View File

@ -1,7 +1,5 @@
local media = {} local media = {}
mimetype = (loadfile "./otouto/mimetype.lua")()
media.triggers = { media.triggers = {
"(https?://[%w-_%.%?%.:,/%+=&%[%]]+%.(gif))$", "(https?://[%w-_%.%?%.:,/%+=&%[%]]+%.(gif))$",
"^(https?://[%w-_%.%?%.:,/%+=&%[%]]+%.(mp4))$", "^(https?://[%w-_%.%?%.:,/%+=&%[%]]+%.(mp4))$",
@ -25,7 +23,7 @@ media.triggers = {
function media:action(msg, config, matches) function media:action(msg, config, matches)
local url = matches[1] local url = matches[1]
local ext = matches[2] local ext = matches[2]
local mime_type = mimetype:get_content_type_no_sub(ext) local mime_type = mimetype.get_content_type_no_sub(ext)
local receiver = msg.chat.id local receiver = msg.chat.id
if mime_type == 'audio' then if mime_type == 'audio' then