Cog-Creators / Red-DiscordBot

A multi-function Discord bot
https://docs.discord.red
GNU General Public License v3.0
4.84k stars 2.31k forks source link

[Core utils] Add split after argument for pagify #5691

Open Kowlin opened 2 years ago

Kowlin commented 2 years ago

Add an argument to slow pagify to split after a deliminator. So that the delim is kept in the previous page. Use cases for this include dots, and comma's.

Jackenmen commented 2 years ago

It has been suggested to make this (splitting after) a default and to also consider adding str.splitlines-like keepends argument that would strip the delimiter if it's set to False (and I guess that means removing the "split before" functionality entirely).

The exact way this should behave is currently unclear and I think it might be a good time to write a bunch of test cases for pagify() and consider how we would want it and this new functionality to behave when it comes to stripping delimiters.