From 5e7c4af0209ad8a9fc4ced44a4b6cef4a0ee4122 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Hells=C3=A9n?= Date: Sun, 18 Sep 2022 02:25:36 +0200 Subject: [PATCH] "Fix" /reminder list where there is only one reminder --- discord_reminder_bot/create_pages.py | 2 +- discord_reminder_bot/main.py | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/discord_reminder_bot/create_pages.py b/discord_reminder_bot/create_pages.py index 48474ae..ab78365 100644 --- a/discord_reminder_bot/create_pages.py +++ b/discord_reminder_bot/create_pages.py @@ -15,7 +15,7 @@ def create_pages(ctx) -> list[Page]: """Create pages for the paginator. Args: - ctx (interactions.Context): The context of the command. + ctx: The context of the command. Returns: list[Page]: A list of pages. diff --git a/discord_reminder_bot/main.py b/discord_reminder_bot/main.py index 4798135..9e9fe8f 100644 --- a/discord_reminder_bot/main.py +++ b/discord_reminder_bot/main.py @@ -142,12 +142,15 @@ async def list_command(ctx: interactions.CommandContext): pages = create_pages(ctx) if not pages: - await ctx.send("No reminders found.") - return + return await ctx.send("No reminders found.", ephemeral=True) if len(pages) == 1: - await ctx.send("a") - return + for page in pages: + return await ctx.send( + content="I haven't added support for buttons if there is only one reminder, " + "so you need to add another one to edit/delete this one 🙃", + embeds=page.embeds, + ) paginator: Paginator = Paginator( client=bot,