From b0ed0c918e1e339d184d7f4754e99d2aa970953f Mon Sep 17 00:00:00 2001 From: Mylloon Date: Fri, 30 Jul 2021 13:13:29 +0200 Subject: [PATCH] better check for the call in the db --- src/utils/reminder.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/utils/reminder.py b/src/utils/reminder.py index 288bf85..1041501 100644 --- a/src/utils/reminder.py +++ b/src/utils/reminder.py @@ -123,9 +123,11 @@ class Reminder(Database): if page + 1 <= int(infoDescription[2]): page += 1 else: - pageMAX = -(-len(self.listeReminder(utilisateur.id, payload.guild_id)) // 5) - if pageMAX > 1: - page += 1 + if len(findall(r"L'utilisateur n'a aucun rappel en attente ou page n°\d+ vide !", embed["fields"][0]["value"])) == 1: + if len(self.listeReminder(utilisateur.id, payload.guild_id)) > 0: + page += 1 + else: + return False, False else: return False, False embed, _ = Reminder().embedListe(utilisateur, payload.guild_id, page, embed["color"])