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

12 lines
318 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
}