diff options
Diffstat (limited to 'src/bots.cpp')
-rw-r--r-- | src/bots.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/bots.cpp b/src/bots.cpp index ea0bf4ec3..52773dd72 100644 --- a/src/bots.cpp +++ b/src/bots.cpp @@ -233,6 +233,7 @@ CommandInfo& BotInfo::SetCommand(const Anope::string &cname, const Anope::string { CommandInfo ci; ci.name = sname; + ci.cname = cname; ci.permission = permission; this->commands[cname] = ci; return this->commands[cname]; @@ -246,6 +247,19 @@ CommandInfo *BotInfo::GetCommand(const Anope::string &cname) return NULL; } +CommandInfo *BotInfo::FindCommand(const Anope::string &service) +{ + for (auto& it : commands) + { + CommandInfo &ci = it.second; + + if (ci.name == service) + return &ci; + } + + return nullptr; +} + BotInfo* BotInfo::Find(const Anope::string &nick, bool nick_only) { BotInfo *bi = NULL; |