mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-17 03:08:26 +00:00
[Bug Fix] Update bot naming check and add more explanation (#3491)
* Refactor my original PR Block all puncation,numbers, and _ * Add error message
This commit is contained in:
@@ -5501,11 +5501,6 @@ 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;
|
||||
@@ -8858,8 +8853,8 @@ uint32 helper_bot_create(Client *bot_owner, std::string bot_name, uint8 bot_clas
|
||||
bot_owner->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"'{}' is an invalid name. You may only use characters 'A-Z', 'a-z' and '_'.",
|
||||
bot_name
|
||||
"'{}' is an invalid name. You may only use characters 'A-Z' or 'a-z'. Mixed case {} allowed.",
|
||||
bot_name, RuleB(Bots, AllowCamelCaseNames) ? "is" : "is not"
|
||||
).c_str()
|
||||
);
|
||||
return bot_id;
|
||||
|
||||
Reference in New Issue
Block a user