]> PatchyGit - patchyircd.git/commitdiff
spam.lua: fix iteration
authorEgor <egor@patchysicp.xyz>
Sat, 17 Aug 2024 23:11:08 +0000 (02:11 +0300)
committerEgor <egor@patchysicp.xyz>
Sat, 17 Aug 2024 23:11:08 +0000 (02:11 +0300)
lua/spam.lua

index 07a757f..0f4adb7 100644 (file)
@@ -13,7 +13,7 @@ hook_add("sendtochannel", "spam_simple_filter", function(hook, cl1, cl2, chan, t
                return 0
        end
        txt = ascii(txt)
-       for k, _ in simple_filters do
+       for k, _ in pairs(simple_filters) do
                if txt:find(k, 1, true) then
                        return -1
                end
@@ -25,7 +25,7 @@ hook_add("sendtoclient", "spam_simple_pm_filter", function(hook, cl1, cl2, chan,
                return 0
        end
        txt = ascii(txt)
-       for k, _ in simple_filters do
+       for k, _ in pairs(simple_filters) do
                if txt:find(k, 1, true) then
                        return -1
                end