From 6b5da04ff44fca3aafd1eb3e755ef10bdb16eac3 Mon Sep 17 00:00:00 2001 From: nex <53234499+EEKIM10@users.noreply.github.com> Date: Thu, 20 Oct 2022 10:08:14 +0100 Subject: [PATCH] Fix lupupa warning again --- cogs/events.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/cogs/events.py b/cogs/events.py index 1c26076..cd6d757 100644 --- a/cogs/events.py +++ b/cogs/events.py @@ -25,14 +25,16 @@ class Events(commands.Cog): await self.bot.wait_until_ready() lupupa_warning_text = "\N{warning sign} Lupupa warning!!!" if lupupa_warning and datetime.now().strftime("%A") == "Thursday": - if self.bot.activity.name != lupupa_warning_text: - await self.bot.change_presence( - activity=discord.Activity( - name=lupupa_warning_text, - type=discord.ActivityType.watching - ), - status=discord.Status.dnd - ) + if self.bot.activity: + if self.bot.activity.name == lupupa_warning_text: + return + await self.bot.change_presence( + activity=discord.Activity( + name=lupupa_warning_text, + type=discord.ActivityType.watching + ), + status=discord.Status.dnd + ) else: await self.bot.change_presence()