[3.4] Allow dots in the middle of repo names (#5214) (#5281)

* Allow dots in the middle of repo names

* Screw you, Black
(cherry picked from commit f6cf0d5670)

Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>

Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
This commit is contained in:
Red-GitHubBot
2021-09-08 22:07:43 +02:00
committed by GitHub
parent c8992a4281
commit 96421a6dfa

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: