From 3cddc0a122b6daf605729b21e4a27c717d71fdf9 Mon Sep 17 00:00:00 2001 From: Akamaru Date: Wed, 17 Aug 2016 21:40:13 +0200 Subject: [PATCH 1/2] =?UTF-8?q?Fix=20f=C3=BCr=20Plex?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- miku/plugins/plex.lua | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/miku/plugins/plex.lua b/miku/plugins/plex.lua index e967011..03bde3c 100644 --- a/miku/plugins/plex.lua +++ b/miku/plugins/plex.lua @@ -141,14 +141,13 @@ function plex:action(msg, config) utilities.send_reply(self, msg, config.errors.connection) return end - local receiver = msg.chat.id if pic then utilities.send_typing(self, receiver, 'upload_photo') - local file = download_to_file(pic) - utilities.send_photo(self, receiver, file) + local file = download_to_file(pic, 'plex.png') + utilities.send_photo(self, msg.chat.id, file) end - utilities.send_reply(self, receiver, text) + utilities.send_reply(self, msg, text) end -return plex \ No newline at end of file +return plex From 4b3ec8e72b0fc9738796fca30d2c60b5368244fa Mon Sep 17 00:00:00 2001 From: Akamaru Date: Wed, 17 Aug 2016 21:59:58 +0200 Subject: [PATCH 2/2] =?UTF-8?q?Markdown=20f=C3=BCr=20Plex?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- miku/plugins/plex.lua | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/miku/plugins/plex.lua b/miku/plugins/plex.lua index 03bde3c..e8e353f 100644 --- a/miku/plugins/plex.lua +++ b/miku/plugins/plex.lua @@ -37,11 +37,11 @@ function plex:get_plex(query) if not ok then return 'NOTOK' end local data = json.decode(table.concat(response_body))._children[1] - local title = data.title + local title = ''..data.title..'' if not title then return nil end if data.tagline then - tag = '\n"'..data.tagline..'"' + tag = ' - '..data.tagline..'' else tag = '' end @@ -65,21 +65,21 @@ function plex:get_plex(query) end if data.originalTitle then - origtitle = '\nOriginal: '..data.originalTitle + origtitle = '\nOriginal: '..data.originalTitle else origtitle = '' end if data.studio then - studio = '\nStudio: '..data.studio + studio = '\nStudio: '..data.studio else studio = '' end if data.originallyAvailableAt then - date = '\nAusstrahlung: '..makeOurDate(data.originallyAvailableAt) + date = '\nAusstrahlung: '..makeOurDate(data.originallyAvailableAt) elseif data.year then - date = '\nAusstrahlung: '..data.year + date = '\nAusstrahlung: '..data.year else date = '' end @@ -91,26 +91,26 @@ function plex:get_plex(query) end if data.contentRating then - fsk = '\nAltersfreigabe: '..gerRating(data.contentRating) + fsk = '\nAltersfreigabe: '..gerRating(data.contentRating) else fsk = '' end if data.duration then local totalseconds = math.floor(data.duration / 1000) - duration = '\nLänge: '..makeHumanTime(totalseconds) + duration = '\nLänge: '..makeHumanTime(totalseconds) else duration = '' end if data.rating then - rating = '\nBewertung: '..data.rating + rating = '\nBewertung: '..data.rating else rating = '' end if data.summary then - desc = '\n\n'..string.sub(unescape(data.summary:gsub("%b<>", "")), 1, DESC_LENTH)..'...' + desc = '\n\n'..string.sub(unescape(data.summary:gsub("%b<>", "")), 1, DESC_LENTH)..'...' else desc = '' end @@ -147,7 +147,7 @@ function plex:action(msg, config) local file = download_to_file(pic, 'plex.png') utilities.send_photo(self, msg.chat.id, file) end - utilities.send_reply(self, msg, text) + utilities.send_reply(self, msg, text, 'HTML') end return plex