diff options
author | 2021-02-27 11:07:47 +0100 | |
---|---|---|
committer | 2021-02-27 11:07:47 +0100 | |
commit | a95cbc501a813b18d4e11bacefef0d447578e6fe (patch) | |
tree | 4ab19f0039254b9f90ae259f49117549dbbcb2b8 | |
parent | Get the last index instead of using max (diff) |
Add digits to package covnerter
-rw-r--r-- | bot/converters.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bot/converters.py b/bot/converters.py index 2b383636c..be1f1329f 100644 --- a/bot/converters.py +++ b/bot/converters.py @@ -134,13 +134,13 @@ class PackageName(Converter): Package names are used for stats and are restricted to the a-z and _ characters. """ - PACKAGE_NAME_RE = re.compile(r"[^a-z_]") + PACKAGE_NAME_RE = re.compile(r"[^a-z0-9_]") @classmethod async def convert(cls, ctx: Context, argument: str) -> str: """Checks whether the given string is a valid package name.""" if cls.PACKAGE_NAME_RE.search(argument): - raise BadArgument("The provided package name is not valid; please only use the _ and a-z characters.") + raise BadArgument("The provided package name is not valid; please only use the _, 0-9 and a-z characters.") return argument |