Kleine Fixes
This commit is contained in:
parent
132a637e60
commit
8c5d23a292
1
.gitignore
vendored
1
.gitignore
vendored
@ -10,3 +10,4 @@ miku/plugins/link_warning.lua
|
|||||||
luarocks
|
luarocks
|
||||||
miku/plugins/gTrendDoge.lua
|
miku/plugins/gTrendDoge.lua
|
||||||
miku/plugins/xrel_search.lua
|
miku/plugins/xrel_search.lua
|
||||||
|
reversed.mp4
|
@ -5,7 +5,7 @@ preview.command = 'preview <link>'
|
|||||||
function preview:init(config)
|
function preview:init(config)
|
||||||
preview.triggers = utilities.triggers(self.info.username, config.cmd_pat):t('preview', true).table
|
preview.triggers = utilities.triggers(self.info.username, config.cmd_pat):t('preview', true).table
|
||||||
preview.inline_triggers = {
|
preview.inline_triggers = {
|
||||||
"^pr (https?://[%w-_%.%?%.,:;/%+=&%~%%#]+)$"
|
"^[Pp][Rr] (https?://[%w-_%.%?%.,:;/%+=&%~%%#]+)$"
|
||||||
}
|
}
|
||||||
preview.doc = [[*
|
preview.doc = [[*
|
||||||
]]..config.cmd_pat..[[preview* _<URL>_
|
]]..config.cmd_pat..[[preview* _<URL>_
|
||||||
|
@ -20,7 +20,6 @@ function shell:transeng(ger)
|
|||||||
local ger = string.gsub(ger, "Friday", "Freitag")
|
local ger = string.gsub(ger, "Friday", "Freitag")
|
||||||
local ger = string.gsub(ger, "Saturday", "Samstag")
|
local ger = string.gsub(ger, "Saturday", "Samstag")
|
||||||
local ger = string.gsub(ger, "Sunday", "Sonntag")
|
local ger = string.gsub(ger, "Sunday", "Sonntag")
|
||||||
|
|
||||||
--Weeks
|
--Weeks
|
||||||
local ger = string.gsub(ger, 'week,', 'Woche,')
|
local ger = string.gsub(ger, 'week,', 'Woche,')
|
||||||
local ger = string.gsub(ger, 'weeks,', 'Wochen,')
|
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, 'hours,', 'Stunden und')
|
||||||
local ger = string.gsub(ger, 'minute$', 'Minute.')
|
local ger = string.gsub(ger, 'minute$', 'Minute.')
|
||||||
local ger = string.gsub(ger, 'minutes', 'Minuten.')
|
local ger = string.gsub(ger, 'minutes', 'Minuten.')
|
||||||
|
|
||||||
--Months
|
--Months
|
||||||
local ger = string.gsub(ger, "January", "Januar")
|
local ger = string.gsub(ger, "January", "Januar")
|
||||||
local ger = string.gsub(ger, "February", "Februar")
|
local ger = string.gsub(ger, "February", "Februar")
|
||||||
@ -60,6 +58,7 @@ function shell:action(msg, config, matches)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local input = matches[1]
|
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
|
if msg.text:match('^/[Uu][Pp][Tt][Ii][Mm][Ee]$') then
|
||||||
local cmd = run_command('uptime -s && uptime -p')
|
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)
|
-- Requires scrot (sudo apt-get install scrot)
|
||||||
if msg.text:match('^/[Ss][Cc][Rr][Ee][Ee][Nn]$') then
|
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 '/tmp/scrot.png'")
|
||||||
run_command("scrot 'scrot.png' -e 'mv $f /tmp/'")
|
|
||||||
local text = '#Screenshot vom '..shell:transeng(taken_time)
|
local text = '#Screenshot vom '..shell:transeng(taken_time)
|
||||||
utilities.send_photo(msg.chat.id, '/tmp/scrot.png', text, msg.message_id)
|
utilities.send_photo(msg.chat.id, '/tmp/scrot.png', text, msg.message_id)
|
||||||
return
|
return
|
||||||
@ -81,13 +79,14 @@ function shell:action(msg, config, matches)
|
|||||||
-- Requires fswebcam (sudo apt-get install fswebcam)
|
-- Requires fswebcam (sudo apt-get install fswebcam)
|
||||||
if msg.text:match('^/[Ww][Ee][Bb][Cc][Aa][Mm]$') then
|
if msg.text:match('^/[Ww][Ee][Bb][Cc][Aa][Mm]$') then
|
||||||
run_command("fswebcam -r 1280x1024 --png 9 -D 1 /tmp/webcam.png")
|
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
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
if msg.text:match('^/[Cc][Hh][Ee][Cc][Kk]$') then
|
if msg.text:match('^/[Cc][Hh][Ee][Cc][Kk]$') then
|
||||||
local cmd = run_command("apt --just-print upgrade")
|
local cmd = run_command("apt --just-print upgrade")
|
||||||
local text = 'Es gibt <b>'..string.match(cmd, '(%d+) aktualisiert')..'</b> Updates'
|
local text = 'Es gibt <b>'..string.match(cmd, '(%d+) aktualisiert')..'</b> Updates.'
|
||||||
utilities.send_reply(msg, text, 'HTML')
|
utilities.send_reply(msg, text, 'HTML')
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user