/* whether or not +B users are allowed to use fantasy commands */
bool AllowBots;
+ UserModeReference botmode;
- void ReadAliases()
+ public:
+ void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE
{
ConfigTag* fantasy = ServerInstance->Config->ConfValue("fantasy");
AllowBots = fantasy->getBool("allowbots", false);
}
}
- public:
- void init() CXX11_OVERRIDE
+ ModuleAlias()
+ : botmode(this, "bot")
{
- ReadAliases();
- Implementation eventlist[] = { I_OnPreCommand, I_OnRehash, I_OnUserMessage };
- ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation));
}
Version GetVersion() CXX11_OVERRIDE
}
/* Stop here if the user is +B and allowbot is set to no. */
- if (!AllowBots && user->IsModeSet('B'))
+ if (!AllowBots && user->IsModeSet(botmode))
{
return;
}
ServerInstance->Parser->CallHandler(command, pars, user);
}
- void OnRehash(User* user) CXX11_OVERRIDE
- {
- ReadAliases();
- }
-
void Prioritize()
{
// Prioritise after spanningtree so that channel aliases show the alias before the effects.