1
0
mirror of https://github.com/anope/anope.git synced 2026-07-04 16:53:16 +02:00

Expand GetQueryCommand to take a command name.

This commit is contained in:
Sadie Powell
2025-04-09 18:17:02 +01:00
parent 40d558ef21
commit 9351debd73
22 changed files with 144 additions and 97 deletions
+2 -2
View File
@@ -155,9 +155,9 @@ public:
"allow user bots. Available commands are listed\n"
"below; to use them, type \002%s \037command\037\002. For\n"
"more information on a specific command, type\n"
"\002%s %s \037command\037\002.\n"),
"\002%s \037command\037\002.\n"),
BotServ->nick.c_str(), BotServ->GetQueryCommand().c_str(),
BotServ->GetQueryCommand().c_str(), source.command.c_str());
BotServ->GetQueryCommand({}, source.command).c_str());
}
return EVENT_CONTINUE;
+3 -2
View File
@@ -438,7 +438,7 @@ public:
source.Reply(_("Maintains the \002bad words list\002 for a channel. The bad\n"
"words list determines which words are to be kicked\n"
"when the bad words kicker is enabled. For more information,\n"
"type \002%s HELP KICK %s\002.\n"
"type \002%s KICK %s\002.\n"
" \n"
"The \002ADD\002 command adds the given word to the\n"
"bad words list. If SINGLE is specified, a kick will be\n"
@@ -448,7 +448,8 @@ public:
"will be done if a user says a word that ends with\n"
"\037word\037. If you don't specify anything, a kick will\n"
"be issued every time \037word\037 is said by a user.\n"
" \n"), source.service->GetQueryCommand().c_str(), source.command.c_str());
" \n"), source.service->GetQueryCommand("generic/help").c_str(), source.command.c_str());
source.Reply(_("The \002DEL\002 command removes the given word from the\n"
"bad words list. If a list of entry numbers is given, those\n"
"entries are deleted. (See the example for LIST below.)\n"
+6 -4
View File
@@ -153,11 +153,12 @@ public:
}
}
source.Reply(_("Type \002%s HELP %s \037option\037\002 for more information\n"
source.Reply(_("Type \002%s \037option\037\002 for more information\n"
"on a specific option.\n"
" \n"
"Note: access to this command is controlled by the\n"
"level SET."), source.service->GetQueryCommand().c_str(), this_name.c_str());
"level SET."),
source.service->GetQueryCommand("generic/help", this_name).c_str());
return true;
}
@@ -308,12 +309,13 @@ public:
"option tells the bot to kick users who say certain words\n"
"on the channels.\n"
"You can define bad words for your channel using the\n"
"\002BADWORDS\002 command. Type \002%s HELP BADWORDS\002 for\n"
"\002BADWORDS\002 command. Type \002%s BADWORDS\002 for\n"
"more information.\n"
" \n"
"\037ttb\037 is the number of times a user can be kicked\n"
"before it gets banned. Don't give ttb to disable\n"
"the ban system once activated."), source.service->GetQueryCommand().c_str());
"the ban system once activated."),
source.service->GetQueryCommand("generic/help").c_str());
return true;
}
};
+3 -2
View File
@@ -58,8 +58,9 @@ public:
}
}
}
source.Reply(_("Type \002%s HELP %s \037option\037\002 for more information on a\n"
"particular option."), source.service->GetQueryCommand().c_str(), this_name.c_str());
source.Reply(_("Type \002%s \037option\037\002 for more information on a\n"
"particular option."),
source.service->GetQueryCommand("generic/help", this_name).c_str());
return true;
}
+3 -2
View File
@@ -266,8 +266,9 @@ public:
"who is allowed channel operator privileges. Available\n"
"commands are listed below; to use them, type\n"
"\002%s \037command\037\002. For more information on a\n"
"specific command, type \002%s HELP \037command\037\002.\n"),
ChanServ->nick.c_str(), ChanServ->nick.c_str(), ChanServ->GetQueryCommand().c_str(), ChanServ->GetQueryCommand().c_str());
"specific command, type \002%s \037command\037\002.\n"),
ChanServ->nick.c_str(), ChanServ->nick.c_str(),
ChanServ->GetQueryCommand().c_str(), ChanServ->GetQueryCommand("generic/help").c_str());
return EVENT_CONTINUE;
}
+9 -6
View File
@@ -625,9 +625,12 @@ public:
BotInfo *bi;
Anope::string cmd;
if (Command::FindCommandFromService("chanserv/levels", bi, cmd))
{
source.Reply(_("\002User access levels\002 can be seen by using the\n"
"\002%s\002 command; type \002%s HELP LEVELS\002 for\n"
"information."), cmd.c_str(), bi->GetQueryCommand().c_str());
"\002%s\002 command; type \002%s LEVELS\002 for\n"
"information."),
cmd.c_str(), bi->GetQueryCommand("generic/help").c_str());
}
return true;
}
};
@@ -662,8 +665,8 @@ class CommandCSLevels final
Privilege *p = PrivilegeManager::FindPrivilege(what);
if (p == NULL)
{
source.Reply(_("Setting \002%s\002 not known. Type \002%s HELP LEVELS\002 for a list of valid settings."),
what.c_str(), source.service->GetQueryCommand().c_str());
source.Reply(_("Setting \002%s\002 not known. Type \002%s LEVELS\002 for a list of valid settings."),
what.c_str(), source.service->GetQueryCommand("generic/help").c_str());
}
else
{
@@ -705,8 +708,8 @@ class CommandCSLevels final
return;
}
source.Reply(_("Setting \002%s\002 not known. Type \002%s HELP LEVELS\002 for a list of valid settings."),
what.c_str(), source.service->GetQueryCommand().c_str());
source.Reply(_("Setting \002%s\002 not known. Type \002%s LEVELS\002 for a list of valid settings."),
what.c_str(), source.service->GetQueryCommand("generic/help").c_str());
}
static void DoList(CommandSource &source, ChannelInfo *ci)
+1 -1
View File
@@ -58,7 +58,7 @@ public:
*code = Anope::Random(Config->GetBlock("options").Get<size_t>("codelength", 15));
}
source.Reply(CONFIRM_DROP, ci->name.c_str(), source.service->GetQueryCommand().c_str(),
source.Reply(CONFIRM_DROP, ci->name.c_str(), source.service->GetQueryCommand("chanserv/drop").c_str(),
ci->name.c_str(), code->c_str());
return;
}
+3 -2
View File
@@ -100,9 +100,10 @@ public:
Anope::string cmd;
if (Command::FindCommandFromService("chanserv/access", bi, cmd))
source.Reply(_(" \n"
"See the \002%s\002 command (\002%s HELP ACCESS\002) for\n"
"See the \002%s\002 command (\002%s ACCESS\002) for\n"
"information on giving a subset of these privileges to\n"
"other channel users.\n"), cmd.c_str(), bi->GetQueryCommand().c_str());
"other channel users.\n"),
cmd.c_str(), bi->GetQueryCommand("generic/help").c_str());
source.Reply(_(" \n"
"NOTICE: In order to register a channel, you must have\n"
"first registered your nickname."));
+3 -2
View File
@@ -59,8 +59,9 @@ public:
c->OnServHelp(source);
}
}
source.Reply(_("Type \002%s HELP %s \037option\037\002 for more information on a\n"
"particular option."), source.service->GetQueryCommand().c_str(), this_name.c_str());
source.Reply(_("Type \002%s \037option\037\002 for more information on a\n"
"particular option."),
source.service->GetQueryCommand("generic/help", this_name).c_str());
return true;
}
};
+4 -4
View File
@@ -590,11 +590,11 @@ public:
source.Reply(_("Alternative methods of modifying channel access lists are\n"
"available."));
if (!access_cmd.empty())
source.Reply(_("See \002%s HELP %s\002 for more information\n"
"about the access list."), access_bi->GetQueryCommand().c_str(), access_cmd.c_str());
source.Reply(_("See \002%s\002 for more information\n"
"about the access list."), access_bi->GetQueryCommand("generic/help", access_cmd).c_str());
if (!flags_cmd.empty())
source.Reply(_("See \002%s HELP %s\002 for more information\n"
"about the flags system."), flags_bi->GetQueryCommand().c_str(), flags_cmd.c_str());
source.Reply(_("See \002%s\002 for more information\n"
"about the flags system."), flags_bi->GetQueryCommand("generic/help", flags_cmd).c_str());
}
return true;
}
+8 -4
View File
@@ -101,7 +101,10 @@ public:
if (ci->AccessFor(cu->user).HasPriv("MEMO"))
{
if (cu->user->IsIdentified() && cu->user->Account()->HasExt("MEMO_RECEIVE"))
cu->user->SendMessage(MemoServ, MEMO_NEW_X_MEMO_ARRIVED, ci->name.c_str(), MemoServ->GetQueryCommand().c_str(), ci->name.c_str(), mi->memos->size());
{
cu->user->SendMessage(MemoServ, MEMO_NEW_X_MEMO_ARRIVED, ci->name.c_str(), MemoServ->GetQueryCommand("memoserv/read").c_str(),
ci->name.c_str(), mi->memos->size());
}
}
}
}
@@ -116,7 +119,7 @@ public:
{
User *user = User::Find(na->nick, true);
if (user && user->IsIdentified())
user->SendMessage(MemoServ, MEMO_NEW_MEMO_ARRIVED, source.c_str(), MemoServ->GetQueryCommand().c_str(), mi->memos->size());
user->SendMessage(MemoServ, MEMO_NEW_MEMO_ARRIVED, source.c_str(), MemoServ->GetQueryCommand("memoserv/read").c_str(), mi->memos->size());
}
}
@@ -229,8 +232,9 @@ public:
if (!params.empty() || source.c || source.service != *MemoServ)
return;
source.Reply(_(" \n"
"Type \002%s HELP \037command\037\002 for help on any of the\n"
"above commands."), MemoServ->GetQueryCommand().c_str());
"Type \002%s \037command\037\002 for help on any of the\n"
"above commands."),
MemoServ->GetQueryCommand("generic/help").c_str());
}
};
+2 -2
View File
@@ -91,9 +91,9 @@ public:
if (Command::FindCommandFromService("memoserv/del", bi, cmd))
{
if (ci)
source.Reply(_("To delete, type: \002%s %s %s %d\002"), bi->GetQueryCommand().c_str(), cmd.c_str(), ci->name.c_str(), index + 1);
source.Reply(_("To delete, type: \002%s %s %d\002"), bi->GetQueryCommand({}, cmd).c_str(), ci->name.c_str(), index + 1);
else
source.Reply(_("To delete, type: \002%s %s %d\002"), bi->GetQueryCommand().c_str(), cmd.c_str(), index + 1);
source.Reply(_("To delete, type: \002%s %d\002"), bi->GetQueryCommand({}, cmd).c_str(), index + 1);
}
source.Reply("%s", m->text.c_str());
+3 -2
View File
@@ -232,8 +232,9 @@ public:
" LIMIT Sets the maximum number of memos you can\n"
" receive\n"
" \n"
"Type \002%s HELP %s \037option\037\002 for more information\n"
"on a specific option."), source.service->GetQueryCommand().c_str(), source.command.c_str());
"Type \002%s \037option\037\002 for more information\n"
"on a specific option."),
source.service->GetQueryCommand("generic/help", source.command).c_str());
}
else if (subcommand.equals_ci("NOTIFY"))
source.Reply(_("Syntax: \002NOTIFY {ON | LOGON | NEW | MAIL | NOMAIL | OFF}\002\n"
+6 -5
View File
@@ -221,7 +221,7 @@ public:
if (protect)
{
u->SendMessage(NickServ, NICK_IS_SECURE, NickServ->GetQueryCommand().c_str());
u->SendMessage(NickServ, NICK_IS_SECURE, NickServ->GetQueryCommand("nickserv/identify").c_str());
u->SendMessage(NickServ, _("If you do not change within %s, I will change your nick."),
Anope::Duration(protect, u->Account()).c_str());
new NickServCollide(this, this, u, na, protect);
@@ -393,8 +393,8 @@ public:
u->SendMessage(NickServ, _("You must now supply an email for your nick.\n"
"This email will allow you to retrieve your password in\n"
"case you forget it."));
u->SendMessage(NickServ, _("Type \002%s SET EMAIL \037email\037\002 in order to set your email."),
NickServ->GetQueryCommand().c_str());
u->SendMessage(NickServ, _("Type \002%s \037email\037\002 in order to set your email."),
NickServ->GetQueryCommand("nickserv/set/email").c_str());
}
for (auto *c : collides)
@@ -498,13 +498,14 @@ public:
"commands allow for registration and maintenance of\n"
"nicknames; to use them, type \002%s \037command\037\002.\n"
"For more information on a specific command, type\n"
"\002%s %s \037command\037\002.\n"), NickServ->nick.c_str(), NickServ->GetQueryCommand().c_str(), NickServ->GetQueryCommand().c_str(), source.command.c_str());
"\002%s \037command\037\002.\n"), NickServ->nick.c_str(), NickServ->GetQueryCommand().c_str(), NickServ->GetQueryCommand({}, source.command).c_str());
else
source.Reply(_("\002%s\002 allows you to register an account.\n"
"The following commands allow for registration and maintenance of\n"
"accounts; to use them, type \002%s \037command\037\002.\n"
"For more information on a specific command, type\n"
"\002%s %s \037command\037\002.\n"), NickServ->nick.c_str(), NickServ->GetQueryCommand().c_str(), NickServ->GetQueryCommand().c_str(), source.command.c_str());
"\002%s \037command\037\002.\n"),
NickServ->nick.c_str(), NickServ->GetQueryCommand().c_str(), NickServ->GetQueryCommand({}, source.command.c_str()).c_str());
return EVENT_CONTINUE;
}
+1 -1
View File
@@ -72,7 +72,7 @@ public:
*code = Anope::Random(Config->GetBlock("options").Get<size_t>("codelength", 15));
}
source.Reply(CONFIRM_DROP, na->nick.c_str(), source.service->GetQueryCommand().c_str(),
source.Reply(CONFIRM_DROP, na->nick.c_str(), source.service->GetQueryCommand("nickserv/drop").c_str(),
na->nick.c_str(), code->c_str());
return;
}
+6 -4
View File
@@ -57,8 +57,9 @@ public:
}
}
source.Reply(_("Type \002%s HELP %s \037option\037\002 for more information\n"
"on a specific option."), source.service->GetQueryCommand().c_str(), this_name.c_str());
source.Reply(_("Type \002%s \037option\037\002 for more information\n"
"on a specific option."),
source.service->GetQueryCommand("generic/help", this_name).c_str());
return true;
}
@@ -100,9 +101,10 @@ public:
}
}
source.Reply(_("Type \002%s HELP %s \037option\037\002 for more information\n"
source.Reply(_("Type \002%s \037option\037\002 for more information\n"
"on a specific option. The options will be set on the given\n"
"\037nickname\037."), source.service->GetQueryCommand().c_str(), this_name.c_str());
"\037nickname\037."),
source.service->GetQueryCommand("generic/help", this_name).c_str());
return true;
}
};