Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if len(l) > 25:
sub_lists = []
while len(l) > 20:
sub_lists.append(l[:20])
del l[:20]
sub_lists.append(l)
else:
sub_lists = [l]
return sub_lists
class BotEmbedPaginator(EmbedPaginator):
def __init__(self, ctx: commands.Context, pages: [discord.Embed], message: discord.Message = None):
"""
Initialize a new EmbedPaginator.
:param ctx: The :class:`discord.ext.commands.Context` to use.
:param pages: A list of :class:`discord.Embed` to paginate through.
:param message: An optional :class:`discord.Message` to edit. Otherwise a new message will be sent.
"""
self._ctx = ctx
super(BotEmbedPaginator, self).__init__(ctx.bot, pages, message)
async def run(self, channel: discord.TextChannel = None, users: List[discord.User] = None):
"""
Runs the paginator.