mirror of
https://github.com/nexy7574/LCC-bot.git
synced 2024-09-19 18:16:34 +01:00
Add a ✨dynamic✨ lupupa warning
This commit is contained in:
parent
a93d3a5fa6
commit
7d4b4be66d
1 changed files with 10 additions and 4 deletions
|
@ -23,15 +23,21 @@ class Events(commands.Cog):
|
||||||
async def lupupa_warning_task(self):
|
async def lupupa_warning_task(self):
|
||||||
if not self.bot.is_ready():
|
if not self.bot.is_ready():
|
||||||
await self.bot.wait_until_ready()
|
await self.bot.wait_until_ready()
|
||||||
|
now = datetime.now()
|
||||||
lupupa_warning_text = "\N{warning sign} Lupupa warning!!!"
|
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:
|
||||||
if self.bot.activity.name == lupupa_warning_text:
|
if self.bot.activity.name == text:
|
||||||
return
|
return
|
||||||
await self.bot.change_presence(
|
await self.bot.change_presence(
|
||||||
activity=discord.Activity(
|
activity=discord.Activity(
|
||||||
name=lupupa_warning_text,
|
name=text,
|
||||||
type=discord.ActivityType.watching
|
type=discord.ActivityType.playing
|
||||||
),
|
),
|
||||||
status=discord.Status.dnd
|
status=discord.Status.dnd
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue