]> PatchyGit - patchyircd.git/commitdiff
init.lua add hookinfo command
authorEgor <egor@patchysicp.xyz>
Sat, 17 Aug 2024 21:49:23 +0000 (00:49 +0300)
committerEgor <egor@patchysicp.xyz>
Sat, 17 Aug 2024 21:49:23 +0000 (00:49 +0300)
lua/init.lua

index f1f1852..74c993d 100644 (file)
@@ -64,6 +64,16 @@ hook_add("nickchange", "clientdata_change", function(hook, cl1, cl2, chan, txt)
        client_data[cl1.key] = nil
 end)
 
+function commands.hookinfo(client, source, command, args)
+       for k1, v1 in pairs(managed_hooks) do
+               local s = k1.." ::"
+               for k2, v2 in pairs(v1.fns) do
+                       s = s.." "..k2..";"
+               end
+               client_notice(client, s)
+       end
+       client_notice(client, "done")
+end
 function commands.echo(client, source, command, args)
        client_notice(client, "client = "..tostring(client))
        client_notice(client, "source = "..tostring(source))