1
0
mirror of https://github.com/anope/anope.git synced 2026-06-25 10:36:38 +02:00
Files
anope/modules/bs_autoassign.cpp
T
Adam 5b3f81ea78 That doesn't work either, just don't use references.
find ./ -name '*.cpp' -exec sed -i 's/Get<const Anope::string\&>/Get<const Anope::string>/g' {} \;
2013-05-05 21:05:43 -04:00

39 lines
838 B
C++

/*
*
* (C) 2003-2013 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
*
*/
#include "module.h"
class BSAutoAssign : public Module
{
public:
BSAutoAssign(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR)
{
Implementation i[] = { I_OnChanRegistered };
ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation));
}
void OnChanRegistered(ChannelInfo *ci) anope_override
{
const Anope::string &bot = Config->GetModule(this)->Get<const Anope::string>("bot");
if (bot.empty())
return;
BotInfo *bi = BotInfo::Find(bot);
if (bi == NULL)
{
Log(this) << "bs_autoassign is configured to assign bot " << bot << ", but it does not exist?";
return;
}
bi->Assign(NULL, ci);
}
};
MODULE_INIT(BSAutoAssign)