better check for the call in the db

This commit is contained in:
Mylloon 2021-07-30 13:13:29 +02:00
parent bdc17c1fef
commit b0ed0c918e

View file

@ -123,9 +123,11 @@ class Reminder(Database):
if page + 1 <= int(infoDescription[2]): if page + 1 <= int(infoDescription[2]):
page += 1 page += 1
else: else:
pageMAX = -(-len(self.listeReminder(utilisateur.id, payload.guild_id)) // 5) if len(findall(r"L'utilisateur n'a aucun rappel en attente ou page n°\d+ vide !", embed["fields"][0]["value"])) == 1:
if pageMAX > 1: if len(self.listeReminder(utilisateur.id, payload.guild_id)) > 0:
page += 1 page += 1
else:
return False, False
else: else:
return False, False return False, False
embed, _ = Reminder().embedListe(utilisateur, payload.guild_id, page, embed["color"]) embed, _ = Reminder().embedListe(utilisateur, payload.guild_id, page, embed["color"])