]> git.lizzy.rs Git - furrybot.git/commitdiff
Add uwu command
authorElias Fleckenstein <eliasfleckenstein@web.de>
Mon, 13 Sep 2021 12:37:09 +0000 (14:37 +0200)
committerElias Fleckenstein <eliasfleckenstein@web.de>
Mon, 13 Sep 2021 12:37:09 +0000 (14:37 +0200)
bot.lua
random.lua

diff --git a/bot.lua b/bot.lua
index dc35b657804fbf290f969e3e29abd51bfa704b9f..c92e8f97c56e8f88cadd0f3904090b226c1a4b4c 100644 (file)
--- a/bot.lua
+++ b/bot.lua
@@ -58,9 +58,12 @@ function furrybot.reload()
        if func then
                local old_fb = table.copy(furrybot)
                local status, init = pcall(func)
+
                if status then
-                       init(http, env, storage)
-               else
+                       status, init = init(http, env, storage)
+               end
+
+               if not status then
                        furrybot = old_fb
                        return false, furrybot.colors.error .. "Error: " .. furrybot.colors.detail .. init
                end
@@ -195,20 +198,26 @@ end
 function furrybot.commands.cmd()
 end
 
--- send load message
-furrybot.send("FurryBot - " .. C("#170089") .. "https://github.com/EliasFleckenstein03/furrybot", furrybot.colors.system)
-
-if furrybot.loaded then
-       furrybot.send("Reloaded", furrybot.colors.system)
-else
-       furrybot.loaded = true
-end
-
 return function(_http, _env, _storage)
        http, env, storage = _http, _env, _storage
 
        for _, f in ipairs {"nsfw", "roleplay", "death", "economy", "random", "http"} do
-               print(f)
-               env.loadfile("clientmods/furrybot/" .. f .. ".lua")()(http, env, storage)
+               local func, err = env.loadfile("clientmods/furrybot/" .. f .. ".lua")
+
+               if not func then
+                       return false, err
+               end
+
+               func()(http, env, storage)
        end
+
+       furrybot.send("FurryBot - " .. C("#170089") .. "https://github.com/EliasFleckenstein03/furrybot", furrybot.colors.system)
+
+       if furrybot.loaded then
+               furrybot.send("Reloaded", furrybot.colors.system)
+       else
+               furrybot.loaded = true
+       end
+
+       return true
 end
index d095746dc5351e0c6358a0a07f81eb71c2340400..c03418dce4a65fa6ce1cbe1223ecf8b9df5c353f 100644 (file)
@@ -18,6 +18,35 @@ function furrybot.commands.choose(name, ...)
        end
 end
 
+function furrybot.commands.uwu()
+       local msg = ""
+
+       local m = math.random(10)
+
+       for i = 1, m do
+               local u_list = {"u", "ü", "o", "ö"}
+
+               local u = u_list[math.random(#u_list)]
+               local w = "w"
+
+               if math.random() < 0.5 then
+                       u = u:upper()
+               end
+
+               if math.random() < 0.5 then
+                       w = w:upper()
+               end
+
+               msg = msg .. u .. w .. u
+
+               if i ~= m then
+                       msg = msg .. " "
+               end
+       end
+
+       furrybot.send(msg, furrybot.colors.system)
+end
+
 return function(_http, _env, _storage)
        http, env, storage = _http, _env, _storage
 end