diff options
| author | 2020-02-26 19:00:52 +0100 | |
|---|---|---|
| committer | 2020-02-26 19:00:52 +0100 | |
| commit | 68f97584d0e472857f07f8421001e007d5983164 (patch) | |
| tree | e147854e9956e408c3353929b727c746002ddfc0 | |
| parent | Merge pull request #781 from python-discord/bug/utils/bot-1c/reminder-unsched... (diff) | |
Make sure tag name contains at least one letter.
With only ascii and numbers being allowed to go through, possible values still included things like `$()` which don't match anything in `REGEX_NON_ALPHABET` from tags.py resulting in an error.
| -rw-r--r-- | bot/converters.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/bot/converters.py b/bot/converters.py index cca57a02d..d73ab73f1 100644 --- a/bot/converters.py +++ b/bot/converters.py @@ -175,6 +175,12 @@ class TagNameConverter(Converter): "Rejecting the request.") raise BadArgument("Are you insane? That's way too long!") + # The tag name is ascii but does not contain any letters. + elif not any(character.isalpha() for character in tag_name): + log.warning(f"{ctx.author} tried to request a tag name without letters. " + "Rejecting the request.") + raise BadArgument("Tag names must contain at least one letter.") + return tag_name |