This repository has been archived on 2021-04-24. You can view files and clone it, but cannot push or open issues or pull requests.
Mikubot/plugins/rechner.lua
2015-04-14 22:20:26 +02:00

14 lines
326 B
Lua

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
}