diff options
author | Adam <Adam@anope.org> | 2010-11-26 10:15:48 -0600 |
---|---|---|
committer | Adam <Adam@anope.org> | 2010-12-12 19:36:19 -0500 |
commit | 2b10cc84eab6cb9253611a090eb3ef67a6d3d0a7 (patch) | |
tree | ba269569cc768e14aeb49f25d639a955055ad337 /modules/core/bs_set.cpp | |
parent | cb6ef574e3df5cc846247450b74ca37d265f319e (diff) |
Added /bs set msg
Diffstat (limited to 'modules/core/bs_set.cpp')
-rw-r--r-- | modules/core/bs_set.cpp | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/modules/core/bs_set.cpp b/modules/core/bs_set.cpp index 99cf6c415..b9e06a4db 100644 --- a/modules/core/bs_set.cpp +++ b/modules/core/bs_set.cpp @@ -157,6 +157,39 @@ class CommandBSSet : public Command else SyntaxError(BotServ, u, "SET SYMBIOSIS", BOT_SET_SYMBIOSIS_SYNTAX); } + else if (option.equals_ci("MSG")) + { + if (value.equals_ci("OFF")) + { + ci->botflags.UnsetFlag(BS_MSG_PRIVMSG); + ci->botflags.UnsetFlag(BS_MSG_NOTICE); + ci->botflags.UnsetFlag(BS_MSG_NOTICEOPS); + source.Reply(BOT_SET_MSG_OFF, ci->name.c_str()); + } + else if (value.equals_ci("PRIVMSG")) + { + ci->botflags.SetFlag(BS_MSG_PRIVMSG); + ci->botflags.UnsetFlag(BS_MSG_NOTICE); + ci->botflags.UnsetFlag(BS_MSG_NOTICEOPS); + source.Reply(BOT_SET_MSG_PRIVMSG, ci->name.c_str()); + } + else if (value.equals_ci("NOTICE")) + { + ci->botflags.UnsetFlag(BS_MSG_PRIVMSG); + ci->botflags.SetFlag(BS_MSG_NOTICE); + ci->botflags.UnsetFlag(BS_MSG_NOTICEOPS); + source.Reply(BOT_SET_MSG_NOTICE, ci->name.c_str()); + } + else if (value.equals_ci("NOTICEOPS")) + { + ci->botflags.UnsetFlag(BS_MSG_PRIVMSG); + ci->botflags.UnsetFlag(BS_MSG_NOTICE); + ci->botflags.SetFlag(BS_MSG_NOTICEOPS); + source.Reply(BOT_SET_MSG_NOTICEOPS, ci->name.c_str()); + } + else + SyntaxError(BotServ, u, "SET MSG", BOT_SET_MSG_SYNTAX); + } else source.Reply(BOT_SET_UNKNOWN, option.c_str()); } @@ -186,6 +219,8 @@ class CommandBSSet : public Command u->SendMessage(BotServ, BOT_SERVADMIN_HELP_SET_NOBOT); else if (subcommand.equals_ci("PRIVATE")) u->SendMessage(BotServ, BOT_SERVADMIN_HELP_SET_PRIVATE); + else if (subcommand.equals_ci("MSG")) + u->SendMessage(BotServ, BOT_HELP_SET_MSG); else return false; |