[Bug Fix] Add check for underscores in botcreate command (#3458)

* Update bot_command.cpp with botcreate check

Check for underscores in bot names as the server will replace with a space and add to the database. The bot can't be deleted/summoned or changed except by editing the database

* Update bot_command.cpp

* Update bot_command.cpp

---------

Co-authored-by: Alex King <89047260+Kinglykrab@users.noreply.github.com>
This commit is contained in:
Jonathan Sider 2023-06-28 17:18:44 -07:00 committed by GitHub
parent a1f154749c
commit 927d379e75
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5512,6 +5512,12 @@ void bot_subcommand_bot_create(Client *c, const Seperator *sep)
std::string bot_name = sep->arg[1];
bot_name = Strings::UcFirst(bot_name);
if (Strings::Contains(bot_name, "_")) {
c->Message(Chat::White, "Bot name cannot contain underscores!");
return;
}
if (arguments < 2 || !sep->IsNumber(2)) {
c->Message(Chat::White, "Invalid class!");
return;