summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2025-04-09 18:17:02 +0100
committerSadie Powell <sadie@witchery.services>2025-04-10 13:34:25 +0100
commit9351debd73cb22f33bc46c201c9d66ec09ea773e (patch)
treebe92bdd1d1f288f375d6ff7fa00afc3db75e255d /modules
parent40d558ef21a438bf1dff9ac522cd852166fc4c44 (diff)
Expand GetQueryCommand to take a command name.
Diffstat (limited to 'modules')
-rw-r--r--modules/botserv/botserv.cpp4
-rw-r--r--modules/botserv/bs_badwords.cpp5
-rw-r--r--modules/botserv/bs_kick.cpp10
-rw-r--r--modules/botserv/bs_set.cpp5
-rw-r--r--modules/chanserv/chanserv.cpp5
-rw-r--r--modules/chanserv/cs_access.cpp15
-rw-r--r--modules/chanserv/cs_drop.cpp2
-rw-r--r--modules/chanserv/cs_register.cpp5
-rw-r--r--modules/chanserv/cs_set.cpp5
-rw-r--r--modules/chanserv/cs_xop.cpp8
-rw-r--r--modules/memoserv/memoserv.cpp12
-rw-r--r--modules/memoserv/ms_read.cpp4
-rw-r--r--modules/memoserv/ms_set.cpp5
-rw-r--r--modules/nickserv/nickserv.cpp11
-rw-r--r--modules/nickserv/ns_drop.cpp2
-rw-r--r--modules/nickserv/ns_set.cpp10
16 files changed, 63 insertions, 45 deletions
diff --git a/modules/botserv/botserv.cpp b/modules/botserv/botserv.cpp
index e77ffe46c..6478161bf 100644
--- a/modules/botserv/botserv.cpp
+++ b/modules/botserv/botserv.cpp
@@ -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;
diff --git a/modules/botserv/bs_badwords.cpp b/modules/botserv/bs_badwords.cpp
index a0399ef6a..789689699 100644
--- a/modules/botserv/bs_badwords.cpp
+++ b/modules/botserv/bs_badwords.cpp
@@ -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"
diff --git a/modules/botserv/bs_kick.cpp b/modules/botserv/bs_kick.cpp
index 4fb781f5d..835d90491 100644
--- a/modules/botserv/bs_kick.cpp
+++ b/modules/botserv/bs_kick.cpp
@@ -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;
}
};
diff --git a/modules/botserv/bs_set.cpp b/modules/botserv/bs_set.cpp
index 9b536e19a..7110e123b 100644
--- a/modules/botserv/bs_set.cpp
+++ b/modules/botserv/bs_set.cpp
@@ -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;
}
diff --git a/modules/chanserv/chanserv.cpp b/modules/chanserv/chanserv.cpp
index bd86410c8..4fcf3c097 100644
--- a/modules/chanserv/chanserv.cpp
+++ b/modules/chanserv/chanserv.cpp
@@ -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;
}
diff --git a/modules/chanserv/cs_access.cpp b/modules/chanserv/cs_access.cpp
index cf7ad90f4..72dc57450 100644
--- a/modules/chanserv/cs_access.cpp
+++ b/modules/chanserv/cs_access.cpp
@@ -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)
diff --git a/modules/chanserv/cs_drop.cpp b/modules/chanserv/cs_drop.cpp
index 21e7fc44f..582ede836 100644
--- a/modules/chanserv/cs_drop.cpp
+++ b/modules/chanserv/cs_drop.cpp
@@ -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;
}
diff --git a/modules/chanserv/cs_register.cpp b/modules/chanserv/cs_register.cpp
index 97bddf5cd..e8074ed19 100644
--- a/modules/chanserv/cs_register.cpp
+++ b/modules/chanserv/cs_register.cpp
@@ -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."));
diff --git a/modules/chanserv/cs_set.cpp b/modules/chanserv/cs_set.cpp
index c2298e68a..271746b49 100644
--- a/modules/chanserv/cs_set.cpp
+++ b/modules/chanserv/cs_set.cpp
@@ -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;
}
};
diff --git a/modules/chanserv/cs_xop.cpp b/modules/chanserv/cs_xop.cpp
index b005af2d1..e2e326eb8 100644
--- a/modules/chanserv/cs_xop.cpp
+++ b/modules/chanserv/cs_xop.cpp
@@ -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;
}
diff --git a/modules/memoserv/memoserv.cpp b/modules/memoserv/memoserv.cpp
index a7baa4daf..a95a1fd87 100644
--- a/modules/memoserv/memoserv.cpp
+++ b/modules/memoserv/memoserv.cpp
@@ -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());
}
};
diff --git a/modules/memoserv/ms_read.cpp b/modules/memoserv/ms_read.cpp
index d1a773838..7878027bf 100644
--- a/modules/memoserv/ms_read.cpp
+++ b/modules/memoserv/ms_read.cpp
@@ -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());
diff --git a/modules/memoserv/ms_set.cpp b/modules/memoserv/ms_set.cpp
index 672aeec3b..ac2f066ba 100644
--- a/modules/memoserv/ms_set.cpp
+++ b/modules/memoserv/ms_set.cpp
@@ -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"
diff --git a/modules/nickserv/nickserv.cpp b/modules/nickserv/nickserv.cpp
index 4221fa114..80ffaf3cc 100644
--- a/modules/nickserv/nickserv.cpp
+++ b/modules/nickserv/nickserv.cpp
@@ -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;
}
diff --git a/modules/nickserv/ns_drop.cpp b/modules/nickserv/ns_drop.cpp
index 1f6aeaad5..a51f5ce58 100644
--- a/modules/nickserv/ns_drop.cpp
+++ b/modules/nickserv/ns_drop.cpp
@@ -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;
}
diff --git a/modules/nickserv/ns_set.cpp b/modules/nickserv/ns_set.cpp
index 63568c4f1..39da08053 100644
--- a/modules/nickserv/ns_set.cpp
+++ b/modules/nickserv/ns_set.cpp
@@ -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;
}
};