From bdc17c1fefa0b9178c8eadc05f7a09c57dee2a5a Mon Sep 17 00:00:00 2001 From: Mylloon Date: Fri, 30 Jul 2021 12:59:53 +0200 Subject: [PATCH] update reminderlist even when the pageMAX in the message is less or equal than 1 --- src/utils/reminder.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/utils/reminder.py b/src/utils/reminder.py index e11ee7f..288bf85 100644 --- a/src/utils/reminder.py +++ b/src/utils/reminder.py @@ -73,7 +73,7 @@ class Reminder(Database): def embedListe(self, utilisateur, guildID, page, color = None): """Fais l'embed d'une page pour l'affichage de la liste des reminders d'un utilisateur""" reminders = self.listeReminder(utilisateur.id, guildID) - + pageMAX = -(-len(reminders) // 5) if color == None: color = Colour.random() @@ -123,7 +123,11 @@ class Reminder(Database): if page + 1 <= int(infoDescription[2]): page += 1 else: - return False, False + pageMAX = -(-len(self.listeReminder(utilisateur.id, payload.guild_id)) // 5) + if pageMAX > 1: + page += 1 + else: + return False, False embed, _ = Reminder().embedListe(utilisateur, payload.guild_id, page, embed["color"]) return message, embed return False, False