Bessere Ausgabe für Notify

This commit is contained in:
Andreas Bielawski 2016-11-29 16:40:03 +01:00
parent 30ba1e886e
commit 95d599f35e
2 changed files with 8 additions and 7 deletions

View File

@ -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..' +"<i>%d.%m.%Y</i> | 🕒 <i>%H:%M:%S Uhr</i>"')
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 = '🔔 <b>'..utilities.html_escape(from)..'</b> hat dich erwähnt:'
local text = text..'\n👥 <b>'..utilities.html_escape(chat_name)..'</b> | 📅 '..send_date..'\n\n'..utilities.html_escape(msg.text)
utilities.send_message(id, text, true, false, 'HTML')
end
end
end

View File

@ -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 = ' | 👍 <i>'..comma_value(data.statistics.likeCount)..'</i> |'
dislikeCount = ' 👎 <i>'..comma_value(data.statistics.dislikeCount)..'</i>'
else
likeCount = ''
dislikeCount = ''
end
if data.statistics.commentCount then
commentCount = ' | 🗣 '..comma_value(data.statistics.commentCount)
commentCount = ' | 🗣 <i>'..comma_value(data.statistics.commentCount)..'</i>'
else
commentCount = ''
end
@ -120,7 +120,7 @@ function send_youtube_data(data, msg, self, link, sendpic)
blocked = false
end
text = '<b>'..title..'</b>\n🎥 <b>'..uploader..'</b>, 📅 '..upload_date..'\n👁 '..viewCount..' | 🕒 '..duration..likeCount..dislikeCount..commentCount..'\n'
text = '<b>'..title..'</b>\n🎥 <b>'..uploader..'</b>, 📅 <i>'..upload_date..'</i>\n👁 <i>'..viewCount..'</i> | 🕒 <i>'..duration..'</i>'..likeCount..dislikeCount..commentCount..'\n'
if link then
text = link..'\n'..text
end