aboutsummaryrefslogtreecommitdiffstats
path: root/bot/utils/pagination.py
diff options
context:
space:
mode:
authorGravatar ToxicKidz <[email protected]>2021-05-03 19:23:52 -0400
committerGravatar ToxicKidz <[email protected]>2021-05-03 19:23:52 -0400
commita7279c624b093ffe826edadbc999103083710953 (patch)
treeaddd04d27f2cdf112eccd5cdf3c3818fd4d28c44 /bot/utils/pagination.py
parentchore: End the sentence with a period (diff)
chore: Don't return a Message object when the return annotation is None
Diffstat (limited to 'bot/utils/pagination.py')
-rw-r--r--bot/utils/pagination.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/bot/utils/pagination.py b/bot/utils/pagination.py
index a4d0cc56..a97dd023 100644
--- a/bot/utils/pagination.py
+++ b/bot/utils/pagination.py
@@ -79,7 +79,7 @@ class LinePaginator(Paginator):
prefix: str = "", suffix: str = "", max_lines: Optional[int] = None,
max_size: int = 500, empty: bool = True, restrict_to_user: User = None,
timeout: int = 300, footer_text: str = None, url: str = None,
- exception_on_empty_embed: bool = False):
+ exception_on_empty_embed: bool = False) -> None:
"""
Use a paginator and set of reactions to provide pagination over a set of lines.
@@ -157,7 +157,8 @@ class LinePaginator(Paginator):
log.trace(f"Setting embed url to '{url}'")
log.debug("There's less than two pages, so we won't paginate - sending single page on its own")
- return await ctx.send(embed=embed)
+ await ctx.send(embed=embed)
+ return
else:
if footer_text:
embed.set_footer(text=f"{footer_text} (Page {current_page + 1}/{len(paginator.pages)})")
@@ -302,7 +303,7 @@ class ImagePaginator(Paginator):
@classmethod
async def paginate(cls, pages: List[Tuple[str, str]], ctx: Context, embed: Embed,
prefix: str = "", suffix: str = "", timeout: int = 300,
- exception_on_empty_embed: bool = False):
+ exception_on_empty_embed: bool = False) -> None:
"""
Use a paginator and set of reactions to provide pagination over a set of title/image pairs.
@@ -352,7 +353,8 @@ class ImagePaginator(Paginator):
embed.set_image(url=image)
if len(paginator.pages) <= 1:
- return await ctx.send(embed=embed)
+ await ctx.send(embed=embed)
+ return
embed.set_footer(text=f"Page {current_page + 1}/{len(paginator.pages)}")
message = await ctx.send(embed=embed)