diff options
author | Adam <Adam@anope.org> | 2011-08-04 21:59:01 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2011-08-04 21:59:01 -0400 |
commit | 9ec18a3b020932eee6242c878149c484f49b13cb (patch) | |
tree | 6f0470e27bf4f3ced0f6833db00134f4b29a79a9 /include/bots.h | |
parent | 773a1f3075fa12700d41598c0b8a8dd7caf9011e (diff) |
Added a command:permission setting
Diffstat (limited to 'include/bots.h')
-rw-r--r-- | include/bots.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/include/bots.h b/include/bots.h index 7508e4091..446287abf 100644 --- a/include/bots.h +++ b/include/bots.h @@ -13,7 +13,6 @@ class BotInfo; extern CoreExport Anope::insensitive_map<BotInfo *> BotListByNick; extern CoreExport Anope::map<BotInfo *> BotListByUID; typedef Anope::insensitive_map<BotInfo *> botinfo_map; -typedef Anope::insensitive_map<Anope::string> command_map; /** Flags settable on a bot */ @@ -39,6 +38,7 @@ class CoreExport BotInfo : public User, public Flags<BotFlag, BI_END> uint32 chancount; time_t created; /* Birth date ;) */ time_t lastmsg; /* Last time we said something */ + typedef Anope::insensitive_map<CommandInfo> command_map; command_map commands; /* Commands, actual name to service name */ /** Create a new bot. @@ -100,6 +100,19 @@ class CoreExport BotInfo : public User, public Flags<BotFlag, BI_END> * @param message The users' message */ virtual void OnMessage(User *u, const Anope::string &message); + + /** Link a command name to a command in services + * @param cname The command name + * @param sname The service name + * @param permission Permission required to execute the command, if any + */ + void SetCommand(const Anope::string &cname, const Anope::string &sname, const Anope::string &permission = ""); + + /** Get command info for a command + * @param cname The command name + * @return A struct containing service name and permission + */ + CommandInfo *GetCommand(const Anope::string &cname); }; #endif // BOTS_H |