diff options
| author | ilotterytea <iltsu@alright.party> | 2024-05-05 15:04:31 +0500 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2024-05-05 15:04:31 +0500 |
| commit | 9b08127ee6072631f404beb7962e28fc094d820d (patch) | |
| tree | 9ccf48c2cd2891d9b31ec9ec3155b062b50c99e6 /src | |
| parent | 6d2ace56b678ac67e0736e94219ebe45e57c383a (diff) | |
feat: line ids for command arguments + added missing error line
Diffstat (limited to 'src')
| -rw-r--r-- | src/localization/line_id.cpp | 24 | ||||
| -rw-r--r-- | src/localization/line_id.hpp | 9 |
2 files changed, 31 insertions, 2 deletions
diff --git a/src/localization/line_id.cpp b/src/localization/line_id.cpp index 6ec406a..242a61c 100644 --- a/src/localization/line_id.cpp +++ b/src/localization/line_id.cpp @@ -8,7 +8,25 @@ namespace bot { std::optional<LineId> string_to_line_id(const std::string &str) { if (str == "ping.response") { return LineId::PingResponse; - } else if (str == "error.template") { + } + + else if (str == "argument.subcommand") { + return LineId::ArgumentSubcommand; + } else if (str == "argument.message") { + return LineId::ArgumentMessage; + } else if (str == "argument.interval") { + return LineId::ArgumentInterval; + } else if (str == "argument.name") { + return LineId::ArgumentName; + } else if (str == "argument.target") { + return LineId::ArgumentTarget; + } else if (str == "argument.value") { + return LineId::ArgumentValue; + } else if (str == "argument.amount") { + return LineId::ArgumentAmount; + } + + else if (str == "error.template") { return LineId::ErrorTemplate; } else if (str == "error.not_enough_arguments") { return LineId::ErrorNotEnoughArguments; @@ -24,7 +42,9 @@ namespace bot { return LineId::ErrorSomethingWentWrong; } else if (str == "error.insufficient_rights") { return LineId::ErrorInsufficientRights; - } else { + } + + else { return std::nullopt; } } diff --git a/src/localization/line_id.hpp b/src/localization/line_id.hpp index 375feb9..6f7a882 100644 --- a/src/localization/line_id.hpp +++ b/src/localization/line_id.hpp @@ -6,6 +6,14 @@ namespace bot { namespace loc { enum LineId { + ArgumentSubcommand, + ArgumentMessage, + ArgumentInterval, + ArgumentName, + ArgumentTarget, + ArgumentValue, + ArgumentAmount, + ErrorTemplate, ErrorNotEnoughArguments, ErrorIncorrectArgument, @@ -13,6 +21,7 @@ namespace bot { ErrorNamesakeCreation, ErrorNotFound, ErrorSomethingWentWrong, + ErrorExternalAPIError, ErrorInsufficientRights, PingResponse |
