1
0
mirror of https://github.com/anope/anope.git synced 2026-07-01 12:26:39 +02:00

Allow syntax messages to take a predicate.

This commit is contained in:
Sadie Powell
2025-04-19 16:43:21 +01:00
parent 18dfa62626
commit 70bf013ef0
7 changed files with 73 additions and 60 deletions
+2 -2
View File
@@ -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);
+1
View File
@@ -23,6 +23,7 @@
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iostream>
#include <list>
#include <map>