]> git.lizzy.rs Git - furrybot.git/blobdiff - economy.lua
Japanese waifu names
[furrybot.git] / economy.lua
index 28c91715961c83851355d04c8b57d4515ad73072..e27572b70f30ba6a281e08c7d9ef1b95f3547abc 100644 (file)
@@ -34,28 +34,31 @@ function furrybot.money(money, color)
        return furrybot.colors.money .. "$" .. money .. color
 end
 
-function furrybot.commands.money(name, target)
-       target = target or name
-       furrybot.ping_message(name, (target == name and "You have " or target .. " has ") .. furrybot.money(furrybot.get_money(target), furrybot.colors.system) .. ".", furrybot.colors.system)
-end
-furrybot.commands.balance = furrybot.commands.money
-
-function furrybot.commands.pay(name, target, number)
-       if furrybot.online_or_error(name, target) then
-               local money = tonumber(number or "")
-               if not money or money <= 0 or math.floor(money) ~= money then
-                       furrybot.error_message(name, "Invalid amount of money")
-               else
-                       if furrybot.take_money(name, money) then
-                               furrybot.add_money(target, money)
-                               furrybot.ping_message(target, name .. " has payed you " .. furrybot.money(money, furrybot.colors.system) .. ".", furrybot.colors.system)
+furrybot.commands.money = {
+       func = function(name, target)
+               target = target or name
+               furrybot.ping_message(name, (target == name and "You have " or target .. " has ") .. furrybot.money(furrybot.get_money(target), furrybot.colors.system) .. ".", furrybot.colors.system)
+       end,
+}
+
+furrybot.commands.pay = {
+       unsafe = true,
+       func = function(name, target, number)
+               if furrybot.online_or_error(name, target) then
+                       local money = tonumber(number or "")
+                       if not money or money <= 0 or math.floor(money) ~= money then
+                               furrybot.error_message(name, "Invalid amount of money")
                        else
-                               furrybot.error_message(name, "You don't have enough money")
+                               if furrybot.take_money(name, money) then
+                                       furrybot.add_money(target, money)
+                                       furrybot.ping_message(target, name .. " has payed you " .. furrybot.money(money, furrybot.colors.system) .. ".", furrybot.colors.system)
+                               else
+                                       furrybot.error_message(name, "You don't have enough money")
+                               end
                        end
                end
-       end
-end
-furrybot.unsafe_commands.pay = true
+       end,
+}
 
 return function(_http, _env, _storage)
        http, env, storage = _http, _env, _storage