- 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 if url ~= nil then
local file = download_to_file(url) 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 return
else else
utilities.send_reply(self, msg, 'Nichts gefunden :(') 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') utilities.send_typing(self, msg.chat.id, 'upload_photo')
local file = download_to_file(url) local file = download_to_file(url)
if string.ends(url, ".gif") or string.ends(url, ".zip") or string.ends(url, ".webm") then 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 else
utilities.send_photo(self, msg.chat.id, file) utilities.send_photo(self, msg.chat.id, file, nil, msg.message_id)
end end
return return
end end
@ -84,9 +84,9 @@ function danbooru:action(msg, config, matches)
utilities.send_typing(self, msg.chat.id, 'upload_photo') utilities.send_typing(self, msg.chat.id, 'upload_photo')
local img = download_to_file(download_url) 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 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 else
utilities.send_photo(self, msg.chat.id, img) utilities.send_photo(self, msg.chat.id, img, nil, msg.message_id)
end end
local txt = '' local txt = ''

View File

@ -37,7 +37,7 @@ function derpibooru:action(msg, config)
end end
utilities.send_typing(self, msg.chat.id, 'upload_photo') utilities.send_typing(self, msg.chat.id, 'upload_photo')
local file = download_to_file(url) 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 end
return derpibooru return derpibooru

View File

@ -43,7 +43,7 @@ function derpibooru_nsfw:action(msg, config)
end end
utilities.send_typing(self, msg.chat.id, 'upload_photo') utilities.send_typing(self, msg.chat.id, 'upload_photo')
local file = download_to_file(url) 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 end
return derpibooru_nsfw return derpibooru_nsfw

View File

@ -34,7 +34,7 @@ function e621:action(msg, config)
end end
utilities.send_typing(self, msg.chat.id, 'upload_photo') utilities.send_typing(self, msg.chat.id, 'upload_photo')
local file = download_to_file(url) 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 end
return e621 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 else
source = nil source = nil
end end
utilities.send_document(self, msg.chat.id, file, source) utilities.send_document(self, msg.chat.id, file, source, msg.message_id)
end end
return gifeye return gifeye

View File

@ -34,7 +34,7 @@ function konachan:action(msg, config)
end end
utilities.send_typing(self, msg.chat.id, 'upload_photo') utilities.send_typing(self, msg.chat.id, 'upload_photo')
local file = download_to_file(url) 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) utilities.send_reply(self, msg, url)
end end

View File

@ -34,7 +34,7 @@ function konachan_nsfw:action(msg, config)
end end
utilities.send_typing(self, msg.chat.id, 'upload_photo') utilities.send_typing(self, msg.chat.id, 'upload_photo')
local file = download_to_file(url) 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) utilities.send_reply(self, msg, url)
end end

View File

@ -35,7 +35,7 @@ function moe:action(msg, config, matches)
return return
end end
local file = download_to_file(photo_url) 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 end
return moe return moe

View File

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

View File

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

View File

@ -34,9 +34,9 @@ function pr0gramm:action(msg, config, matches)
utilities.send_typing(self, msg.chat.id, 'upload_photo') utilities.send_typing(self, msg.chat.id, 'upload_photo')
local file = download_to_file(url) 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 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 else
utilities.send_photo(self, msg.chat.id, file) utilities.send_photo(self, msg.chat.id, file, nil, msg.message_id)
end end
end end

View File

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

View File

@ -42,9 +42,9 @@ function sankakucomplex:action(msg, config)
utilities.send_typing(self, msg.chat.id, 'upload_photo') utilities.send_typing(self, msg.chat.id, 'upload_photo')
local file = download_to_file(url) 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 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 else
utilities.send_photo(self, msg.chat.id, file) utilities.send_photo(self, msg.chat.id, file, nil, msg.message_id)
end end
utilities.send_reply(self, msg, url) utilities.send_reply(self, msg, url)
end end

View File

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

View File

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