From f6cf0d56708a1aff930bc146aaee3ff1e3da5934 Mon Sep 17 00:00:00 2001 From: jack1142 <6032823+jack1142@users.noreply.github.com> Date: Thu, 2 Sep 2021 01:45:25 +0200 Subject: [PATCH] Allow dots in the middle of repo names (#5214) * Allow dots in the middle of repo names * Screw you, Black --- redbot/cogs/downloader/downloader.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/redbot/cogs/downloader/downloader.py b/redbot/cogs/downloader/downloader.py index 4eb6d6781..5771b8119 100644 --- a/redbot/cogs/downloader/downloader.py +++ b/redbot/cogs/downloader/downloader.py @@ -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: