From 95d599f35ef03ca2eb65833a7fbc868a5d6eb0f8 Mon Sep 17 00:00:00 2001 From: Andreas Bielawski Date: Tue, 29 Nov 2016 16:40:03 +0100 Subject: [PATCH] =?UTF-8?q?Bessere=20Ausgabe=20f=C3=BCr=20Notify?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- otouto/plugins/notify.lua | 7 ++++--- otouto/plugins/youtube.lua | 8 ++++---- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/otouto/plugins/notify.lua b/otouto/plugins/notify.lua index ac580e2..2a9643b 100644 --- a/otouto/plugins/notify.lua +++ b/otouto/plugins/notify.lua @@ -39,12 +39,13 @@ function notify:pre_process(msg) if redis:sismember('chat:'..chat_id..':users', id) then -- ignore message, if user is mentioning him/herself if id ~= tostring(msg.from.id) then - local send_date = run_command('date -d @'..msg.date..' +"%d.%m.%Y um %H:%M:%S Uhr"') + local send_date = run_command('date -d @'..msg.date..' +"%d.%m.%Y | πŸ•’ %H:%M:%S Uhr"') local send_date = string.gsub(send_date, "\n", "") local from = string.gsub(msg.from.name, "%_", " ") local chat_name = string.gsub(msg.chat.title, "%_", " ") - local text = from..' am '..send_date..' in "'..chat_name..'":\n\n'..msg.text - utilities.send_message(id, text, true) + local text = 'πŸ”” '..utilities.html_escape(from)..' hat dich erwΓ€hnt:' + local text = text..'\nπŸ‘₯ '..utilities.html_escape(chat_name)..' | πŸ“… '..send_date..'\n\n'..utilities.html_escape(msg.text) + utilities.send_message(id, text, true, false, 'HTML') end end end diff --git a/otouto/plugins/youtube.lua b/otouto/plugins/youtube.lua index aaa4aee..09570f4 100644 --- a/otouto/plugins/youtube.lua +++ b/otouto/plugins/youtube.lua @@ -98,15 +98,15 @@ function send_youtube_data(data, msg, self, link, sendpic) local upload_date = makeOurDate(data.snippet.publishedAt) local viewCount = comma_value(data.statistics.viewCount) if data.statistics.likeCount then - likeCount = ' | πŸ‘ '..comma_value(data.statistics.likeCount)..' | πŸ‘Ž ' - dislikeCount = comma_value(data.statistics.dislikeCount) + likeCount = ' | πŸ‘ '..comma_value(data.statistics.likeCount)..' |' + dislikeCount = ' πŸ‘Ž '..comma_value(data.statistics.dislikeCount)..'' else likeCount = '' dislikeCount = '' end if data.statistics.commentCount then - commentCount = ' | πŸ—£ '..comma_value(data.statistics.commentCount) + commentCount = ' | πŸ—£ '..comma_value(data.statistics.commentCount)..'' else commentCount = '' end @@ -120,7 +120,7 @@ function send_youtube_data(data, msg, self, link, sendpic) blocked = false end - text = ''..title..'\nπŸŽ₯ '..uploader..', πŸ“… '..upload_date..'\nπŸ‘ '..viewCount..' | πŸ•’ '..duration..likeCount..dislikeCount..commentCount..'\n' + text = ''..title..'\nπŸŽ₯ '..uploader..', πŸ“… '..upload_date..'\nπŸ‘ '..viewCount..' | πŸ•’ '..duration..''..likeCount..dislikeCount..commentCount..'\n' if link then text = link..'\n'..text end