diff options
| author | 2020-06-26 02:00:27 -0400 | |
|---|---|---|
| committer | 2020-06-26 03:34:38 -0400 | |
| commit | 7cb56d44eb2b6db3e0e20c9b8277b00d9aa4ce3a (patch) | |
| tree | bbc5c0e821341f7b4a1b4bbde856fdcbdcb28419 | |
| parent | Fix LinePaginator new page creation (diff) | |
Simplify LinePaginator continuation header
| -rw-r--r-- | bot/pagination.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/bot/pagination.py b/bot/pagination.py index be3f82343..230cc5add 100644 --- a/bot/pagination.py +++ b/bot/pagination.py @@ -132,8 +132,9 @@ class LinePaginator(Paginator): Return a tuple in the format (reduced_words, remaining_words). """ reduced_words = [] + remaining_words = [] # "(Continued)" is used on a line by itself to indicate the continuation of last page - remaining_words = ["(Continued)\n", "---------------\n"] + continuation_header = "(Continued)\n-----------\n" reduced_char_count = 0 is_full = False @@ -147,9 +148,11 @@ class LinePaginator(Paginator): remaining_words.append(word) else: remaining_words.append(word) - - return " ".join(reduced_words), " ".join(remaining_words) if len(remaining_words) > 2 \ - else None + + return ( + " ".join(reduced_words), + continuation_header + " ".join(remaining_words) if remaining_words else None + ) @classmethod async def paginate( |