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/chanserv.cpp | |
| parent | f0708340ef8919b3a4f9f90f22187d68b06048c0 (diff) | |
Make the actual clients into services too
Diffstat (limited to 'modules/pseudoclients/chanserv.cpp')
| -rw-r--r-- | modules/pseudoclients/chanserv.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/modules/pseudoclients/chanserv.cpp b/modules/pseudoclients/chanserv.cpp index 7a5b482bb..6f5cda048 100644 --- a/modules/pseudoclients/chanserv.cpp +++ b/modules/pseudoclients/chanserv.cpp @@ -61,12 +61,19 @@ class ChanServCore : public Module { this->SetAuthor("Anope"); - ChanServ = BotInfo::Find(Config->ChanServ); - if (!ChanServ) + BotInfo *bi = BotInfo::Find(Config->ChanServ); + if (!bi) throw ModuleException("No bot named " + Config->ChanServ); Implementation i[] = { I_OnBotPrivmsg, I_OnDelCore, I_OnPreHelp, I_OnPostHelp, I_OnCheckModes }; ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); + + Service::AddAlias("BotInfo", "ChanServ", bi->nick); + } + + ~ChanServCore() + { + Service::DelAlias("BotInfo", "ChanServ"); } EventReturn OnBotPrivmsg(User *u, BotInfo *bi, Anope::string &message) anope_override |
