Etwas Markdown in shell.lua

This commit is contained in:
Akamaru 2016-08-22 22:11:23 +02:00
parent 8d134a4000
commit 1b438f0142

View File

@ -39,9 +39,9 @@ function shell:action(msg, config, matches)
if msg.text:match('^/[Uu][Pp][Tt][Ii][Mm][Ee]$') then
local cmd = run_command('uptime -s && uptime -p')
local text1 = 'Der PC ist seit dem '..makeOurDate(string.match(cmd, '(%d+-%d+-%d+)'))..' an.'
local text2 = shell:transeng('Das sind '..string.match(cmd, 'up (.*)'))
utilities.send_reply(self, msg, text1..'\n'..text2)
local text1 = 'Der PC ist seit dem <b>'..makeOurDate(string.match(cmd, '(%d+-%d+-%d+)'))..'</b> an.'
local text2 = shell:transeng('Das sind <b>'..string.match(cmd, 'up (.*)')..'</b>')
utilities.send_reply(self, msg, text1..'\n'..text2, 'HTML')
return
end
@ -61,8 +61,8 @@ function shell:action(msg, config, matches)
if msg.text:match('^/[Cc][Hh][Ee][Cc][Kk]$') then
local cmd = run_command("apt --just-print upgrade")
local text = 'Es gibt '..string.match(cmd, '(%d+) aktualisiert')..' Updates'
utilities.send_reply(self, msg, text)
local text = 'Es gibt <b>'..string.match(cmd, '(%d+) aktualisiert')..'</b> Updates'
utilities.send_reply(self, msg, text, 'HTML')
return
end