[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:
Jonathan Sider authored and GitHub committed 2023-07-12 21:59:17 -05:00
1 parent 4854201b2a
commit 50ce99ce3e
2 files changed
+7 -9

No files matched your search

+5 -2
View File
@@ -1273,8 +1273,11 @@ bool Bot::IsValidName(std::string& name)
if (!isupper(name[0]))
return false;
for (int i = 1; i < name.length(); ++i) {
if ((!RuleB(Bots, AllowCamelCaseNames) && !islower(name[i])) && name[i] != '_') {
for (char c : name.substr(1)) {
if (!RuleB(Bots, AllowCamelCaseNames) && !islower(c)) {
return false;
}
if (isdigit(c) || ispunct(c)) {
return false;
}
}