InlineKeyboard für Facebook Videos
This commit is contained in:
parent
4ceee84c21
commit
62cc87d878
@ -93,12 +93,7 @@ function facebook:send_facebook_video(video_id)
|
|||||||
local from = '*'..data.from.name..'*'
|
local from = '*'..data.from.name..'*'
|
||||||
local description = data.description
|
local description = data.description
|
||||||
local source = data.source
|
local source = data.source
|
||||||
if data.title then
|
return from..' hat ein Video gepostet:\n'..description, source, data.title
|
||||||
text = from..' hat ein Video gepostet:\n'..description..'\n['..data.title..']('..source..')'
|
|
||||||
else
|
|
||||||
text = from..' hat ein Video gepostet:\n'..description..'\n'..utilities.md_escape(source)
|
|
||||||
end
|
|
||||||
return text
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function facebook:facebook_info(name)
|
function facebook:facebook_info(name)
|
||||||
@ -169,8 +164,14 @@ function facebook:action(msg, config, matches)
|
|||||||
else
|
else
|
||||||
video_id = matches[3]
|
video_id = matches[3]
|
||||||
end
|
end
|
||||||
local output = facebook:send_facebook_video(video_id)
|
local output, video_url, title = facebook:send_facebook_video(video_id)
|
||||||
utilities.send_reply(self, msg, output, true)
|
if not title then
|
||||||
|
title = 'Video aufrufen'
|
||||||
|
else
|
||||||
|
title = 'VIDEO: '..title
|
||||||
|
end
|
||||||
|
if not video_url then return end
|
||||||
|
utilities.send_reply(self, msg, output, true, '{"inline_keyboard":[[{"text":"'..utilities.md_escape(title)..'","url":"'..video_url..'"}]]}')
|
||||||
return
|
return
|
||||||
else
|
else
|
||||||
utilities.send_reply(self, msg, facebook:facebook_info(matches[1]), true)
|
utilities.send_reply(self, msg, facebook:facebook_info(matches[1]), true)
|
||||||
|
Reference in New Issue
Block a user