diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/bots.h | 3 | ||||
-rw-r--r-- | include/commands.h | 11 | ||||
-rw-r--r-- | include/config.h | 2 |
3 files changed, 14 insertions, 2 deletions
diff --git a/include/bots.h b/include/bots.h index ba6fbaab6..afffc7689 100644 --- a/include/bots.h +++ b/include/bots.h @@ -122,8 +122,9 @@ class CoreExport BotInfo : public User, public Flags<BotFlag>, public Serializab * @param cname The command name * @param sname The service name * @param permission Permission required to execute the command, if any + * @return The commandinfo for the newly created command */ - void SetCommand(const Anope::string &cname, const Anope::string &sname, const Anope::string &permission = ""); + CommandInfo& SetCommand(const Anope::string &cname, const Anope::string &sname, const Anope::string &permission = ""); /** Get command info for a command * @param cname The command name diff --git a/include/commands.h b/include/commands.h index b6b2dfc1f..9f7782102 100644 --- a/include/commands.h +++ b/include/commands.h @@ -25,17 +25,26 @@ enum CommandFlag CFLAG_REQUIRE_USER }; +struct CommandGroup +{ + Anope::string name, description; +}; + /* Used in BotInfo::commands */ struct CommandInfo { typedef Anope::map<CommandInfo> map; - CommandInfo() : prepend_channel(false) { } + CommandInfo() : hide(false), prepend_channel(false) { } /* Service name of the command */ Anope::string name; /* Permission required to execute the command */ Anope::string permission; + /* Group this command is in */ + Anope::string group; + /* whether or not to hide this command in help output */ + bool hide; /* Only used with fantasy */ bool prepend_channel; }; diff --git a/include/config.h b/include/config.h index f0c293e50..c69bc7b76 100644 --- a/include/config.h +++ b/include/config.h @@ -678,6 +678,8 @@ class CoreExport ServerConfig /* Map of fantasy commands */ CommandInfo::map Fantasy; + + std::vector<CommandGroup> CommandGroups; }; /** This class can be used on its own to represent an exception, or derived to represent a module-specific exception. |