Skip to content

Commit

Permalink
Anticipate if there is no new menus posted.
Browse files Browse the repository at this point in the history
  • Loading branch information
AiroPi committed Oct 12, 2023
1 parent c5b1b35 commit f7948cd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/cogs/restauration.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ def __init__(self, bot: MP2IBot) -> None:
self.already_posted: list[str] = self.read_restauration_file()

async def cog_load(self) -> None:
await self.check_menu()
self.check_menu.start()

async def cog_unload(self) -> None:
Expand Down Expand Up @@ -91,6 +90,9 @@ async def check_menu(self) -> None:
"""Post the menu if there is a new one, checked every hour."""
menus, _ = await self.get_imgs()
menus = [m for m in menus if m not in self.already_posted] # filter with only new ones.

if not menus:
return
for img_link in menus:
self.add_restauration_file(img_link)

Expand Down

0 comments on commit f7948cd

Please sign in to comment.