AppStore Plugin: Bild als Thumbnail

Brawlbot Commit:
f5085151eb (diff-74d2e3c42166db7c9efc5e50e56b3326)
This commit is contained in:
Akamaru 2017-06-26 16:02:11 +02:00
parent ebb702cefa
commit f81e1fe9c2
1 changed files with 13 additions and 14 deletions

View File

@ -67,12 +67,6 @@ function app_store:send_appstore_data(data)
ratings = ""
end
local header = '<b>'..name..'</b> v'..version..' von <b>'..author..'</b> ('..price..'):'
local body = '\n'..description..'\n<i>Benötigt mind. iOS '..min_ios_ver..'</i>\nGröße: '..size..' MB\nErstveröffentlicht am '..release..game_center..category
local footer = '\n'..avg_rating..ratings
local text = header..body..footer
-- Picture
if data.screenshotUrls[1] and data.ipadScreenshotUrls[1] then
image_url = data.screenshotUrls[1]
@ -84,7 +78,16 @@ function app_store:send_appstore_data(data)
image_url = nil
end
return text, image_url
if image_url then
header = '<b>'..name..'</b> v'..version..' von <b>'..author..'</b> ('..price..'):<a href="'..image_url..'"> </a>'
else
header = '<b>'..name..'</b> v'..version..' von <b>'..author..'</b> ('..price..'):'
end
local body = '\n'..description..'\n<i>Benötigt mind. iOS '..min_ios_ver..'</i>\nGröße: '..size..' MB\nErstveröffentlicht am '..release..game_center..category
local footer = '\n'..avg_rating..ratings
local text = header..body..footer
return text
end
function app_store:action(msg, config, matches)
@ -99,13 +102,9 @@ function app_store:action(msg, config, matches)
utilities.send_reply(msg, '<b>App nicht gefunden!</b>', 'HTML')
return
else
local output, image_url = app_store:send_appstore_data(data)
utilities.send_reply(msg, output, 'HTML')
if image_url then
utilities.send_typing(msg.chat.id, 'upload_photo')
utilities.send_photo(msg.chat.id, image_url, nil, msg.message_id)
end
local output = app_store:send_appstore_data(data)
utilities.send_message(msg.chat.id, output, false, msg.message_id, 'HTML')
end
end
return app_store
return app_store