1
0
mirror of https://github.com/anope/anope.git synced 2026-06-12 17:24:49 +02:00

Add examples to the greet module and improve the help output.

This commit is contained in:
Sadie Powell
2026-03-17 00:45:10 +00:00
parent 074ad6556c
commit c22f7a9038
+27 -10
View File
@@ -88,7 +88,7 @@ public:
CommandNSSetGreet(Module *creator, const Anope::string &sname = "nickserv/set/greet", size_t min = 0) : Command(creator, sname, min, min + 1) CommandNSSetGreet(Module *creator, const Anope::string &sname = "nickserv/set/greet", size_t min = 0) : Command(creator, sname, min, min + 1)
{ {
this->SetDesc(_("Associate a greet message with your nickname")); this->SetDesc(_("Associate a greet message with your nickname"));
this->SetSyntax(_("\037message\037")); this->SetSyntax(_("[\037message\037]"));
} }
void Run(CommandSource &source, const Anope::string &user, const Anope::string &param) void Run(CommandSource &source, const Anope::string &user, const Anope::string &param)
@@ -136,11 +136,19 @@ public:
this->SendSyntax(source); this->SendSyntax(source);
source.Reply(" "); source.Reply(" ");
source.Reply(_( source.Reply(_(
"Makes the given message the greet of your nickname, that " "Changes your greet message. This message will be displayed when joining a channel "
"will be displayed when joining a channel that has GREET " "that has GREET option enabled, provided that you have the necessary access on it."
"option enabled, provided that you have the necessary "
"access on it."
)); ));
ExampleWrapper()
.AddEntry(_("I come in peace"), _(
"Changes your greet message to \035I come in peace\035."
))
.AddEntry("", _(
"Removes your greet message."
))
.SendTo(source);
return true; return true;
} }
}; };
@@ -152,7 +160,7 @@ public:
CommandNSSASetGreet(Module *creator) : CommandNSSetGreet(creator, "nickserv/saset/greet", 1) CommandNSSASetGreet(Module *creator) : CommandNSSetGreet(creator, "nickserv/saset/greet", 1)
{ {
this->ClearSyntax(); this->ClearSyntax();
this->SetSyntax(_("\037nickname\037 \037message\037")); this->SetSyntax(_("\037nickname\037 [\037message\037]"));
} }
void Execute(CommandSource &source, const std::vector<Anope::string> &params) override void Execute(CommandSource &source, const std::vector<Anope::string> &params) override
@@ -165,11 +173,20 @@ public:
this->SendSyntax(source); this->SendSyntax(source);
source.Reply(" "); source.Reply(" ");
source.Reply(_( source.Reply(_(
"Makes the given message the greet of the nickname, that " "Changes the greet message of the specified nickname. This message will be displayed "
"will be displayed when joining a channel that has GREET " "when joining a channel that has GREET option enabled, provided that the user has the "
"option enabled, provided that the user has the necessary " "necessary access on it."
"access on it."
)); ));
ExampleWrapper()
.AddEntry(_("alien I come in peace"), _(
"Changes the greet message of \035alien\035 to \035I come in peace\035."
))
.AddEntry("zebra", _(
"Removes the greet message of \035zebra\035."
))
.SendTo(source);
return true; return true;
} }
}; };