1
0
mirror of https://github.com/anope/anope.git synced 2026-07-02 09:06:38 +02:00

Allow syntax messages to take a predicate.

This commit is contained in:
Sadie Powell
2025-04-19 16:43:21 +01:00
parent 18dfa62626
commit 70bf013ef0
7 changed files with 73 additions and 60 deletions
+11 -17
View File
@@ -312,6 +312,7 @@ public:
CommandNSGList(Module *creator) : Command(creator, "nickserv/glist", 0, 1)
{
this->SetDesc(_("Lists all nicknames in your group"));
this->SetSyntax(_("[\037nickname\037]"), [](auto &source) { return source.IsServicesOper(); });
}
void Execute(CommandSource &source, const std::vector<Anope::string> &params) override
@@ -372,29 +373,22 @@ public:
bool OnHelp(CommandSource &source, const Anope::string &subcommand) override
{
this->SendSyntax(source);
if (source.IsServicesOper())
{
source.Reply(_(
"Syntax: \002%s [\037nickname\037]\002"
"\n\n"
"Without a parameter, lists all nicknames that are in "
"your group."
"\n\n"
"With a parameter, lists all nicknames that are in the "
"group of the given nick."
"\n\n"
"Specifying a nick is limited to \002Services Operators\002."
),
source.command.c_str());
"Without a parameter, lists all nicknames that are in "
"your group."
"\n\n"
"With a parameter, lists all nicknames that are in the "
"group of the given nick."
"\n\n"
"Specifying a nick is limited to \002Services Operators\002."
));
}
else
{
source.Reply(_(
"Syntax: \002%s\002"
"\n\n"
"Lists all nicks in your group."
),
source.command.c_str());
source.Reply(_("Lists all nicks in your group."));
}
return true;