diff options
Diffstat (limited to 'modules/core/cs_main.cpp')
-rw-r--r-- | modules/core/cs_main.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/modules/core/cs_main.cpp b/modules/core/cs_main.cpp index 1aa346d41..8c1678624 100644 --- a/modules/core/cs_main.cpp +++ b/modules/core/cs_main.cpp @@ -24,8 +24,19 @@ class ChanServCore : public Module if (ChanServ == NULL) throw ModuleException("No bot named " + Config->ChanServ); - Implementation i[] = { I_OnDelChan, I_OnPreHelp, I_OnPostHelp }; - ModuleManager::Attach(i, this, 3); + Implementation i[] = { I_OnBotPrivmsg, I_OnDelChan, I_OnPreHelp, I_OnPostHelp }; + ModuleManager::Attach(i, this, 4); + } + + EventReturn OnBotPrivmsg(User *u, BotInfo *bi, Anope::string &message) + { + if (Config->CSOpersOnly && !u->HasMode(UMODE_OPER) && bi->nick == Config->ChanServ) + { + u->SendMessage(bi, ACCESS_DENIED); + return EVENT_STOP; + } + + return EVENT_CONTINUE; } void OnDelCore(NickCore *nc) |