summaryrefslogtreecommitdiff
path: root/modules/pseudoclients/botserv.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2011-11-18 00:36:54 -0500
committerAdam <Adam@anope.org>2011-11-18 00:36:54 -0500
commit837421123996de045d240db6ee85e1215c8f436b (patch)
treebd705e1c5ebc03f43113d36b0b90fda6b3619890 /modules/pseudoclients/botserv.cpp
parent69dfc729e99f45f16cab37f81b9f09a659d99a24 (diff)
Allow having multiple fantasy characters
Diffstat (limited to 'modules/pseudoclients/botserv.cpp')
-rw-r--r--modules/pseudoclients/botserv.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/modules/pseudoclients/botserv.cpp b/modules/pseudoclients/botserv.cpp
index 0055e968f..fdaa21ed2 100644
--- a/modules/pseudoclients/botserv.cpp
+++ b/modules/pseudoclients/botserv.cpp
@@ -60,10 +60,11 @@ class BotServCore : public Module
return;
/* Fantaisist commands */
- if (c->ci->botflags.HasFlag(BS_FANTASY) && realbuf[0] == Config->BSFantasyCharacter[0] && !was_action)
+ if (c->ci->botflags.HasFlag(BS_FANTASY) && (Config->BSFantasyCharacter.empty() || realbuf.find_first_of(Config->BSFantasyCharacter) == 0) && !was_action)
{
/* Strip off the fantasy character */
- realbuf.erase(realbuf.begin());
+ if (!Config->BSFantasyCharacter.empty())
+ realbuf.erase(realbuf.begin());
size_t space = realbuf.find(' ');
Anope::string command, rest;
@@ -191,9 +192,11 @@ class BotServCore : public Module
return;
source.Reply(_(" \n"
"Bot will join a channel whenever there is at least\n"
- "\002%d\002 user(s) on it. Additionally, all %s commands\n"
- "can be used if fantasy is enabled by prefixing the command\n"
- "name with a %c."), Config->BSMinUsers, Config->ChanServ.c_str(), Config->BSFantasyCharacter[0]);
+ "\002%d\002 user(s) on it."), Config->BSMinUsers);
+ if (!Config->BSFantasyCharacter.empty())
+ source.Reply(_("Additionally, all %s commands\n"
+ "can be used if fantasy is enabled by prefixing the command\n"
+ "name with one of the following characters: %s."), Config->ChanServ.c_str(), Config->BSFantasyCharacter.c_str());
}
EventReturn OnChannelModeSet(Channel *c, ChannelModeName Name, const Anope::string &param)