From f81e1fe9c2e29a8bc9ee909764a44e435296bdc7 Mon Sep 17 00:00:00 2001 From: Akamaru Date: Mon, 26 Jun 2017 16:02:11 +0200 Subject: [PATCH] AppStore Plugin: Bild als Thumbnail Brawlbot Commit: https://github.com/Brawl345/Brawlbot-v2/commit/f5085151eb807291bec8adb96942f0d152a5326d#diff-74d2e3c42166db7c9efc5e50e56b3326 --- miku/plugins/app_store.lua | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/miku/plugins/app_store.lua b/miku/plugins/app_store.lua index b0c8593..a7c5df0 100644 --- a/miku/plugins/app_store.lua +++ b/miku/plugins/app_store.lua @@ -67,12 +67,6 @@ function app_store:send_appstore_data(data) ratings = "" end - - local header = ''..name..' v'..version..' von '..author..' ('..price..'):' - local body = '\n'..description..'\nBenötigt mind. iOS '..min_ios_ver..'\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 = ''..name..' v'..version..' von '..author..' ('..price..'): ' + else + header = ''..name..' v'..version..' von '..author..' ('..price..'):' + end + local body = '\n'..description..'\nBenötigt mind. iOS '..min_ios_ver..'\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, 'App nicht gefunden!', '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 \ No newline at end of file