From 7d4b4be66ddb7492bebba8dfde403f68416a262c Mon Sep 17 00:00:00 2001 From: nex <53234499+EEKIM10@users.noreply.github.com> Date: Thu, 20 Oct 2022 15:54:27 +0100 Subject: [PATCH] =?UTF-8?q?Add=20a=20=E2=9C=A8dynamic=E2=9C=A8=20lupupa=20?= =?UTF-8?q?warning?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cogs/events.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/cogs/events.py b/cogs/events.py index cd6d757..da3824f 100644 --- a/cogs/events.py +++ b/cogs/events.py @@ -23,15 +23,21 @@ class Events(commands.Cog): async def lupupa_warning_task(self): if not self.bot.is_ready(): await self.bot.wait_until_ready() + now = datetime.now() lupupa_warning_text = "\N{warning sign} Lupupa warning!!!" - if lupupa_warning and datetime.now().strftime("%A") == "Thursday": + lupupa_recovery_text = "\N{loudly crying face} Lupupa recovery..." + if lupupa_warning and now.strftime("%A") == "Thursday": + if now.time() > time(15, 15): + text = lupupa_recovery_text + else: + text = lupupa_warning_text if self.bot.activity: - if self.bot.activity.name == lupupa_warning_text: + if self.bot.activity.name == text: return await self.bot.change_presence( activity=discord.Activity( - name=lupupa_warning_text, - type=discord.ActivityType.watching + name=text, + type=discord.ActivityType.playing ), status=discord.Status.dnd )