From 8c5d23a292ecff7eebeda067a9fda293559f3e84 Mon Sep 17 00:00:00 2001 From: Akamaru Date: Mon, 14 Aug 2017 23:39:44 +0200 Subject: [PATCH] Kleine Fixes --- .gitignore | 3 ++- miku/plugins/preview.lua | 2 +- miku/plugins/shell.lua | 11 +++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 185f2db..4744dbc 100644 --- a/.gitignore +++ b/.gitignore @@ -9,4 +9,5 @@ merge.sh miku/plugins/link_warning.lua luarocks miku/plugins/gTrendDoge.lua -miku/plugins/xrel_search.lua \ No newline at end of file +miku/plugins/xrel_search.lua +reversed.mp4 \ No newline at end of file diff --git a/miku/plugins/preview.lua b/miku/plugins/preview.lua index 13e5d45..ea86611 100644 --- a/miku/plugins/preview.lua +++ b/miku/plugins/preview.lua @@ -5,7 +5,7 @@ preview.command = 'preview ' function preview:init(config) preview.triggers = utilities.triggers(self.info.username, config.cmd_pat):t('preview', true).table preview.inline_triggers = { - "^pr (https?://[%w-_%.%?%.,:;/%+=&%~%%#]+)$" + "^[Pp][Rr] (https?://[%w-_%.%?%.,:;/%+=&%~%%#]+)$" } preview.doc = [[* ]]..config.cmd_pat..[[preview* __ diff --git a/miku/plugins/shell.lua b/miku/plugins/shell.lua index db415c9..63e6777 100644 --- a/miku/plugins/shell.lua +++ b/miku/plugins/shell.lua @@ -20,7 +20,6 @@ function shell:transeng(ger) local ger = string.gsub(ger, "Friday", "Freitag") local ger = string.gsub(ger, "Saturday", "Samstag") local ger = string.gsub(ger, "Sunday", "Sonntag") - --Weeks local ger = string.gsub(ger, 'week,', 'Woche,') local ger = string.gsub(ger, 'weeks,', 'Wochen,') @@ -30,7 +29,6 @@ function shell:transeng(ger) local ger = string.gsub(ger, 'hours,', 'Stunden und') local ger = string.gsub(ger, 'minute$', 'Minute.') local ger = string.gsub(ger, 'minutes', 'Minuten.') - --Months local ger = string.gsub(ger, "January", "Januar") local ger = string.gsub(ger, "February", "Februar") @@ -60,6 +58,7 @@ function shell:action(msg, config, matches) end local input = matches[1] + local taken_time = os.date("%A, %d. %B %Y um %H:%M:%S Uhr") if msg.text:match('^/[Uu][Pp][Tt][Ii][Mm][Ee]$') then local cmd = run_command('uptime -s && uptime -p') @@ -71,8 +70,7 @@ function shell:action(msg, config, matches) -- Requires scrot (sudo apt-get install scrot) if msg.text:match('^/[Ss][Cc][Rr][Ee][Ee][Nn]$') then - local taken_time = os.date("%A, %d. %B %Y um %H:%M:%S Uhr") - run_command("scrot 'scrot.png' -e 'mv $f /tmp/'") + run_command("scrot '/tmp/scrot.png'") local text = '#Screenshot vom '..shell:transeng(taken_time) utilities.send_photo(msg.chat.id, '/tmp/scrot.png', text, msg.message_id) return @@ -81,13 +79,14 @@ function shell:action(msg, config, matches) -- Requires fswebcam (sudo apt-get install fswebcam) if msg.text:match('^/[Ww][Ee][Bb][Cc][Aa][Mm]$') then run_command("fswebcam -r 1280x1024 --png 9 -D 1 /tmp/webcam.png") - utilities.send_photo(msg.chat.id, '/tmp/webcam.png', nil, msg.message_id) + local text = '#Webcam vom '..shell:transeng(taken_time) + utilities.send_photo(msg.chat.id, '/tmp/webcam.png', text, msg.message_id) return end 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' + local text = 'Es gibt '..string.match(cmd, '(%d+) aktualisiert')..' Updates.' utilities.send_reply(msg, text, 'HTML') return end