Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: added an error for caps in command_option. #918

Merged
merged 1 commit into from
Oct 4, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/dpp/slashcommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,9 @@ command_option_choice &command_option_choice::fill_from_json(nlohmann::json *j)
command_option::command_option(command_option_type t, const std::string &n, const std::string &d, bool r) :
type(t), name(n), description(d), required(r), autocomplete(false)
{
if (std::any_of(n.begin(), n.end(), [](unsigned char c){ return std::isupper(c); })) {
throw dpp::logic_exception("Command options can not contain capital letters in the name of the option.");
}
}

command_option& command_option::add_choice(const command_option_choice &o)
Expand Down
Loading