[CustomCom] Insert space before newline separating CC previews (#2350)

Resolves #2295.

Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
This commit is contained in:
Toby Harradine 2018-12-30 02:54:32 +11:00 committed by Kowlin
parent 2bd05a5a04
commit aa854cf1f9

View File

@ -351,7 +351,6 @@ class CustomCommands(commands.Cog):
result = responses result = responses
else: else:
continue continue
# Replace newlines with spaces
# Cut preview to 52 characters max # Cut preview to 52 characters max
if len(result) > 52: if len(result) > 52:
result = result[:49] + "..." result = result[:49] + "..."
@ -362,6 +361,7 @@ class CustomCommands(commands.Cog):
results.append((f"{ctx.clean_prefix}{command}", result)) results.append((f"{ctx.clean_prefix}{command}", result))
if await ctx.embed_requested(): if await ctx.embed_requested():
# 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)) content = " \n".join(map("**{0[0]}** {0[1]}".format, results))
pages = list(pagify(content, page_length=1024)) pages = list(pagify(content, page_length=1024))
embed_pages = [] embed_pages = []