diff options
| author | Sadie Powell <sadie@witchery.services> | 2025-04-16 01:46:52 +0100 |
|---|---|---|
| committer | Sadie Powell <sadie@witchery.services> | 2025-04-16 01:50:59 +0100 |
| commit | 74e9a9d2feb3690dc06a310e0477cd6f17e25fab (patch) | |
| tree | bfde58ac0c6babff941b29459b92e89c22cb9d76 /modules/chanserv | |
| parent | d2aee394ea5bc91b132001fb5bf2457eec295432 (diff) | |
Automatically wrap the help output.
Diffstat (limited to 'modules/chanserv')
| -rw-r--r-- | modules/chanserv/cs_set.cpp | 6 | ||||
| -rw-r--r-- | modules/chanserv/cs_set_misc.cpp | 4 |
2 files changed, 7 insertions, 3 deletions
diff --git a/modules/chanserv/cs_set.cpp b/modules/chanserv/cs_set.cpp index d4325bd8a..d5b7994de 100644 --- a/modules/chanserv/cs_set.cpp +++ b/modules/chanserv/cs_set.cpp @@ -39,6 +39,8 @@ public: Anope::string this_name = source.command; bool hide_privileged_commands = Config->GetBlock("options").Get<bool>("hideprivilegedcommands"), hide_registered_commands = Config->GetBlock("options").Get<bool>("hideregisteredcommands"); + + HelpWrapper help; for (const auto &[c_name, info] : source.service->commands) { if (c_name.find_ci(this_name + " ") == 0) @@ -57,9 +59,11 @@ public: continue; source.command = c_name; - c->OnServHelp(source); + c->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()); return true; diff --git a/modules/chanserv/cs_set_misc.cpp b/modules/chanserv/cs_set_misc.cpp index 71afbe942..58650f557 100644 --- a/modules/chanserv/cs_set_misc.cpp +++ b/modules/chanserv/cs_set_misc.cpp @@ -157,12 +157,12 @@ public: } } - void OnServHelp(CommandSource &source) override + void OnServHelp(CommandSource &source, HelpWrapper &help) override { if (descriptions.count(source.command)) { this->SetDesc(descriptions[source.command]); - Command::OnServHelp(source); + Command::OnServHelp(source, help); } } |
