summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2025-04-19 16:43:21 +0100
committerSadie Powell <sadie@witchery.services>2025-04-19 16:54:26 +0100
commit70bf013ef0bf6c8ba60e85aacca2ec97848ca0b3 (patch)
tree70ae17296baa6de7bc7ffee105702b6e28584a5a /include
parent18dfa62626468c18177ba6ff24be34f4b64f1d37 (diff)
Allow syntax messages to take a predicate.
Diffstat (limited to 'include')
-rw-r--r--include/commands.h4
-rw-r--r--include/services.h1
2 files changed, 3 insertions, 2 deletions
diff --git a/include/commands.h b/include/commands.h
index 9692f438c..49a8e2183 100644
--- a/include/commands.h
+++ b/include/commands.h
@@ -97,7 +97,7 @@ class CoreExport Command
: public Service
{
Anope::string desc;
- std::vector<Anope::string> syntax;
+ std::vector<std::pair<Anope::string, std::function<bool(CommandSource&)>>> syntax;
/* Allow unregistered users to use this command */
bool allow_unregistered;
/* Command requires that a user is executing it */
@@ -129,7 +129,7 @@ protected:
void SetDesc(const Anope::string &d);
void ClearSyntax();
- void SetSyntax(const Anope::string &s);
+ void SetSyntax(const Anope::string &s, const std::function<bool(CommandSource&)> &p = nullptr);
void SendSyntax(CommandSource &);
void AllowUnregistered(bool b);
diff --git a/include/services.h b/include/services.h
index 7f0752d11..19b837581 100644
--- a/include/services.h
+++ b/include/services.h
@@ -23,6 +23,7 @@
#include <deque>
#include <exception>
#include <fstream>
+#include <functional>
#include <iostream>
#include <list>
#include <map>