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
320 B
Lua
Raw Normal View History

2015-04-14 22:20:26 +02:00
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",
2015-04-28 17:49:11 +02:00
usage = {"/calc [Rechnung]"},
2015-04-20 18:52:25 +02:00
patterns = {"^/calc (.*)$"},
2015-04-14 22:20:26 +02:00
run = run
}