From 33a5cb5d94e1b36713736f9f488ae7d6be935501 Mon Sep 17 00:00:00 2001 From: Egor Date: Sun, 18 Aug 2024 00:49:23 +0300 Subject: [PATCH] init.lua add hookinfo command --- lua/init.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) 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)) -- 2.56.0