diff --git a/app/cogs/star_citizen.py b/app/cogs/star_citizen.py index 4390d75d..9470af13 100644 --- a/app/cogs/star_citizen.py +++ b/app/cogs/star_citizen.py @@ -28,7 +28,7 @@ class StarCitizen(commands.Cog): embed = await star_citizen.get_ship(ship_name=ship) await ctx.send_followup(embed=embed) - @tasks.loop(seconds=60) + @tasks.loop(seconds=5) async def poll_status_page(self): # Wait until the bot is ready before we actually start executing code await self.bot.wait_until_ready() @@ -40,7 +40,8 @@ class StarCitizen(commands.Cog): current_status = soup.find("div", {"class": "global-status"}).findNext("span") - if current_status.text != "Operational": + self.notified = 0 + if current_status.text != "Operational" and self.notified == 0: # Find the lastest incident latest_incident = current_status.findNext("h2") details = latest_incident.findNext("div", {"class": "markdown"}) @@ -62,6 +63,9 @@ class StarCitizen(commands.Cog): ) channel = await self.bot.get_channel(1097567909640929340).send(embed=embed) + self.notified = 1 + else: + self.notified = 0 def setup(bot):