From 74e9a9d2feb3690dc06a310e0477cd6f17e25fab Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Wed, 16 Apr 2025 01:46:52 +0100 Subject: Automatically wrap the help output. --- modules/botserv/bs_kick.cpp | 4 +++- modules/botserv/bs_set.cpp | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'modules/botserv') diff --git a/modules/botserv/bs_kick.cpp b/modules/botserv/bs_kick.cpp index 80d8fc45d..97ca62d54 100644 --- a/modules/botserv/bs_kick.cpp +++ b/modules/botserv/bs_kick.cpp @@ -139,6 +139,7 @@ public: source.Reply(" "); source.Reply(_("Configures bot kickers. \037option\037 can be one of:")); + HelpWrapper help; Anope::string this_name = source.command; for (const auto &[c_name, info] : source.service->commands) { @@ -148,10 +149,11 @@ public: if (command) { source.command = c_name; - command->OnServHelp(source); + command->OnServHelp(source, help); } } } + help.SendTo(source); source.Reply(_( "Type \002%s\032\037option\037\002 for more information " diff --git a/modules/botserv/bs_set.cpp b/modules/botserv/bs_set.cpp index 4cce07b98..a7c6ba414 100644 --- a/modules/botserv/bs_set.cpp +++ b/modules/botserv/bs_set.cpp @@ -37,6 +37,8 @@ public: )); bool hide_privileged_commands = Config->GetBlock("options").Get("hideprivilegedcommands"), hide_registered_commands = Config->GetBlock("options").Get("hideregisteredcommands"); + + HelpWrapper help; Anope::string this_name = source.command; for (const auto &[c_name, info] : source.service->commands) { @@ -56,10 +58,12 @@ public: continue; source.command = c_name; - command->OnServHelp(source); + command->OnServHelp(source, help); } } } + help.SendTo(source); + source.Reply(_("Type \002%s\032\037option\037\002 for more information on a particular option."), source.service->GetQueryCommand("generic/help", this_name).c_str()); -- cgit