Browse Source

[commands] Add commands.Paginator.__len__

pull/1987/head
Rapptz 6 years ago
parent
commit
25acad5de3
  1. 10
      discord/ext/commands/help.py

10
discord/ext/commands/help.py

@ -64,6 +64,12 @@ __all__ = [
class Paginator:
"""A class that aids in paginating code blocks for Discord messages.
.. container:: operations
.. describe:: len(x)
Returns the total number of characters in the paginator.
Attributes
-----------
prefix: Optional[:class:`str`]
@ -138,6 +144,10 @@ class Paginator:
self._current_page = []
self._count = 0
def __len__(self):
total = sum(len(p) for p in self._pages)
return total + self._count
@property
def pages(self):
"""Returns the rendered list of pages."""

Loading…
Cancel
Save