[commands] Change Paginator.pages to not prematurely close

This commit is contained in:
Devon R 2023-02-25 06:24:50 +09:00 committed by GitHub
parent 3644f7849c
commit 8f3224b70b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -205,7 +205,12 @@ class Paginator:
"""List[:class:`str`]: Returns the rendered list of pages."""
# we have more than just the prefix in our current page
if len(self._current_page) > (0 if self.prefix is None else 1):
self.close_page()
# Render and include current page without closing
current_page = self.linesep.join(
[*self._current_page, self.suffix] if self.suffix is not None else self._current_page
)
return [*self._pages, current_page]
return self._pages
def __repr__(self) -> str: