From aa854cf1f9413c537750301bc429a302d18b5d85 Mon Sep 17 00:00:00 2001 From: Toby Harradine Date: Sun, 30 Dec 2018 02:54:32 +1100 Subject: [PATCH] [CustomCom] Insert space before newline separating CC previews (#2350) Resolves #2295. Signed-off-by: Toby Harradine --- redbot/cogs/customcom/customcom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/redbot/cogs/customcom/customcom.py b/redbot/cogs/customcom/customcom.py index 59990d342..14ff10cc0 100644 --- a/redbot/cogs/customcom/customcom.py +++ b/redbot/cogs/customcom/customcom.py @@ -351,7 +351,6 @@ class CustomCommands(commands.Cog): result = responses else: continue - # Replace newlines with spaces # Cut preview to 52 characters max if len(result) > 52: result = result[:49] + "..." @@ -362,7 +361,8 @@ class CustomCommands(commands.Cog): results.append((f"{ctx.clean_prefix}{command}", result)) if await ctx.embed_requested(): - content = "\n".join(map("**{0[0]}** {0[1]}".format, results)) + # We need a space before the newline incase the CC preview ends in link (GH-2295) + content = " \n".join(map("**{0[0]}** {0[1]}".format, results)) pages = list(pagify(content, page_length=1024)) embed_pages = [] for idx, page in enumerate(pages, start=1):