From: Egor Date: Sat, 17 Aug 2024 21:49:23 +0000 (+0300) Subject: init.lua add hookinfo command X-Git-Url: https://git.patchysicp.xyz/?a=commitdiff_plain;h=33a5cb5d94e1b36713736f9f488ae7d6be935501;p=patchyircd.git init.lua add hookinfo command --- diff --git a/lua/init.lua b/lua/init.lua index f1f1852..74c993d 100644 --- a/lua/init.lua +++ b/lua/init.lua @@ -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))