Added rechner plugin

This commit is contained in:
Akamaru 2015-04-14 22:20:26 +02:00
parent 0d2a782c1f
commit 4f9fd9389e

14
plugins/rechner.lua Normal file
View File

@ -0,0 +1,14 @@
function run(msg, matches)
-- Convert expression to a function and execute it
local expression = string.gsub(matches[1], "(%a+)", "math.%1")
return load('return '..expression)()
end
return {
description = "Ein simpler Taschenrechner",
usage = "/calc [Rechnung]",
patterns = {
"^/calc (.*)$"
},
run = run
}