From 680f2e2dc51cf099014ffb3c255e3e55bd3637ea Mon Sep 17 00:00:00 2001 From: Jackmcbarn Date: Thu, 24 Mar 2011 20:20:38 -0400 Subject: Add operonly option to serverbots --- src/modules/m_serverbots.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/modules/m_serverbots.cpp') diff --git a/src/modules/m_serverbots.cpp b/src/modules/m_serverbots.cpp index 47f728249..51dd2ae8e 100644 --- a/src/modules/m_serverbots.cpp +++ b/src/modules/m_serverbots.cpp @@ -37,6 +37,9 @@ class Alias /** RequiredNick must be on a ulined server */ bool ULineOnly; + /** Requires oper? */ + bool OperOnly; + /** Format that must be matched for use */ std::string format; }; @@ -129,6 +132,9 @@ class BotData return false; } + if ((a->OperOnly) && (!IS_OPER(user))) + return 0; + if (!a->RequiredNick.empty()) { User* u = ServerInstance->FindNick(a->RequiredNick); @@ -334,6 +340,7 @@ class ModuleServerBots : public Module tag->readString("replace", a.ReplaceFormat, true); a.RequiredNick = tag->getString("requires"); a.ULineOnly = tag->getBool("uline"); + a.OperOnly = tag->getBool("operonly"); a.format = tag->getString("format"); bot->Aliases.insert(std::make_pair(a.AliasedCommand, a)); -- cgit v1.3.1-10-gc9f91