Allow dots in the middle of repo names (#5214)

* Allow dots in the middle of repo names

* Screw you, Black
This commit is contained in:
jack1142 2021-09-02 01:45:25 +02:00 committed by GitHub
parent 8eac787f7b
commit f6cf0d5670
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -540,9 +540,15 @@ class Downloader(commands.Cog):
agreed = await do_install_agreement(ctx)
if not agreed:
return
if re.match(r"^[a-zA-Z0-9_\-]*$", name) is None:
if name.startswith(".") or name.endswith("."):
await ctx.send(_("Repo names cannot start or end with a dot."))
return
if re.match(r"^[a-zA-Z0-9_\-\.]+$", name) is None:
await ctx.send(
_("Repo names can only contain characters A-z, numbers, underscores, and hyphens.")
_(
"Repo names can only contain characters A-z, numbers, underscores, hyphens,"
" and dots."
)
)
return
try: