- Portiere get_data

- Ergänze Antworten da, wo ich es vergessen habe...
This commit is contained in:
Andreas Bielawski 2016-08-18 17:38:20 +02:00
parent 633f8373f2
commit d9a6836dd5
17 changed files with 50 additions and 25 deletions

View File

@ -57,7 +57,7 @@ function boobs:action(msg, config, matches)
if url ~= nil then
local file = download_to_file(url)
utilities.send_photo(self, msg.chat.id, file, url)
utilities.send_photo(self, msg.chat.id, file, url, msg.message_id)
return
else
utilities.send_reply(self, msg, 'Nichts gefunden :(')

View File

@ -51,9 +51,9 @@ function danbooru:action(msg, config, matches)
utilities.send_typing(self, msg.chat.id, 'upload_photo')
local file = download_to_file(url)
if string.ends(url, ".gif") or string.ends(url, ".zip") or string.ends(url, ".webm") then
utilities.send_document(self, msg.chat.id, file)
utilities.send_document(self, msg.chat.id, file, nil, msg.message_id)
else
utilities.send_photo(self, msg.chat.id, file)
utilities.send_photo(self, msg.chat.id, file, nil, msg.message_id)
end
return
end
@ -84,9 +84,9 @@ function danbooru:action(msg, config, matches)
utilities.send_typing(self, msg.chat.id, 'upload_photo')
local img = download_to_file(download_url)
if string.ends(download_url, ".gif") or string.ends(download_url, ".zip") or string.ends(download_url, ".webm") then
utilities.send_document(self, msg.chat.id, img)
utilities.send_document(self, msg.chat.id, img, nil, msg.message_id)
else
utilities.send_photo(self, msg.chat.id, img)
utilities.send_photo(self, msg.chat.id, img, nil, msg.message_id)
end
local txt = ''

View File

@ -37,7 +37,7 @@ function derpibooru:action(msg, config)
end
utilities.send_typing(self, msg.chat.id, 'upload_photo')
local file = download_to_file(url)
utilities.send_photo(self, msg.chat.id, file, source)
utilities.send_photo(self, msg.chat.id, file, source, msg.message_id)
end
return derpibooru

View File

@ -43,7 +43,7 @@ function derpibooru_nsfw:action(msg, config)
end
utilities.send_typing(self, msg.chat.id, 'upload_photo')
local file = download_to_file(url)
utilities.send_photo(self, msg.chat.id, file, source)
utilities.send_photo(self, msg.chat.id, file, source, msg.message_id)
end
return derpibooru_nsfw

View File

@ -34,7 +34,7 @@ function e621:action(msg, config)
end
utilities.send_typing(self, msg.chat.id, 'upload_photo')
local file = download_to_file(url)
utilities.send_photo(self, msg.chat.id, file, url)
utilities.send_photo(self, msg.chat.id, file, url, msg.message_id)
end
return e621

26
miku/plugins/get_data.lua Normal file
View File

@ -0,0 +1,26 @@
local get_data = {}
function get_data:init(config)
get_data.triggers = utilities.triggers(self.info.username, config.cmd_pat):t('wget', true).table
get_data.doc = '\n*/wget* _<URL>_'
end
get_data.command = 'me'
function get_data:action(msg, config)
local input = utilities.input_from_msg(msg)
if not input then
utilities.send_reply(self, msg, get_data.doc, true)
return
end
utilities.send_typing(self, msg.chat.id, 'upload_document')
local file = download_to_file(input)
if not file then
utilities.send_reply(self, msg, config.errors.connection)
return
end
utilities.send_document(self, msg.chat.id, file, nil, msg.message_id)
end
return get_data

View File

@ -26,7 +26,7 @@ function gifeye:action(msg, config, matches)
else
source = nil
end
utilities.send_document(self, msg.chat.id, file, source)
utilities.send_document(self, msg.chat.id, file, source, msg.message_id)
end
return gifeye

View File

@ -34,7 +34,7 @@ function konachan:action(msg, config)
end
utilities.send_typing(self, msg.chat.id, 'upload_photo')
local file = download_to_file(url)
utilities.send_photo(self, msg.chat.id, file)
utilities.send_photo(self, msg.chat.id, file, nil, msg.message_id)
utilities.send_reply(self, msg, url)
end

View File

@ -34,7 +34,7 @@ function konachan_nsfw:action(msg, config)
end
utilities.send_typing(self, msg.chat.id, 'upload_photo')
local file = download_to_file(url)
utilities.send_photo(self, msg.chat.id, file)
utilities.send_photo(self, msg.chat.id, file, nil, msg.message_id)
utilities.send_reply(self, msg, url)
end

View File

@ -35,7 +35,7 @@ function moe:action(msg, config, matches)
return
end
local file = download_to_file(photo_url)
utilities.send_photo(self, msg.chat.id, file)
utilities.send_photo(self, msg.chat.id, file, nil, msg.message_id)
end
return moe

View File

@ -16,7 +16,7 @@ function porndoge:action(msg, config)
utilities.send_reply(self, msg, config.errors.connection)
return
end
utilities.send_photo(self, msg.chat.id, file)
utilities.send_photo(self, msg.chat.id, file, nil, msg.message_id)
end
return porndoge

View File

@ -26,7 +26,7 @@ function pornhub:action(msg, config, matches)
else
source = nil
end
utilities.send_document(self, msg.chat.id, file, source)
utilities.send_document(self, msg.chat.id, file, source, msg.message_id)
end
return pornhub

View File

@ -34,9 +34,9 @@ function pr0gramm:action(msg, config, matches)
utilities.send_typing(self, msg.chat.id, 'upload_photo')
local file = download_to_file(url)
if string.match(url, ".gif") or string.match(url, ".zip") or string.match(url, ".webm") or string.match(url, ".mp4") then
utilities.send_document(self, msg.chat.id, file)
utilities.send_document(self, msg.chat.id, file, nil, msg.message_id)
else
utilities.send_photo(self, msg.chat.id, file)
utilities.send_photo(self, msg.chat.id, file, nil, msg.message_id)
end
end

View File

@ -52,9 +52,9 @@ function rule34:action(msg, config, matches)
utilities.send_typing(self, msg.chat.id, 'upload_photo')
local file = download_to_file(img_url)
if string.ends(img_url, ".gif") then
utilities.send_document(self, msg.chat.id, file)
utilities.send_document(self, msg.chat.id, file, nil, msg.message_id)
else
utilities.send_photo(self, msg.chat.id, file)
utilities.send_photo(self, msg.chat.id, file, nil, msg.message_id)
end
else
@ -70,9 +70,9 @@ function rule34:action(msg, config, matches)
utilities.send_typing(self, msg.chat.id, 'upload_photo')
local file = download_to_file(url)
if string.ends(url, ".gif") then
utilities.send_document(self, msg.chat.id, file, id)
utilities.send_document(self, msg.chat.id, file, id, msg.message_id)
else
utilities.send_photo(self, msg.chat.id, file, id)
utilities.send_photo(self, msg.chat.id, file, id, msg.message_id)
end
end

View File

@ -42,9 +42,9 @@ function sankakucomplex:action(msg, config)
utilities.send_typing(self, msg.chat.id, 'upload_photo')
local file = download_to_file(url)
if string.match(url, ".gif") or string.match(url, ".zip") or string.match(url, ".webm") or string.match(url, ".mp4") then
utilities.send_document(self, msg.chat.id, file)
utilities.send_document(self, msg.chat.id, file, nil, msg.message_id)
else
utilities.send_photo(self, msg.chat.id, file)
utilities.send_photo(self, msg.chat.id, file, nil, msg.message_id)
end
utilities.send_reply(self, msg, url)
end

View File

@ -12,7 +12,6 @@ function yandere:get_post(tag)
local BASE_URL = 'https://yande.re'
local url = BASE_URL..'/post.json?tags='..tag
local b,c = https.request(url)
print(url)
if c ~= 200 then return nil end
local yan = json.decode(b)
if not yan[1] then return nil end
@ -37,7 +36,7 @@ function yandere:action(msg, config)
end
utilities.send_typing(self, msg.chat.id, 'upload_photo')
local file = download_to_file(url)
utilities.send_photo(self, msg.chat.id, file)
utilities.send_photo(self, msg.chat.id, file, nil, msg.message_id)
utilities.send_reply(self, msg, url)
end

View File

@ -20,7 +20,7 @@ function z0r:action(msg, config, matches)
utilities.send_reply(self, msg, config.errors.connection)
return
end
utilities.send_document(self, msg.chat.id, file)
utilities.send_document(self, msg.chat.id, file, nil, msg.message_id)
end
return z0r