aboutsummaryrefslogtreecommitdiff
path: root/src/commands.cpp
diff options
context:
space:
mode:
authorGravatar Sadie Powell2020-03-18 10:54:37 +0000
committerGravatar Sadie Powell2020-03-18 11:26:05 +0000
commit92d83e91038eb54a8200815d5d948c2b61dacce4 (patch)
tree6816640245f14ba950c0ba8d080f2cf3690d94b6 /src/commands.cpp
parentForce people to use an issue template. (diff)
Allow commands to override ERR_{NEEDSMOREPARAMS,NOTREGISTERED}.
Diffstat (limited to 'src/commands.cpp')
-rw-r--r--src/commands.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/commands.cpp b/src/commands.cpp
index 8343cfaac..d1746bc5f 100644
--- a/src/commands.cpp
+++ b/src/commands.cpp
@@ -66,6 +66,17 @@ void Command::RegisterService()
throw ModuleException("Command already exists: " + name);
}
+void Command::TellNotEnoughParameters(LocalUser* user, const Params& parameters)
+{
+ user->WriteNumeric(ERR_NEEDMOREPARAMS, name, "Not enough parameters.");
+ if (ServerInstance->Config->SyntaxHints && user->registered == REG_ALL && syntax.length())
+ user->WriteNumeric(RPL_SYNTAX, name, syntax);
+}
+
+void Command::TellNotRegistered(LocalUser* user, const Params& parameters)
+{
+ user->WriteNumeric(ERR_NOTREGISTERED, name, "You have not registered.");
+}
SplitCommand::SplitCommand(Module* me, const std::string& cmd, unsigned int minpara, unsigned int maxpara)
: Command(me, cmd, minpara, maxpara)