[Core] Pagify cog unload output properly (#4469)

* [Core] Pagify cog unload output properly

When you unload a large amount of cogs (close to message limit on characters), the character count is easily pushed over 2k characters on the command response with the cog names each being wrapped in 2x backticks. The current implementation breaks in the middle of cog names or wherever else it feels like it. 1600 might have been a safe value for splitting but at 1500 I don't see how multiple short cog names could make it break at least.

* Address review
This commit is contained in:
aikaterna 2020-10-11 08:43:12 -07:00 committed by GitHub
parent 5c00810166
commit ec94327b15
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1386,7 +1386,11 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic):
if output: if output:
total_message = "\n\n".join(output) total_message = "\n\n".join(output)
for page in pagify(total_message): for page in pagify(
total_message, delims=["\n", ", "], priority=True, page_length=1500
):
if page.startswith(", "):
page = page[2:]
await ctx.send(page) await ctx.send(page)
@commands.command() @commands.command()