Added rechner plugin
This commit is contained in:
parent
0d2a782c1f
commit
4f9fd9389e
14
plugins/rechner.lua
Normal file
14
plugins/rechner.lua
Normal 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
|
||||||
|
}
|
Reference in New Issue
Block a user