always refresh even when there is still nothing to show

This commit is contained in:
Mylloon 2021-08-22 16:23:48 +02:00
parent 9046201174
commit 76962e6936
3 changed files with 4 additions and 6 deletions

View file

@ -51,8 +51,6 @@ async def listReaction(client, payload):
embed, pageMAX = await embedListeReminder(utilisateur, payload.guild_id, page, embed["color"], refresh_message)
elif type == 1:
embed, pageMAX = await embedListeToDo(utilisateur, page, embed["color"], refresh_message)
if embed == False:
return False, False
if pageMAX > 1:
await removeReactions(message, ["🔄"])
else:

View file

@ -80,7 +80,7 @@ async def embedListeReminder(utilisateur, guildID, page, color = None, refresh_m
for emoji in ["⬅️", "➡️"]:
await refresh_message.add_reaction(emoji)
else:
return (False, False)
nothing = True
if pageMAX == 1:
page = 1 # force page 1
@ -89,7 +89,7 @@ async def embedListeReminder(utilisateur, guildID, page, color = None, refresh_m
embed = Embed(description = f"**Rappel{'s' if len(reminders) > 1 else ''} de {utilisateur.mention}** • Page {page}/{pageMAX}", color = color)
embed.set_thumbnail(url = utilisateur.avatar_url_as(size = 64))
limit = 5 * page
if len(reminders) > 0 and page <= pageMAX:
if (len(reminders) > 0 and page <= pageMAX) or not nothing:
curseur = limit - 4
for reminder in reminders[limit - 5:]:
if curseur <= limit:

View file

@ -68,7 +68,7 @@ async def embedListeToDo(utilisateur, page, color = None, refresh_message = None
for emoji in ["⬅️", "➡️"]:
await refresh_message.add_reaction(emoji)
else:
return (False, False)
nothing = True
if pageMAX == 1:
page = 1 # force page 1
@ -78,7 +78,7 @@ async def embedListeToDo(utilisateur, page, color = None, refresh_message = None
embed = Embed(description = f"**To Do{s if len(todos) > 1 else ''} de {utilisateur.mention}** • Page {page}/{pageMAX}", color = color)
embed.set_thumbnail(url = utilisateur.avatar_url_as(size = 64))
limit = 5 * page
if len(todos) > 0 and page <= pageMAX:
if (len(todos) > 0 and page <= pageMAX) or not nothing:
curseur = limit - 4
for todo in todos[limit - 5:]:
if curseur <= limit: