summaryrefslogtreecommitdiff
path: root/modules/bs_autoassign.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'modules/bs_autoassign.cpp')
-rw-r--r--modules/bs_autoassign.cpp17
1 files changed, 5 insertions, 12 deletions
diff --git a/modules/bs_autoassign.cpp b/modules/bs_autoassign.cpp
index 134904925..3604fe69b 100644
--- a/modules/bs_autoassign.cpp
+++ b/modules/bs_autoassign.cpp
@@ -11,35 +11,28 @@
class BSAutoAssign : public Module
{
- Anope::string bot;
-
public:
BSAutoAssign(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR)
{
-
- Implementation i[] = { I_OnChanRegistered, I_OnReload };
+ Implementation i[] = { I_OnChanRegistered };
ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation));
}
void OnChanRegistered(ChannelInfo *ci) anope_override
{
- if (this->bot.empty())
+ const Anope::string &bot = Config->GetModule(this)->Get<const Anope::string &>("bot");
+ if (bot.empty())
return;
- BotInfo *bi = BotInfo::Find(this->bot);
+ BotInfo *bi = BotInfo::Find(bot);
if (bi == NULL)
{
- Log(this) << "bs_autoassign is configured to assign bot " << this->bot << ", but it does not exist?";
+ Log(this) << "bs_autoassign is configured to assign bot " << bot << ", but it does not exist?";
return;
}
bi->Assign(NULL, ci);
}
-
- void OnReload(ServerConfig *conf, ConfigReader &reader) anope_override
- {
- this->bot = reader.ReadValue("bs_autoassign", "bot", "", 0);
- }
};
MODULE_INIT(BSAutoAssign)