Update twitter.lua
Send multiple images from tweet
This commit is contained in:
parent
c7403b0ced
commit
f85d753491
@ -47,8 +47,8 @@ function run(msg, matches)
|
|||||||
|
|
||||||
-- remove images
|
-- remove images
|
||||||
local images = {}
|
local images = {}
|
||||||
if response.entities.media then
|
if response.extended_entities.media then
|
||||||
for k, v in pairs(response.entities.media) do
|
for k, v in pairs(response.extended_entities.media) do
|
||||||
local url = v.url
|
local url = v.url
|
||||||
local pic = v.media_url
|
local pic = v.media_url
|
||||||
text = text:gsub(url, "")
|
text = text:gsub(url, "")
|
||||||
@ -62,6 +62,7 @@ function run(msg, matches)
|
|||||||
for k, v in pairs(images) do
|
for k, v in pairs(images) do
|
||||||
local file = download_to_file(v)
|
local file = download_to_file(v)
|
||||||
send_photo(receiver, file, ok_cb, false)
|
send_photo(receiver, file, ok_cb, false)
|
||||||
|
delay_s(1)
|
||||||
end
|
end
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
@ -72,4 +73,4 @@ return {
|
|||||||
usage = "",
|
usage = "",
|
||||||
patterns = {"https://twitter.com/[^/]+/status/([0-9]+)"},
|
patterns = {"https://twitter.com/[^/]+/status/([0-9]+)"},
|
||||||
run = run
|
run = run
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user