diff options
author | Adam <Adam@anope.org> | 2012-11-24 21:22:32 -0500 |
---|---|---|
committer | Adam <Adam@anope.org> | 2012-11-24 21:22:32 -0500 |
commit | 0210cf2b171af3f5fd4842389e653dd909c716f8 (patch) | |
tree | 2334a5d17fdc7942ff6cdde893f24020ba5e4271 /modules/pseudoclients/botserv.cpp | |
parent | f0708340ef8919b3a4f9f90f22187d68b06048c0 (diff) |
Make the actual clients into services too
Diffstat (limited to 'modules/pseudoclients/botserv.cpp')
-rw-r--r-- | modules/pseudoclients/botserv.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/modules/pseudoclients/botserv.cpp b/modules/pseudoclients/botserv.cpp index f78d0a6de..1cd67c060 100644 --- a/modules/pseudoclients/botserv.cpp +++ b/modules/pseudoclients/botserv.cpp @@ -20,14 +20,20 @@ class BotServCore : public Module { this->SetAuthor("Anope"); - BotServ = BotInfo::Find(Config->BotServ); - if (!BotServ) + BotInfo *bi = BotInfo::Find(Config->BotServ); + if (!bi) throw ModuleException("No bot named " + Config->BotServ); Implementation i[] = { I_OnPrivmsg, I_OnJoinChannel, I_OnLeaveChannel, I_OnPreHelp, I_OnPostHelp, I_OnChannelModeSet }; ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); + Service::AddAlias("BotInfo", "BotServ", bi->nick); + } + + ~BotServCore() + { + Service::DelAlias("BotInfo", "BotServ"); } void OnPrivmsg(User *u, Channel *c, Anope::string &msg) anope_override |