[Bots] Add "silent" option to ^spawn and mute raid spawn (#4494)

When zoning or forming a raid, bots would spam their spawn message. They will now be muted.

Adds an optional argument "silent" to the ^spawn command. This will bypass ^oo spawnmessage settings and not send a spawn message. Example: ^spawn Warbot silent
This commit is contained in:
nytmyr
2024-10-04 19:20:52 -05:00
committed by GitHub
parent a17f467b98
commit 7eaee2649e
2 changed files with 14 additions and 4 deletions
+11 -3
View File
@@ -857,7 +857,7 @@ void bot_command_spawn(Client *c, const Seperator *sep)
c->Message(
Chat::White,
fmt::format(
"Usage: {} [bot_name]",
"Usage: {} [bot_name] [optional: silent]",
sep->arg[0]
).c_str()
);
@@ -1045,9 +1045,17 @@ void bot_command_spawn(Client *c, const Seperator *sep)
message_index = VALIDATECLASSID(my_bot->GetClass());
}
if (c->GetBotOption(Client::booSpawnMessageSay)) {
std::string silent_confirm = sep->arg[2];
bool silentTell = false;
if (!silent_confirm.compare("silent")) {
silentTell = true;
}
if (!silentTell && c->GetBotOption(Client::booSpawnMessageSay)) {
Bot::BotGroupSay(my_bot, bot_spawn_message[message_index].c_str());
} else if (c->GetBotOption(Client::booSpawnMessageTell)) {
}
else if (!silentTell && c->GetBotOption(Client::booSpawnMessageTell)) {
my_bot->OwnerMessage(bot_spawn_message[message_index]);
}
}